feat(tui): reinsert forked message text in prompt text input box when forking session (resolves #5495) (#5545)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Ariane Emory
2025-12-19 21:45:33 -06:00
committed by GitHub
co-authored by github-actions[bot]
parent 701d470d01
commit 755ddbb223
4 changed files with 37 additions and 0 deletions
@@ -80,9 +80,25 @@ export function DialogMessage(props: {
sessionID: props.sessionID,
messageID: props.messageID,
})
const initialPrompt = (() => {
const msg = message()
if (!msg) return undefined
const parts = sync.data.part[msg.id]
return parts.reduce(
(agg, part) => {
if (part.type === "text") {
if (!part.synthetic) agg.input += part.text
}
if (part.type === "file") agg.parts.push(part)
return agg
},
{ input: "", parts: [] as PromptInfo["parts"] },
)
})()
route.navigate({
sessionID: result.data!.id,
type: "session",
initialPrompt,
})
dialog.clear()
},