[GH-ISSUE #3823] [GUI] Let users choose between in-place edit/resend and branching when rewinding a message #1619

Closed
opened 2026-11-04 01:52:41 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @xvcezrqpbxtpzblrt on GitHub (Oct 23, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3823

Area

[GUI] (the desktop app)

What do you want to do?

Problem. In the desktop chat, a sent message has a refresh icon labeled “Rewind to here” (回退到此处). Clicking it does not rewind the open conversation. It immediately creates a new session, switches to it, and puts the old prompt in that new chat's composer. The original chat remains in the sidebar, but the action's label and its result disagree. The app appears to open a new conversation; in the code this is a route change to a new session ID, not a native window.

The first-message case is the most confusing: the new chat has no messages, and after the next send its title is replaced by the new prompt, so the visible (branch) suffix disappears and it is indistinguishable from a brand-new chat.

This is a missing choice, not a request to remove branching. The branch behavior was a deliberate safety fix: the older in-place rewindTo truncated the current transcript, and that was tracked as CHAT-05 / P0 in design-improvements-2026-10-05.md. The replacement preserves the original and opens a branch (annotation 32). That safety property should remain.

Why the current control is misleading.

  • “Rewind to here” reads as an action on the current conversation, but rewindTo() calls branchFrom() and navigates to a new session (store.ts L1499-1509, L1447-1477); it never edits the current transcript.
  • The session model has no parent/child link; the only relationship marker is the literal English suffix (branch) in the title (types.ts L434-465). A first-message rewind leaves zero messages, so the next send replaces that title (store.ts L1691).
  • A custom chat folder is keyed by chat ID and is not copied to the branch (chat-files.mjs L35-57), so an agent branch falls back to another working directory (index.mjs L586).
  • rewindTo() restores only the message text. Photos attached to the selected message are not returned to the composer.
  • The branch is created on click, before the user decides to send; cancelling leaves the extra session behind.
  • There is no confirmation, toast, undo, or visible “back to original chat” link. The tooltip is the only explanation.

Proposal: ask at action time, before creating anything.

Replace the implicit “Rewind to here” action with a small menu (or dialog) anchored to the message action:

  1. Edit and resend in this chat — primary, and the default if a default is required. Hide the selected message and all later messages from the active transcript, put the selected prompt and its attachments in the composer, and keep the removed turns in a per-chat snapshot/version history with Undo. Resending continues the same session ID.
  2. Branch from here — secondary; keep today's behavior: preserve the original and open a separate branch for the edited prompt.
  3. Cancel — change nothing.

Labels should say what happens; do not use “Rewind” alone for either path.

Safe in-place behavior.

  • Snapshot the full session before changing it. Later messages must remain recoverable; this is not the old destructive truncation.
  • Show the restore point (for example “3 messages hidden · Undo” or a history entry), not just a transient toast.
  • Restore the selected message's text and attachments to the composer.
  • Keep the chat's folder, model, permissions, system prompt and other settings unchanged.
  • Reset or rebuild the host agent context at the cut. The agent bridge keeps a Harness session per chat ID (agent-bridge.mjs L286-296); slicing only the renderer transcript would leave the model remembering messages hidden in the UI. The next turn must start from the truncated history.
  • Conversation rewind must not imply file rollback. Files created or changed after the cut stay on disk; workspace checkpointing is a separate feature.

Branch behavior and edge cases.

  • Create the branch after the user chooses “Branch from here”; if they back out before sending, remove the empty draft branch rather than leaving an unused (branch) chat.
  • Record a parent session ID (or equivalent link) and show “Branched from …” with a way to open the original. Do not rely on a title suffix.
  • Inherit the selected message's attachments and the chat's custom folder; the branch's new ID has no entry in chat-folders.json today.
  • Keep a stable branch title when the first message is rewound; do not replace the (branch) marker with the new prompt on the first send.
  • Make clear that only the prefix is carried into the branch. Later messages, tool results and files remain in the original conversation, and files are not rolled back.
  • Disable both choices during generation, as the current button does.

Implementation notes.

Duplicate search. I searched open and closed issues and PRs for rewind, branch, edit message, resend, 回退, 分支 and 编辑消息. No existing desktop-app report for this choice was found. PR #2615 is the Python web chat's edit/retry/rewind, not the desktop app. PR #734 and #2843 are engine cache work for rewritten history. Issue #271 asked for message deletion. The existing branch design is documented, not reported as a defect.

What do you do today instead?

Users can click “Branch from here” (or “Rewind to here”, which currently does the same) and then find the original chat in the sidebar, or manually start a new chat and retype the prompt. That preserves the original but provides no in-place edit, and the extra branch remains if they change their mind.

Environment and reproduction status. Strata 0.2.3 (5c8dd322528cc84f68f461ad54a506b9da8fa8d4), Windows 11 desktop, installed build. The behavior is reported from the installed app; the code path above was confirmed by source inspection of the same commit. I did not run a separate GUI reproduction. Current origin/main is still 5c8dd32.

Originally created by @xvcezrqpbxtpzblrt on GitHub (Oct 23, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/3823 ### Area [GUI] (the desktop app) ### What do you want to do? **Problem.** In the desktop chat, a sent message has a refresh icon labeled “Rewind to here” (`回退到此处`). Clicking it does not rewind the open conversation. It immediately creates a new session, switches to it, and puts the old prompt in that new chat's composer. The original chat remains in the sidebar, but the action's label and its result disagree. The app appears to open a new conversation; in the code this is a route change to a new session ID, not a native window. The first-message case is the most confusing: the new chat has no messages, and after the next send its title is replaced by the new prompt, so the visible `(branch)` suffix disappears and it is indistinguishable from a brand-new chat. This is a missing choice, not a request to remove branching. The branch behavior was a deliberate safety fix: the older in-place `rewindTo` truncated the current transcript, and that was tracked as CHAT-05 / P0 in [design-improvements-2026-10-05.md](https://github.com/Niko1221/Strata/blob/5c8dd322528cc84f68f461ad54a506b9da8fa8d4/apps/host/docs/design-improvements-2026-10-05.md#L214-L215). The replacement preserves the original and opens a branch ([annotation 32](https://github.com/Niko1221/Strata/blob/5c8dd322528cc84f68f461ad54a506b9da8fa8d4/apps/host/docs/annotations-32-2026-10-09.md#L42)). That safety property should remain. **Why the current control is misleading.** - “Rewind to here” reads as an action on the current conversation, but `rewindTo()` calls `branchFrom()` and navigates to a new session ([store.ts L1499-1509](https://github.com/Niko1221/Strata/blob/5c8dd322528cc84f68f461ad54a506b9da8fa8d4/apps/host/src/lib/store.ts#L1499-L1509), [L1447-1477](https://github.com/Niko1221/Strata/blob/5c8dd322528cc84f68f461ad54a506b9da8fa8d4/apps/host/src/lib/store.ts#L1447-L1477)); it never edits the current transcript. - The session model has no parent/child link; the only relationship marker is the literal English suffix `(branch)` in the title ([types.ts L434-465](https://github.com/Niko1221/Strata/blob/5c8dd322528cc84f68f461ad54a506b9da8fa8d4/apps/host/src/lib/types.ts#L434-L465)). A first-message rewind leaves zero messages, so the next send replaces that title ([store.ts L1691](https://github.com/Niko1221/Strata/blob/5c8dd322528cc84f68f461ad54a506b9da8fa8d4/apps/host/src/lib/store.ts#L1691)). - A custom chat folder is keyed by chat ID and is not copied to the branch ([chat-files.mjs L35-57](https://github.com/Niko1221/Strata/blob/5c8dd322528cc84f68f461ad54a506b9da8fa8d4/apps/host/server/chat-files.mjs#L35-L57)), so an agent branch falls back to another working directory ([index.mjs L586](https://github.com/Niko1221/Strata/blob/5c8dd322528cc84f68f461ad54a506b9da8fa8d4/apps/host/server/index.mjs#L586)). - `rewindTo()` restores only the message text. Photos attached to the selected message are not returned to the composer. - The branch is created on click, before the user decides to send; cancelling leaves the extra session behind. - There is no confirmation, toast, undo, or visible “back to original chat” link. The tooltip is the only explanation. **Proposal: ask at action time, before creating anything.** Replace the implicit “Rewind to here” action with a small menu (or dialog) anchored to the message action: 1. **Edit and resend in this chat** — primary, and the default if a default is required. Hide the selected message and all later messages from the active transcript, put the selected prompt and its attachments in the composer, and keep the removed turns in a per-chat snapshot/version history with Undo. Resending continues the same session ID. 2. **Branch from here** — secondary; keep today's behavior: preserve the original and open a separate branch for the edited prompt. 3. **Cancel** — change nothing. Labels should say what happens; do not use “Rewind” alone for either path. **Safe in-place behavior.** - Snapshot the full session before changing it. Later messages must remain recoverable; this is not the old destructive truncation. - Show the restore point (for example “3 messages hidden · Undo” or a history entry), not just a transient toast. - Restore the selected message's text and attachments to the composer. - Keep the chat's folder, model, permissions, system prompt and other settings unchanged. - Reset or rebuild the host agent context at the cut. The agent bridge keeps a Harness session per chat ID ([agent-bridge.mjs L286-296](https://github.com/Niko1221/Strata/blob/5c8dd322528cc84f68f461ad54a506b9da8fa8d4/apps/host/server/agent/agent-bridge.mjs#L286-L296)); slicing only the renderer transcript would leave the model remembering messages hidden in the UI. The next turn must start from the truncated history. - Conversation rewind must not imply file rollback. Files created or changed after the cut stay on disk; workspace checkpointing is a separate feature. **Branch behavior and edge cases.** - Create the branch after the user chooses “Branch from here”; if they back out before sending, remove the empty draft branch rather than leaving an unused `(branch)` chat. - Record a parent session ID (or equivalent link) and show “Branched from …” with a way to open the original. Do not rely on a title suffix. - Inherit the selected message's attachments and the chat's custom folder; the branch's new ID has no entry in `chat-folders.json` today. - Keep a stable branch title when the first message is rewound; do not replace the `(branch)` marker with the new prompt on the first send. - Make clear that only the prefix is carried into the branch. Later messages, tool results and files remain in the original conversation, and files are not rolled back. - Disable both choices during generation, as the current button does. **Implementation notes.** - Button and current handler: [Chat.tsx L624-628](https://github.com/Niko1221/Strata/blob/5c8dd322528cc84f68f461ad54a506b9da8fa8d4/apps/host/src/screens/Chat.tsx#L624-L628); the separate “Branch from here” item is [L629](https://github.com/Niko1221/Strata/blob/5c8dd322528cc84f68f461ad54a506b9da8fa8d4/apps/host/src/screens/Chat.tsx#L629). - `rewindTo` / `branchFrom`: [store.ts L1499-1509](https://github.com/Niko1221/Strata/blob/5c8dd322528cc84f68f461ad54a506b9da8fa8d4/apps/host/src/lib/store.ts#L1499-L1509), [L1447-1477](https://github.com/Niko1221/Strata/blob/5c8dd322528cc84f68f461ad54a506b9da8fa8d4/apps/host/src/lib/store.ts#L1447-L1477); first-send title replacement: [L1691](https://github.com/Niko1221/Strata/blob/5c8dd322528cc84f68f461ad54a506b9da8fa8d4/apps/host/src/lib/store.ts#L1691). - Session shape has no parent field: [types.ts L434-465](https://github.com/Niko1221/Strata/blob/5c8dd322528cc84f68f461ad54a506b9da8fa8d4/apps/host/src/lib/types.ts#L434-L465). - Per-chat folder: [chat-files.mjs L35-57](https://github.com/Niko1221/Strata/blob/5c8dd322528cc84f68f461ad54a506b9da8fa8d4/apps/host/server/chat-files.mjs#L35-L57), [index.mjs L586](https://github.com/Niko1221/Strata/blob/5c8dd322528cc84f68f461ad54a506b9da8fa8d4/apps/host/server/index.mjs#L586). - Agent session reuse: [agent-bridge.mjs L286-296](https://github.com/Niko1221/Strata/blob/5c8dd322528cc84f68f461ad54a506b9da8fa8d4/apps/host/server/agent/agent-bridge.mjs#L286-L296). - The branch was documented as the safety fix: [design-improvements L214-215](https://github.com/Niko1221/Strata/blob/5c8dd322528cc84f68f461ad54a506b9da8fa8d4/apps/host/docs/design-improvements-2026-10-05.md#L214-L215), [annotations-32 L42](https://github.com/Niko1221/Strata/blob/5c8dd322528cc84f68f461ad54a506b9da8fa8d4/apps/host/docs/annotations-32-2026-10-09.md#L42). - Existing automated coverage does not exercise this UI flow. A regression test should cover both choices, the first-message case, undo and the parent link. **Duplicate search.** I searched open and closed issues and PRs for `rewind`, `branch`, `edit message`, `resend`, `回退`, `分支` and `编辑消息`. No existing desktop-app report for this choice was found. PR #2615 is the Python web chat's edit/retry/rewind, not the desktop app. PR #734 and #2843 are engine cache work for rewritten history. Issue #271 asked for message deletion. The existing branch design is documented, not reported as a defect. ### What do you do today instead? Users can click “Branch from here” (or “Rewind to here”, which currently does the same) and then find the original chat in the sidebar, or manually start a new chat and retype the prompt. That preserves the original but provides no in-place edit, and the extra branch remains if they change their mind. **Environment and reproduction status.** Strata 0.2.3 (`5c8dd322528cc84f68f461ad54a506b9da8fa8d4`), Windows 11 desktop, installed build. The behavior is reported from the installed app; the code path above was confirmed by source inspection of the same commit. I did not run a separate GUI reproduction. Current `origin/main` is still `5c8dd32`.
Author
Owner

@Niko1221 commented on GitHub (Oct 27, 2026):

Thank you, the label and the result did disagree. Fixed in 0.2.7: "Rewind to here" now asks what you want, edit and send again here (with an Undo bar) or branch into a new saved chat, and a branch is titled "Branch of ..." so the first message does not rename it. One-level undo stays in memory only; a persistent snapshot is not done.

Release: https://github.com/Niko1221/Strata/releases/tag/v0.2.7

<!-- gh-comment-id:6446162117 --> @Niko1221 commented on GitHub (Oct 27, 2026): Thank you, the label and the result did disagree. Fixed in 0.2.7: "Rewind to here" now asks what you want, edit and send again here (with an Undo bar) or branch into a new saved chat, and a branch is titled "Branch of ..." so the first message does not rename it. One-level undo stays in memory only; a persistent snapshot is not done. Release: https://github.com/Niko1221/Strata/releases/tag/v0.2.7
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#1619
No description provided.