Repository navigation
fix(chat): remove the reply Quote in message that shook the chat - #1922
Conversation
Selecting text in an agent's chat reply drew a Quote in message row over the message box (#1845). The row joined the composer stack, so the chat's scroller shrank by 44 px at 1440 and 84 px at 390, and on a phone the selected reply jumped by 52 px while the virtual list pinned its rows. Remove the whole chat-reply feature: the .composer-quote-row and .chat-quote styles, the reply selection tracking and the .chat-reply wrapper in ChatView, ChatTimeline's holdSelection row pinning, formatReplyQuote and ComposerDraftStore.appendQuote with the tests only they needed, scripts/reply-quote-demo-regression.ts and its browser-lane line, the DESIGN.md entry and the unreleased Added fragment. The terminal lens's own Quote in message (#951) keeps its path, which #1845 left alone apart from sharing the fence helper, now inline again; its strings stay translated.
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Remove reply selection tracking src/components/ChatView.tsx, src/components/ChatTimeline.tsx, src/components/ChatView.css, scripts/pane-paging-demo-regression.ts |
Assistant Markdown renders without the .chat-reply wrapper. The reply-selection callbacks and selection-hold behavior are removed. Paging selectors now target .chat-turn-agent > .markdown. |
Remove reply quote action and helpers src/components/PaneTerminal.tsx, src/components/PaneTerminal.css, src/lib/terminalQuote.ts, src/lib/terminalQuote.test.ts, src/lib/composerDraft.ts, src/lib/composerDraft.test.ts |
The pane no longer offers the reply quote action or appends reply text to the draft. Reply-quote formatting and related tests are removed. Terminal quote formatting and appending remain. |
Update regression and feature records scripts/ci-browser.sh, scripts/reply-quote-demo-regression.ts, DESIGN.md, changelog.d/reply-selection-quote.md |
The browser CI lane no longer runs the reply-quote regression script, and the script is deleted. The reply-quote design specification and changelog entry are removed. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Possibly related PRs
- devswha/ovis#1845: This PR adds the reply-selection quote feature that the current PR removes.
Suggested reviewers: kratam
Merge Risk: 
Minimal · up to e0e2d
-
The removed reply-quote feature has no identified merge-blocking impact on the retained chat and terminal workflows. The change is ready for normal checks.
Pre-merge checks: 
5
-
Full details: Description check
-
Explanation
The description includes the required Change and Validation sections. It explains the problem, lists the affected behavior and components, documents the terminal feature that remains, and reports relevant checks and results.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 6 files. (1 skipped: 1 unsupported.)
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
|
Merge pass review-work report. Overall: PASSED. This change is part of 0.4.15 and removes a feature that was never released. It was gated by the lane's Codex Sol APPROVE, an omo code reviewer, and the merge pass's own checks.
How the revert was checked:
Later work is kept: the changes from #1902, #1850, #1853, #1871 and #1846 all survive the revert. Nothing is left over:
Tests: 26 unit tests and 19 ci-browser/changelog tests pass, the typecheck passes, and Changelog: #1845 is in no release tag, so per the #1572 precedent the unreleased Added fragment is deleted and no
|
… the next message (#511) Selecting text inside one agent reply offers a floating Comment action drawn over the chat, so a selection in progress moves nothing (the #1845 row shook the chat, #1922). A small form saves the comment; saved comments wait per pane on this device as one chip over the input card. The next message carries them first, in the order written, each as `> quote` lines and the comment, then the typed text. A slash command or an answer to the agent's question leaves them waiting. A message with comments goes to an agent alone: submit takes an optional `agent_only` (feature "agent-only"). The bridge refuses it with agent_not_ready, typing nothing, where no agent is in front; a queued or held one keeps it, and a saved copy's resend says so again. A client never sends it to an older bridge, which would ignore the flag. The demo transport answers the same way.
… the next message (#511) Selecting text inside one agent reply offers a floating Comment action drawn over the chat, so a selection in progress moves nothing (the #1845 row shook the chat, #1922). A small form saves the comment; saved comments wait per pane on this device as one chip over the input card. The next message carries them first, in the order written, each as `> quote` lines and the comment, then the typed text. A slash command or an answer to the agent's question leaves them waiting. A message with comments goes to an agent alone: submit takes an optional `agent_only` (feature "agent-only"). The bridge refuses it with agent_not_ready, typing nothing, where no agent is in front; a queued or held one keeps it, and a saved copy's resend says so again. A client never sends it to an older bridge, which would ignore the flag. The demo transport answers the same way.
… the next message (#511) (#2350) Closes #511 ## What it does for the user Reviewing a plan or a spec point by point in Chat no longer means copying each passage and quoting it by hand. - Selecting text inside one of the agent's replies offers **Comment**, a small pill drawn over the chat. It takes no room, so the chat does not move while the selection is made (the composer row of #1845 did, which is why #1922 removed it). With a mouse it stands where the button was released; on a touch screen it stands under the selection, clear of the handles and the system's own menu. - Comment opens a small form (the quote, a field, Cancel and Save; Mod+Enter saves, Escape closes it while empty). On a phone it docks over the message box. - Saved comments wait per pane on this device as **one chip** over the input card: "2 comments on the reply". A tap lists them, each with its own X; the chip's X removes them all. Nothing is added to Settings and nothing is drawn inside the reply. - The next message sends them first, in the order written, each as `> quote` lines and then the comment, a blank line between them, and then what was typed. A message may be comments alone: ```text > backfill it from updated_at Backfill in batches of 1,000, the table has 40 million rows. > replay the local edit on top of it If both sides changed the same field, ask instead of replaying. Go ahead with step 1. ``` - A slash command, a `!` shell line or an answer to the agent's question goes without them; the chip turns dashed and says "2 comments waiting". ## Comments only ever go to an agent A shell would run `> quote` as a redirect and truncate that file. A message carrying comments is sent with a new optional `agent_only: true` on `submit` (feature `agent-only` in the snapshot): - The bridge refuses it with `agent_not_ready`, typing nothing, when no agent is in front of the pane: at once, when queued or held, and when `agent.prompt` answers `agent_not_found`/`agent_not_ready` mid-send (it is never typed raw instead). - A queued or held message keeps the rule (`PendingMessage.agent_only`); a saved copy's resend keeps it from the bridge's own record even when the copy lost it. - Edit on such a queued message puts its text back as an agent-only draft, sent with `agent_only` until the box is emptied. - The browser never sends it to an older bridge, which would ignore the flag (`agent_only_unsupported`, counted as nothing typed). - The demo transport answers the same way. This changes an HTTP/WS contract and the input path, so it waits for a real review. ## Design precedent The gesture follows ChatGPT's selection action (a floating button over selected answer text that quotes it into the input). Collecting several remarks and sending them in one turn follows a code review's pending comments, as #511 proposes, so the agent is interrupted once rather than once per remark. It differs from both in collecting several quotes in one compact chip. The DESIGN.md entry names this. ## How it was verified - `server/submit.contract.test.ts` (real herdr test session): five new cases. A message only an agent may take is refused in a shell pane and typed nothing; it reaches an agent pane as any other; queued and held into a shell are refused; `agent.prompt` answering `agent_not_found` refuses instead of typing raw; `agent_only` other than `true`, or on a terminal line, is `invalid_delivery`. The shell and agent-left cases fail on the code before the fix (the message was typed, `ok: true`) and pass after it. The whole file: 98 pass, 0 fail. - Unit: `src/lib/replyComments.test.ts` (message format, quote lines, what waits, the store), `src/lib/composerDraftAgentOnly.test.ts` (the Edit mark, its move with the draft), `server/pending-input.test.ts` (the record's flag). - New `scripts/reply-comments-demo-regression.ts`, enrolled in the browser lane, on the unmodified app over the demo transport, at 1280 with a mouse and 390 on a touch screen, dark and light, Codex palette. It checks that a selection reaching a user message offers nothing; that the chat scroller's height, `scrollTop` and the composer's place do not change while a selection is made and offered; that Comment stands clear below the selection; and the chip counts. A `/compact` goes alone with no `agent_only`, and the comments wait. The next message sends exactly the quoted comments then the typed text, with `agent_only: true`, and the chip and storage clear. - `bun run check fast` passes on the head, rebased on the 0.4.20 release commit (8601 unit tests). - Screenshots (1280 and 390, dark and light, Codex palette) were looked at for each state. ## Reviews - omo-native-code-reviewer and Codex Sol 6.1 Fast xhigh, adversarial and read-only. Round 1 blocked on two HIGHs, both fixed with tests that failed before: (1) Edit on a queued comment message restored it as an ordinary draft; (2) `agent.prompt` answering `agent_not_found` fell through to raw typing. Also fixed: the bridge trusting the saved copy's flag on resend, `agent_only_unsupported` read as maybe-typed, and the refusal note's Clear it and send / Send anyway disabled for a comments-only message. - Round 2: omo PASS (all five fixed, no new CRITICAL/HIGH/MEDIUM). Codex found three more, fixed with tests that fail before: (HIGH) storage refusing the Edit's agent-only mark left an ordinary draft, now held in the page too; (MEDIUM) a Chat timeline chunk arriving after the action mounted left Comment dead, it now listens on the document; (MEDIUM) moving a pane to another workspace lost its waiting comments, now carried with the draft. - Round 3 (Codex, new code only): the three confirmed fixed; one MEDIUM, a pane moved while a message with comments was on its way sent them twice, fixed (they stay with that send, as its draft does) with a test that fails before. That last 7-line fix was not reviewed again; `bun run check fast` passes on it. ## Known limits (LOW) - Text put back from Recover unsent text carries no agent-only mark (the user picks that visible text themselves). - The agent-only mark Edit sets clears only when the box is emptied; overwritten text keeps it, which fails safe (refused where no agent runs). - A triple-click that ends in the reply's copy row offers no Comment; the Comment pill is not reachable from the keyboard. - Comments of a pane whose herdr was replaced are dropped with its state rather than offered in recovery. - A message starting with `!` leaves the comments waiting (meant for Claude's bash mode); the chip says so. - A pane moved while its message with comments is on its way leaves any comment written meanwhile under the old ID. - A native Windows pane refuses a message with comments ("no agent is running", the draft and comments stay): herdr names only the pane's shell there, and Windows has no foreground process group, so Ovis cannot tell which program takes the pane's input. - A message for an agent alone whose Enter was refused after its paste stays uncertain with the note "the message is in the terminal's input line"; the pane's later queued messages wait behind it until the user copies or discards it. - The file-viewer comments from the issue's follow-up are not part of this PR. Requested by @aNNdii.
… (#2658) Fixes #2650 ## Change A reader who drags to select words in a chat reply while the agent's turn ends saw the words move under the mouse, and the selection ended on other words. #1922 meant a selection in progress never to move what is under it. On main (59e51d0, the demo build, a 60-step drag in the newest reply while the demo's opening turn ends): | shape | reply's position during the selection | scrollTop | selected | | --- | --- | --- | --- | | 1280, mouse | +34 px | +27 | `"\nAdd a revision column to notes and "` instead of `backfill it from updated_at` | | 390, touch selection | +44 px | +67 | the right words, then moved away from the finger | A drag made after the turn has ended moves nothing (0 px), so the drag start grows nothing. The movement is the turn ending under the selection: the Working line leaves (the transcript shrinks by 34 to 44 px), an earlier reply gets its last words, and the chat, following its end, moves with it. Holding the follows back is not enough, because the browser itself pulls the view up when a transcript at its end gets shorter (scrollTop is clamped). With the follows held and nothing else changed, the reply moved 95 px. `ChatTimeline` now holds a selection in progress, for a reader following the end: - **What holds.** A left-mouse press in the transcript (a drag selection starts with the press, before any selection exists), or a selection standing in its rows (a phone's long press and its handles leave one). It holds the words themselves, not their row: a point at the press (`caretRangeFromPoint`, or `caretPositionFromPoint` in Firefox) or at the selection's start. A work block folding above the words inside the same row moves them while the row's top stays put. The held words stay held while the selection still takes them in, even when a drag is carried up into the rows above them. A selection in the footer (a sent message waiting) is held too. - **Nothing follows under it.** The measured-row follow, the grown-footer follow and ChatView's end follows (new state, a resized view, faces arriving, a short landing) all wait. - **The layout's moves are scrolled back before they are painted**, in the layout effect after each commit, after the list's measurements, and in resize observers. Room is kept past the end (an inline `min-height`), so the browser cannot clamp the view up. The list's own inline `min-height` is given back when the hold ends. - **A scroll of the view itself stands**: the reader's wheel, keys or scrollbar, a drag carried past the chat's edge, Jump to latest, a scripted scroll. Between two looks, `moved + scrolled` is how far the words moved within the transcript; only that, the layout's part, is put back. The exceptions are the browser's clamp on a shorter transcript and LegendList's one-frame padded adjust (`listEndPadded`): their scroll is the layout's own, and the words' whole move is put back. A reader away from the end is left to the list, which already holds the rows they read (`maintainVisibleContentPosition`). - **Let go** (the button is released, even outside the window, or the selection goes), the room goes, and a reader still following is put at the end. A selection left standing after the release (the Quote / Comment offer is on it) keeps the hold until it goes: the words the offer quotes stay where they are. This follows the Claude and ChatGPT apps, where selecting in a streaming answer stops the view from following the end and nothing jumps under the selection. ## Validation - `scripts/chat-selection-turn-end-demo-regression.ts` (new, in the browser lane). It has five cases: a bare press and a partway drag at 1280, and a standing touch selection at 390, all in a later reply; plus `desktop-1280-fold` and `phone-390-fold`, with words the ending turn wrote below its work block, which folds in the same row. It reads the words' own position in every painted frame: in each animation frame, and again in a ResizeObserver made after the app's, so a fold step the app corrects before the paint is read as painted. It allows under 1 px, since the view scrolls in whole pixels. On this PR's first head (83a9a39, row anchor) `desktop-1280-fold` fails (572.8 → 460.8 px); on main the first case fails (444.8 → 478.8 px). It holds the demo transport's turn-end timer until the selection has started, then ends the turn. It watches the reply's top in every frame: a bare mouse press and a drag partway at 1280, and a standing touch selection at 390. The reply must not move, the drag must take exactly its words, and the chat must be back at its end, with the list's own `min-height`, once the selection goes. On main it fails (405 → 439 px). With this fix it passes 3/3, and with the press hold taken out its press case fails, so it guards both holds. - The probe measurements in the table above, after the fix: 0 px at 1280 (mouse) and 390 (touch), the right words selected, and back at the end (gap 0) once the selection is cleared. - Adjacent browser checks on the final code: `chat-virtual-browser-qa.ts`, `chat-select-quote-demo-regression.ts`, `reply-comments-demo-regression.ts`, `chat-local-send-follow-demo-regression.ts`, `chat-quote-selection-end-regression.ts`, `chat-history-browser-qa.ts`, `chat-no-rewind-demo-regression.ts`, `chat-working-line-demo-regression.ts` all pass. `chat-virtual-browser-qa.ts` caught two earlier versions of this change, and both are fixed. In one, a scroll the chat did not make was undone under a standing selection. In the other, the hold moved a reader away from the end a second time, on top of the list's own hold. - `bun run check fast` (through `dori heavy`): workflow syntax, generated types and themes, typecheck, build and unit tests all ok. - CodeRabbit's two threads: the MAJOR (a fold inside the row) is fixed with the words anchor; the MINOR (a footer selection) is held. Codex (gpt-6.1-terra, xhigh) re-reviewed that delta three times. Its findings are fixed: input-timed reader detection replaced by the geometry rule, a lost anchor re-made, sub-pixel moves kept until they add up, and the Firefox caret API. Declined as notes: a reader step landing in the same frame as the list's padded adjust or a clamp (geometry can't tell them apart, and the cost is one frame), and more test paths. While fixing, `chat-virtual-browser-qa.ts` caught input-timed detection undoing a scripted scroll, and the new phone fold case caught LegendList's adjust frame being taken for a view scroll. Both are fixed. - Reviewed by Codex (gpt-6.1-terra, xhigh) before that, three rounds. Round 1 found 4 MAJOR and 1 MINOR: a press released outside the window stuck, the anchor was not re-picked for a new drag, an unheard reader scroll could be undone, a correction was read as the reader leaving the end, and the test could not catch a lost press hold. All five are fixed. Round 2 found an upward selection re-anchoring on release, now fixed. It also noted that a browser clamp cannot be told apart from an unheard Jump to latest in the same frame. That one is declined: the reader stays following and goes to the end once the selection goes. Round 3: **APPROVE**, with one MINOR asking for more test cases. It is declined, because the demo cannot make an upward cross-row case fail, and the away reader is covered by `chat-virtual-browser-qa.ts`'s sliding-page step. - Not run: `bun run check full`, and the Mac and Windows lanes. No server, shared or install code changed.
Change
Selecting text in one of the agent's chat replies drew a Quote in message row over the message box (#1845). That row joined the composer stack, so the chat moved under the reader's selection. The maintainer asked for the feature to be removed. Measured on the demo, on main at a1e4f8b:
This PR removes the whole chat-reply feature:
.composer-quote-row/.chat-quote(PaneTerminal.css) and the row, its press hold and its pointerup listener (PaneTerminal.tsx).chat-replywrapper in ChatView. The page-key line step goes back to.chat-turn-agent > .markdown, in ChatView and inpane-paging-demo-regression.ts.holdSelectionrow pinningformatReplyQuote,REPLY_QUOTE_LABELandComposerDraftStore.appendQuote, with the tests only they neededscripts/reply-quote-demo-regression.tsand its browser-lane line, the DESIGN.md entry, and the Added fragmentThe terminal lens keeps its own Quote in message (#951) as it was before #1845. #1845 changed only one thing on that path: it moved the fence into a shared
fenceForhelper, which is now back inline informatTerminalQuote. The terminal still uses its three strings (Quote in message, Added to the message draft, Too long for the message draft), so they stay translated. Files that no later commit touched are restored to their pre-#1845 state; ChatView, PaneTerminal, DESIGN.md and ci-browser.sh were edited by hand, so later work in them is kept.No new design. Chat selection goes back to the plain browser selection and copy that DESIGN.md already describes (the Claude/ChatGPT distinction between selecting text and copying an answer).
Changelog: users never got #1845 (
git tag --contains 314200a54is empty). As in #1572, its unreleased Added fragment is deleted and no Removed entry is added.Validation
bun run check fast(throughdori heavy): workflow syntax, generated types and themes, typecheck, build, and unit tests (6714 pass) all ok.checkTerminalCopyOff(terminal-copy-off-regression.ts, which drags in the terminal and waits for its Quote in message button) passes on an isolated test herdr.terminalQuote.test.tspasses.pane-paging-demo-regression.ts,chat-selection-copy-regression.tsandchat-virtual-browser-qa.tspass.scripts/ci-browser.test.tspasses.