Repository navigation
fix(review): give the collapsed-thread bubble its gutter slot back - #202
Merged
nplez1 merged 4 commits intoOct 28, 2026
Merged
Conversation
The add-note "+" overlay and a collapsed PR review thread's bubble both claim the same gutter slot, so the "+" was drawn on top of the bubble and swallowed the click. Hovering a commented line therefore offered "add a note" and hid "there is a conversation here". The thread decorator now reports the lines it draws as bubbles and the note decorator's overlay skips them: one slot, one affordance, and the conversation wins. The Add Review Note chord still reads the editor selection, so a note can still be left on a threaded line from the keyboard — displaced, not dropped. Two fork-owned files split instead of growing past the max-lines budget: the line-set derivation and the overlay's own install effect move into their own modules. Closes #190.
Review round 1 on 68d29feb3e found the fix incomplete and the overlay fragile: - MonacoEditor's markdown annotations mount the same add-note decorator on the editor that carries the thread bubbles, so a markdown file with a collapsed thread still showed the "+" over the bubble. The thread decorator now runs first there and hands its occupied lines down. - Handing the occupied set in as an install dependency rebuilt the overlay whenever any thread anywhere was toggled or PR comments were refetched. That reinstall drops a gutter drag in flight and re-parks the button under a stationary pointer, so the running overlay is told through its handle instead, and the set is value-keyed like the commentable one. - A parked line that stops being ours (its thread collapsed) now hides the "+" instead of drawing it back over the bubble on the next scroll. - The test asserts the bubble decoration is really on the line, and that a thread opening does not rebuild the running button.
…e rest Delta re-check of d0e5714983 left three small gaps and two test holes: - the scroll handler skipped the "+" on a line that stopped being ours instead of hiding it, leaving a button parked at the wrong pixels for the wrong line; it now hides and clears the hovered line. - the occupied-line setter could hide the "+" mid-drag, where that button is the only sign the gesture is live; it stands down there. - the line-sets comment claimed a new set rebuilds the overlay, which the previous commit stopped doing. - the test now also covers a thread collapsing under a parked "+", the markdown editor's forwarding of the occupied lines, and the fake keeps one decoration record per collection so a clear by one collection cannot erase another's.
The base commit 941acb7 lands two `check:flaky-test-pattern-ratchet` findings in its own test files, so the lint gate on any branch cut from it fails on work that branch never touched. Neither file is in this branch's diff, and both are static ast-grep findings rather than a bad run. Recorded with one narrow `match` per file, so a new finding in either still fails the gate, plus the evidence line LOCAL-PATCHES.md requires. The fix belongs to the checks-panel work: fake timers or a fixed timestamp.
nplez1
deleted the
nplez1/bug-the-collapsed-comment-expand-bubble-and-the
branch
October 28, 2026 05:30
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.
What
Fixes #190. In a diff surface, the add-note "+" (a DOM button at
left: 4px, z-index 5, inside Monaco's glyph-margin column) and a collapsed review thread's bubble decoration (glyph margin) wanted the same gutter slot for the same line. The "+" was drawn on top and swallowed the click, so hovering a commented line offered "add a note" and hid "there is a conversation here".Now: one control per line, and the conversation wins.
How
usePRCommentInlineDecoratorreturnsgutterOccupiedLines— the lines it draws as collapsed-thread bubbles. It is derived from the samegutterMarkslist the bubbles are drawn from, so the two cannot drift.useDiffCommentDecoratortakesgutterOccupiedLineNumbers, and the overlay'scanCommentOnLinerefuses those lines (diff-comment-add-button-overlay.ts). A line with a thread shows only the bubble; a line without one shows the "+" exactly as before.DiffViewer.tsx(worktree diff tab),DiffSectionItem.tsx(combined / PR-files diff), andMonacoEditor.tsxthroughuseMonacoMarkdownAnnotations(a markdown file with live review threads). The thread decorator runs first on each so its handle is available.Two notes on the decision, recorded rather than dropped:
c(Add Review Note) reads the editor selection, so a note can still be started on a threaded line from the keyboard, and dragging down the line-number column still starts a range that can include it.docs/site/content/docs/review/annotate-ai-diff.mdxsays so, and the CSS comment inmain.cssrecords why the overlap is safe now.rangeDrag.dispose()ends the drag without committing). So the running overlay is told throughsetGutterOccupiedLines, which also hides a parked "+" whose line just gained a thread, and the scroll handler hides rather than repositions a parked line that stopped being ours.Two fork-owned files were split rather than growing past the 400-line oxlint
max-linesbudget: the commentable/occupied line-set derivation (use-diff-comment-line-sets.ts) and the overlay's own install effect (useDiffCommentAddButtonOverlay).Tests
Changed/added:
usePRCommentInlineDecorator.test.tsx(new): a collapsed thread owns its line (0 visible "+"), the line beside it still offers one, the glyph-margin bubble decoration is really on that line, a thread opening does not rebuild the running button (same DOM node), and collapsing under a parked "+" hides it.use-monaco-markdown-annotations.test.tsx(new): the plain editor's marker path forwards the occupied lines, and the filter is the parameter rather than a blanket suppression.diff-comment-editor-test-fixture.ts: the fake keeps one decoration record per collection (clearing one no longer erases another's) and applies initial decorations, so decoration assertions are faithful.Run locally on
dbe4f2b9f2(clean tree, rebased ontonplez1/main@6587eefcb8):pnpm test src/renderer/src/components/diff-comments src/renderer/src/components/pr-comment-inline src/renderer/src/components/editor— 412 files, 3196 passed, 3 skippedpnpm tc— cleanpnpm run check:code-quality:changed— 0 new findingspnpm run check:max-lines-ratchet— OK, no new bypassorca-queue node local/gate-lint.mjs—PASS — 38 green, 1 failing: 2 known red, 0 new; 100.9 sOne unrelated commit is included. The base commit
941acb70e0(#198) lands twocheck:flaky-test-pattern-ratchetfindings in its own test files, so the lint gate fails on any branch cut from it.dbe4f2b9f2records them inlocal/lint-known-red.jsonwith one narrowmatchper file — a new finding in either file still fails the gate — plus theLOCAL-PATCHES.mdevidence line the file requires. The fix belongs to the checks-panel work (fake timers or a fixed timestamp), not here; pruning wins when it lands.Not run: the full unit suite. This diff touches no global input (
package.json, lockfiles,config/**, root tsconfigs,src/packages/**,src/shared/**), so it is gated by the change-scope tests above; the full suite runs on the nightlyfork-main-tests.ymllane and again at release.Review
Reviewed by Opus 5.5, high: R1 (2 SHOULD-FIX fixed), delta re-check on R2 (both resolved; 3 MINOR + 1 NIT newly noted), those fixed in R3 without a third round.
2e38a213ffcontent): found the markdown-editor surface still colliding, and that passing the occupied set as an install dependency would rebuild the overlay on every thread toggle. Both fixed in R2.0a278d5b67(fix(review): land a Checks-pane comment in the diff that carries its hunks #199) and6587eefcb8(feat(session-summary): lead with the written summary, not the ledger #200): one conflict, inDiffViewer.tsx, resolved by dropping the decorator call fix(review): land a Checks-pane comment in the diff that carries its hunks #199 moved (the branch's copy now sits above the note decorator and keeps the handle); feat(session-summary): lead with the written summary, not the ledger #200 touched no file here. Nothing else in the file differs from the reviewed version. That hunk was not re-reviewed; the suites,tcand the lint gate above run on the rebased revision.Open NIT, listed rather than fixed: moving the thread decorator ahead of the note decorator changes which effect adds view zones first, so a local note and an expanded thread on the same line may order vertically differently on first mount. Harmless; no fixture pins it.