Repository navigation
feat(workbench): edit a message in place and fork only when it is sent - #6781
Conversation
The pencil on a user message forked the conversation at once and then waited, with only "Confirming action…" on the original conversation, before opening the fork with the text in its composer. Opening the editor and leaving it still left a fork behind. The pencil now opens an editor in the message's place, which reads the original itself and keeps the edit in the conversation's row state, so it survives the row scrolling out of view. Nothing is created until the edit is sent; sending forks before the message's turn, opens the fork and sends the edited text there through the path regenerate already uses. Escape or Cancel closes the editor, and a failed fork keeps the text. A message with attachments or references still forks at once and fills the fork's composer, since the editor carries text only. While a fork is created, the action feedback says so instead of the generic confirmation. Generated-by: Claude Code
M4n5ter
left a comment
There was a problem hiding this comment.
English
InlineEdit.notice is declared as string, but the assignments from errorText() and uiMessage() return UiText, causing three TS2322 errors. The notice is also rendered directly without resolving the localized value.
Please store it as UiText and call renderText() when displaying it. This also preserves updates when the locale changes.
The new Escape assertion in desktop_new_session.rs also needs rustfmt.
中文
InlineEdit.notice 声明为 string,但 errorText() 和 uiMessage() 的赋值返回的是 UiText,导致三处 TS2322 错误。展示 notice 时也没有解析本地化内容。
建议保存为 UiText,展示时调用 renderText(),同时保留切换语言后的更新能力。
另外,desktop_new_session.rs 新增的 Escape 断言需要 rustfmt。
Generated-by: Claude Code
EnglishThanks. Fixed in the latest commit: Ran locally: the The other failing job, 中文谢谢,已在最新提交中修复: 本地已跑: 另一个失败的任务 |
Summary
On desktop, the pencil on a user message forked the conversation immediately. The original conversation then showed only the generic "Confirming action…" until the fork opened with the text in its composer. Users did not expect a new conversation, could not tell how long it would take, and an edit opened and abandoned still left a fork behind.
The pencil now opens an editor in the message's place. It shows the original text, Cancel and Send, and a note that sending continues in a new conversation. Nothing is created until Send. Sending forks before the message's turn, opens the fork, and sends the edited text there through the path "Regenerate in a fork" already uses. Escape or Cancel closes the editor without a trace. A failed fork keeps the edited text and shows the reason.
The Host fork itself is untouched. I have not yet measured how long the fork takes on long conversations. That will be a separate issue if it turns out to be slow.
Verification
desktop_edits_a_message_in_place_and_forks_only_when_sent(native desktop, real Host). The pencil opens the editor with the original text and creates no session. Escape closes it and still no session exists. Editing and sending creates exactly one fork, and the provider receives the edited text without the original message. Fails with fork-on-click restored.desktop_message_actions_show_on_hover_or_focus_and_in_a_context_menu: passes.desktop_continues_a_failed_run_without_duplicating_the_user_messagefails locally ("the submitted message did not reach the provider"), identically on unmodifiedrust-preview.biome formaton the changed files,rustfmt --checkon the test file, and workbenchnode --test(112 passed).AI use
Tool(s) and scope: Claude Code — implementation and the desktop test; the interaction design was discussed with a second Claude model.
Checklist
Does this PR entail a change in behavior?