Repository navigation
fix(chat): Chat view fixes — select and copy message text, keep the view across project switches - #1247
Merged
eneskirca merged 2 commits intoOct 17, 2026
Conversation
A press on the message list starts a drag-selection, but focus leaves the composer on that press and click-to-focus reclaimed it one tick later (`focusLossOutcome` → 'reclaim'). Focusing the textarea moves the document selection into it, so the drag died: nothing could be highlighted, and Cmd/Ctrl+C had nothing to copy. A press on `.term-chat__msgs` now returns 'reclaim-on-release': the reclaim waits for the pointerup and happens only if nothing was selected (`reclaimOnRelease`), so a plain click still hands the keyboard back to the composer while a selection survives to be copied. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
`mdMode` lived only in React Flow's node data and was in neither the load nor the save seam of `state/workspace.ts`, so switching projects (which reloads the canvas from the saved nodes) or reloading the page brought every open chat view back as the raw terminal. Persist it as `CanvasNodeState.mdMode`, written only while open, so nodes that never opened the view save exactly as before. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
eneskirca
enabled auto-merge
October 17, 2026 23:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two small fixes to the ⌘M chat view, one commit each.
1. Message text could not be selected or copied
What broke
In the ⌘M chat view, dragging over a message highlighted nothing, so Cmd/Ctrl+C had nothing to copy. The CSS was fine —
.term-chat__msgsalready hasuser-select: text.Why
With the composer focused, a press on the message list moves focus out of the composer (the list is not focusable).
useClickToFocusreads that as a press on the node's own chrome —focusLossOutcome→'reclaim'— and focuses the composer again one tick later. Focusing a textarea moves the document selection into it, so the drag-selection that press just started is cancelled.Fix
focusLossOutcomegets apressedInReadableTextinput and a new outcome,'reclaim-on-release', for a press that landed on.term-chat__msgs.pointerupthrough the purereclaimOnRelease:focusLossOutcomecase is unchanged. The header-drag reclaim is still immediate.CLAUDE.mdnow describes this case.2. The ⌘M view closed itself on a project switch
What broke
Open the chat view on a node, switch to another project and come back: the node is on the raw terminal again. A page reload does the same.
Why
mdModelived only in React Flow's node data. It was in neither the load seam nor the save seam ofstate/workspace.ts(nodeStatesToFlow/flowToNodeStates), and a project switch rebuilds the canvas from the saved nodes.Fix
CanvasNodeState.mdMode, next tohideFanout, through both seams.src/corefilters node fields, so no core change is needed.CardModal's view stays modal-local, as its comment intends.CLAUDE.mdnotes that the view is persisted.Tests
terminalFocusMode.test.ts,useClickToFocus.test.tsx): 46 pass, 5 of them new.'reclaim-on-release'and its boundaries, plusreclaimOnRelease.'reclaim'for every press on the node), 3 of the 5 fail, including both DOM selection cases.workspace.md-mode.test.ts, new): an open view survives a save/load round trip, and a closed one is not written. Removing the save line turns it red.npm run typecheckis clean for both web and node.src/renderer/state/,useMdModeFocusand the focus suites give 1103/1104. The one failure isworkspace.node-ids.test.ts› never repeats across a simulated module reload. It is timing-sensitive: it also fails on untouchedmainwhen the machine is loaded, and passes on this branch when run alone.Three surfaces
mdMode.🤖 Generated with Claude Code