Skip to content

feat(workbench): edit a message in place and fork only when it is sent - #6781

Merged
M4n5ter merged 2 commits into
rust-previewfrom
feat/desktop-inline-message-edit
Nov 11, 2026
Merged

M4n5ter merged 2 commits into
rust-previewfrom
feat/desktop-inline-message-edit

Conversation

@UncertaintyDeterminesYou4ndMe

Copy link
Copy Markdown
Contributor

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 edit lives in the conversation's per-row state, and the editor reads the original itself. An edit therefore survives the row being virtualized away. The action row cannot own it: the editor replaces that row and unmounts it.
  • A message with attachments or references keeps the current behavior (fork at once, text in the fork's composer). The editor carries text only, so it does not silently drop them.
  • While a fork is being created, the action feedback says "Creating fork…" instead of "Confirming action…". This also applies to Regenerate.
  • The terminal UI has no pencil and is unchanged.

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

  • New 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_message fails locally ("the submitted message did not reach the provider"), identically on unmodified rust-preview.
  • biome format on the changed files, rustfmt --check on the test file, and workbench node --test (112 passed).

AI use

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Claude Code — implementation and the desktop test; the interaction design was discussed with a second Claude model.

Checklist

  • Tests cover the change and fail without it
  • Format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

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 M4n5ter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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。

@UncertaintyDeterminesYou4ndMe

Copy link
Copy Markdown
Contributor Author
English

Thanks. Fixed in the latest commit: InlineEdit.notice is now UiText, and the editor shows it through renderText(), so it follows locale changes. The test file is formatted with rustfmt.

Ran locally: the ui_types + tsc check from the contracts step (no errors), cargo fmt --all -- --check, and desktop_edits_a_message_in_place_and_forks_only_when_sent (passes).

The other failing job, root-tests (native, slice:7/8), fails in maka-agent-native owner::driver::tests::model_recovery::delegated_notifications_survive_caller_failure_before_consumption. This PR does not touch that code.

中文

谢谢,已在最新提交中修复:InlineEdit.notice 改为 UiText,编辑框通过 renderText() 显示,切换语言后会跟着更新。测试文件已用 rustfmt 格式化。

本地已跑:contracts 步骤里的 ui_types + tsc 检查(无错误)、cargo fmt --all -- --check,以及 desktop_edits_a_message_in_place_and_forks_only_when_sent(通过)。

另一个失败的任务 root-tests (native, slice:7/8) 失败在 maka-agent-native owner::driver::tests::model_recovery::delegated_notifications_survive_caller_failure_before_consumption,这个 PR 没有改动那部分代码。

@M4n5ter
M4n5ter merged commit f151416 into rust-preview Nov 11, 2026
@M4n5ter
M4n5ter deleted the feat/desktop-inline-message-edit branch November 11, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants