Skip to content

fix(web): typing a citation comment no longer scrolls the page - #36194

Open
AkiVonAkira wants to merge 4 commits into
pingdotgg:mainfrom
AkiVonAkira:citation-comment-sticky-edge
Open

AkiVonAkira wants to merge 4 commits into
pingdotgg:mainfrom
AkiVonAkira:citation-comment-sticky-edge

Conversation

@AkiVonAkira

Copy link
Copy Markdown
Contributor

Problem

Cite text, scroll the timeline so the quote goes out of view, then type a comment: the whole app jumps. The comment box follows the quote off-screen, so the browser scrolls the page to the caret. Reported in #36193.

Change

The comment box now stays inside the visible part of the timeline, which runs from the timeline's top edge to the top of the composer floating over it.

  • The popup's anchor is clamped to that area, so a quote scrolled out of view pins the box to the edge it left by: just above the composer when you scrolled up, at the top of the timeline when you scrolled down. When the quote comes back into view, the box sits next to it again.
  • The same area is passed to Base UI as the collisionBoundary, so the box flips above the composer instead of covering it. The boundary uses getters because Floating UI reads it on every position update.
  • PopoverPopup passes collisionBoundary through to the positioner. When it's unset, Base UI's default applies, so existing callers don't change.

Typing never scrolls the timeline or the page. This differs from #34787, which scrolls the timeline back to the quote on each keystroke. The user scrolled away for a reason, often to reread something while writing the comment, so this PR keeps their scroll position.

Scope

Fixes #36193. One component, plus one pass-through prop on the shared popover. No contract, server, desktop, or mobile changes. The mobile app doesn't have this popover.

Verification

  • A new browser test in AssistantCitationChip.browser.test.tsx opens the box next to a visible quote, then scrolls the quote under a composer and past the top. On main it fails: the box bottom is at 893, below the composer top at 776. With the fix it passes, and typing leaves page and timeline scroll unchanged.
  • vp run check:changed passes (format, lint, knip, typecheck, tests, React Compiler).
  • Tested in the dev web app with Replay threads, real clicks and typing, at 1280×800 and 390×844. After scrolling the quote 2000px below the window, the box stayed at 551–665 with the composer top at 668. Page scroll stayed at 0 while typing.
  • Not checked: Safari, Firefox, or the packaged desktop app.
Before After
before after, scrolled up

Scrolled down past the quote, and at phone width:

after, scrolled down after, phone

Reviewed with sol-loop: 1 round with GPT-6.1 Sol. Sol verdict: approved.

Created with Claude Opus 5.5 in T3 Code. GPT-6.1 Terra searched for existing issues.

@github-actions github-actions Bot added the vouch:unvouched Author is not yet trusted in the VOUCHED list. label Nov 13, 2026
@github-actions github-actions Bot added the size:M 30-99 changed lines (additions + deletions). label Nov 13, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at f576073

Macroscope's review found this PR approvable — Citation-comment popovers now stay within the visible timeline when their source quote scrolls offscreen. The change is limited to positioning, with no changes to comment storage or sending behavior.

You can add or adjust custom eligibility rules. Learn more.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 13, 2026
@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The citation comment popup stays within the visible timeline area above the composer when its source quote scrolls out of view. Browser tests check popup placement and verify that typing does not change document or timeline scroll positions.

Changes: Citation popup positioning

Layer / File(s) Summary
Popover collision boundary
apps/web/src/components/ui/popover.tsx
PopoverPopup accepts an optional collision boundary and passes it to the positioner.
Visible timeline positioning and tests
apps/web/src/components/chat/AssistantCitationChip.tsx, apps/web/src/components/chat/AssistantCitationChip.browser.test.tsx
The citation popup clamps its anchor to the visible timeline area and uses that area as its collision boundary. Browser tests check its position as the quote scrolls and verify that typing does not change document or timeline scroll positions.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related PRs

  • pingdotgg/t3code#34787: Addresses the same citation-comment scrolling issue with a different approach that scrolls the timeline to the quote.

Suggested labels: bugfix

Suggested reviewers: etanhey, juliusmarminge, maria-rcks

Merge Risk: Minimal · up to 06b62

The change keeps the citation comment popup inside the visible timeline, so typing no longer scrolls the page. No concrete merge-blocking risk was established. A minor edge case remains unverified: the popup may sit at an old position after the composer is resized without other updates.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the fix: typing a citation comment no longer scrolls the page. This matches the main change, which keeps the comment box inside the visible timeline and stops typing from moving the pa…
Description check Passed
Linked Issues check Passed The only active directly linked issue is #36193. Its coding requirements are: (1) typing in the citation comment box must not scroll the page or the timeline; (2) while the quote is out of view, the b…
Out of Scope Changes check Passed All changes connect to #36193. AssistantCitationChip.tsx adds the visible-timeline clamping, the collision boundary getters, and the comment-trigger ref used to locate the composer stack. popover.tsx …
Full details: Title check

Explanation

The title names the fix: typing a citation comment no longer scrolls the page. This matches the main change, which keeps the comment box inside the visible timeline and stops typing from moving the page. It uses the conventional commit form and is specific enough for a reviewer scanning history.

Full details: Linked Issues check

Explanation

The only active directly linked issue is #36193. Its coding requirements are: (1) typing in the citation comment box must not scroll the page or the timeline; (2) while the quote is out of view, the box stays inside the visible timeline, just above the composer when the quote is below, and at the timeline top when the quote is above; (3) the box sits beside the quote again when the quote is visible. The whole-PR summary shows AssistantCitationChip.tsx clamping the popup anchor to a visible-timeline area (timeline top to composer top). This covers requirements (2) and (3). The same area is passed to Base UI as collisionBoundary through live getters, so the box flips above the composer instead of covering it. The browser test in AssistantCitationChip.browser.test.tsx checks popup position against the composer and checks that document and timeline scroll positions do not change after typing, which covers requirement (1). The manual checks (Safari, Firefox, packaged desktop app) are non-coding and do not apply. Limit: the test was not executed in this assessment. This result relies on the whole-PR summary and the PR description's reported verification, not on a line-by-line diff read.

Full details: Out of Scope Changes check

Explanation

All changes connect to #36193. AssistantCitationChip.tsx adds the visible-timeline clamping, the collision boundary getters, and the comment-trigger ref used to locate the composer stack. popover.tsx adds an optional collisionBoundary prop that forwards to the positioner. When the prop is unset, the Base UI default applies, so other callers keep their behavior. The test file adds an optional container argument to the mount helper and the new positioning and no-scroll test. The mount helper change supports that test. The summary reports no contract, server, desktop, or mobile changes, and no unrelated change appears. Limit: the whole-PR diff was not read line by line. This result relies on the whole-PR summary.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 918c556 and 06b62c1.

Files selected for processing: 1

  • apps/web/src/components/chat/AssistantCitationChip.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@juliusmarminge juliusmarminge added takeover:needs-julius Takeover done; route gate says Julius decides and removed takeover:in-progress A takeover lead is working on this PR labels Nov 13, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). takeover:needs-julius Takeover done; route gate says Julius decides vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Typing a citation comment after scrolling the quote away scrolls the whole page

2 participants