Repository navigation
feat(chats): fork from any message on desktop - #343
Conversation
The app body sets user-select: none and only assistant Markdown opted back in, so a sent user prompt could not be selected with the pointer. The user bubble and the unrenderable-message fallback now allow text selection. An Electron E2E drags across a sent prompt and reads the selection back. Adds docs/plans/chat-fork-plan.md: fork a chat from any message on desktop, Remote, iOS and Android, informed by opencode and pi. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Settled replies offer "Fork from here" and sent prompts offer "Edit in fork", which copies everything before the prompt and pre-fills the new chat's composer with its text and attachments. Editing the first prompt opens an unsaved draft instead of persisting an empty chat. Forks record a strictly parsed `forkedFrom` lineage and are titled `Title (fork)`, `(fork 2)`, ... per workspace. The chat header links back to the source (or notes it was deleted) and sidebar rows carry a fork glyph. A corrupt lineage is dropped on read rather than hiding the chat. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Important
Three edge cases need fixing before merging: Bot first-prompt edits bypass the intended restriction, long titles lose fork numbering, and image-only replies have no per-message fork action.
Reviewed changes Reviewed the desktop fork flow from transcript actions and /fork through IPC, persisted copies, composer prefill, and lineage display.
- Fork boundaries. Adds explicit before-prompt and after-reply cuts, strict lineage parsing, and workspace-scoped fork-title numbering while retaining legacy Bot copying.
- Desktop interactions. Adds transcript actions and picker edits, composer text/attachment prefill, first-prompt unsaved drafts, and source-chat links and sidebar glyphs.
- Coverage and scope. Adds parser, store, rendered-transcript, and Electron E2E coverage; Pi journal copying, summaries, Remote/CLI routes, and native fork UI are explicitly deferred.
- Verification. Chat/session tests (526), sidebar tests (98), rich-link/transcript tests (49), and mounted composer tests (4) passed, as did application and E2E type-checks. Direct helper and renderer reproductions confirmed the title and image-only findings; Electron E2E execution was not available on this Linux runner.
gpt-6.1-sol | 𝕏
Hermes Review BotConfidence: 5 Engine: SummaryAdds transcript-level and composer picker controls to fork workspace chats from any message on desktop, landing Part 1 of the chat fork plan along with pointer-selectable sent prompts (#342). Completed assistant replies gain a "Fork from here" action cutting through that turn, while sent user prompts gain an "Edit in fork" action that cuts strictly before the prompt, seeds the new chat's composer with the prompt text and attachments, or opens an unsaved draft on the first prompt to avoid saving empty conversations. Provenance is tracked in a strictly validated Confidence Score: 5/5Full end-to-end verification across IPC boundary parsers, store transaction locks, title numbering, reactive query caches, draft and attachment lifecycle, accessibility attributes, and test coverage. 📁 Important Files Changed
FindingsNo findings. Sequence DiagramsequenceDiagram
autonumber
actor User
participant Pane as ChatPane
participant Store as ComposerDraftStore
participant IPC as chatsApi (IPC)
participant Main as ChatStore (main)
participant Composer as Composer
alt Edit prompt in fork (Prompt 2+)
User->>Pane: Click "Edit in fork" on prompt
Pane->>IPC: copyVisibleHistory(chatId, { messageId, position: "before" })
IPC->>Main: copyVisibleHistory({ forkAt })
Main->>Main: Slice messages before prompt & assign (fork N) title
Main->>Main: Persist chat & index with forkedFrom lineage
Main-->>IPC: Copied Chat
IPC-->>Pane: Copied Chat
Pane->>Store: saveComposerDraftText(newId, text)
Pane->>Store: seedComposerAttachments(newId, attachments)
Pane->>Pane: navigate("/chat/" + newId)
Pane->>Composer: Mount Composer(chatId=newId)
Composer->>Store: loadComposerDraft(newId) -> text
Composer->>Store: takeComposerAttachmentSeed(newId) -> attachments
Composer-->>User: Ready to edit prompt with attachments
else Edit first prompt in fork (Prompt 1)
User->>Pane: Click "Edit in fork" on first prompt
Pane->>Pane: createChatDraft(workspaceId, initialText=text)
Pane->>Store: seedComposerAttachments(draftId, attachments)
Pane->>Pane: navigate("/chat/" + draftId)
Pane->>Composer: Mount Composer(chatId=draftId)
Composer->>Store: takeComposerAttachmentSeed(draftId)
Composer-->>User: Open unsaved draft (no empty chat on disk)
end
[]
|
- Bot chats no longer offer Edit in fork in the /fork picker, and the renderer refuses a before-prompt fork for them, including the first-prompt draft shortcut that never reached IPC. - Fork titles keep numbering when a long base title was truncated to fit its suffix. - Settled replies with only attachments or tool activity now show Fork from here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes Reviewed the fixes and CI test registration added since the prior Pullfrog review at 668dd90e.
- Blocked Bot prompt edits. Removed Bot picker edit actions and rejected before-prompt forks before the first-prompt draft shortcut, preserving after-reply copying.
- Preserved long-title numbering. Counted truncated sibling titles so sequential and nested forks continue numbering across wider numeric suffixes.
- Restored no-prose actions. Added fork-only action rows for settled attachment-only and activity-only replies without duplicating Copy or prose-response actions.
- Registered CI coverage. Assigned the fork contract test to a desktop unit lane.
- Verified behavior. Passed
test:slash-commands(529 tests),test:tts(148),test:ci:registry(10), and application type-checking; additional helper checks covered 315 sequential and 315 nested forks. Electron E2E was not rerun on this Linux runner.
gpt-6.1-sol | 𝕏

Summary
Part 1 of the chat fork plan. It also contains #342's commit (sent prompts become pointer-selectable). #342 touches only
renderer/and docs, so the required Linux checks never post on it; this PR runs them, and merging it lands #342 too./forkpicker rows.forkedFrom { chatId, messageId, position, at }.aria-description.Title (fork), then(fork 2)and so on, numbered per workspace. Forks of forks reuse the base title.aria-disabled, and say why.beforeis rejected; the existing/forkafter-reply path is unchanged.chats:copyVisibleHistorynow also accepts{chatId, messageId, position}. The legacy{chatId, throughMessageId}still means "fork after this reply".Not in this PR (follow-ups in the plan):
ChatApplicationService(lands with the Remote route).Tests
chat-session-copy.test.ts):afterandbeforecuts, the error cases,(fork N)numbering including forks of forks, lineage surviving a restart and a source deletion, and a corrupt lineage being dropped without hiding the chat.chat-copy-contract.test.ts(new, registered intest:slash-commands): title numbering and code-point-safe truncation, and the strict lineage parser.onFork.tests/e2e/chat-fork.spec.ts): the real flow against the fake LM Studio. It forks after a reply, follows the lineage link back, edits a later prompt in a fork, and edits the first prompt into an unsaved draft.npm run type-check, plus eslint on the changed files;test:slash-commands,test:sidebar,test:rich-links,test:tts,test:bots;chat-shell-interactions,draft-agent-chatsandchat-message-queue, each repeated three times: 144 passed.🤖 Generated with Claude Code