fix(web): the citation comment box opens at the quote instead of sliding in from the corner#32141
Problem
The citation comment box slides in from the top-left corner of the window every time it opens, instead of appearing at the quoted text.
Change
#30623 gave this popover keepMounted, so dictation's setup dialog can replace it without losing the draft. A kept-mounted Base UI positioner computes its position only after the first paint, so it paints once at (0, 0). The popover positioner's transition-transform then glides it to the quote. Popovers rendered with keepMounted now skip that transform transition. Other popovers keep the glide when they reposition. The fix lives in the shared PopoverPopup, so any later kept-mounted popover is covered too.
Scope and approval
A small, focused fix for a visible regression from #30623, reported by a maintainer (Julius). It touches only the popover positioner's transition class plus one test case.
Verification
- A new case in
AssistantCitationChip.browser.test.tsxasserts that no transform/top/left transition is running once the popover is positioned. It fails onmainand passes here. vp run check:changedpasses.
The same frame for both: the popover's CSS transitions paused 50ms after it opens (real component, browser test harness). A paused frame shows the motion more reliably than a 150ms recording.
| Before | After |
|---|---|
| Before: 50ms after opening, the comment box is still moving in from the top-left corner and covers the quote | After: 50ms after opening, the comment box is already under the quoted text |
Claude Opus 5.5 in Claude Code.
🤖 Generated with Claude Code
Checks
Added 1 commit
- fix(web): the citation comment box opens at the quote instead of sliding in from the corner0fc0c45
Approvability
Verdict: Approved at 0fc0c45
Macroscope's review found this PR approvable — Kept-mounted comment popovers open at their anchor without sliding in from the window corner. The change is limited to presentation and preserves positioning, focus, and submission behavior.
You can add or adjust custom eligibility rules. Learn more.
@coderabbitai review
Action performed
-
Review finished.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
No actionable comments were generated in the recent review.
Walkthrough
-
The popover positioner applies its transform transition only when
keepMountedis false. A browser test checks that the citation popup positioner has no active transitions ontransform,top, orleft.Changes: Popover positioning
Layer / File(s) Summary Positioner transition behavior
apps/web/src/components/ui/popover.tsx,apps/web/src/components/chat/AssistantCitationChip.browser.test.tsxThe positioner’s transform transition and instant-state override now apply only when keepMountedis false. The browser test checks that the visible citation popup positioner has no active transitions ontransform,top, orleft.Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related issues
pingdotgg/t3code#31810: The issue reports the citation comment box sliding from the top-left after Cite. This PR changes the kept-mounted popover transition for that behavior.
Suggested reviewers:
t3dotgg
Merge Risk: External image Minimal · up to 0fc0c
-
Kept-mounted popovers no longer glide into position. No material merge-blocking risk is established.
Pre-merge checks: Passed 4
-
Check name Status Explanation Title check Passed The title clearly describes the citation comment box fix. Linked Issues check Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request. Description check Passed The description is mostly complete. It includes test results and before-and-after images. The template also requests a recording for motion changes and evidence hosted on GitHub.
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
External image Recent review info
-
External image Run configuration
-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: t3/citation-popover-corner-slide
- File: .coderabbit.config.ts
- Commit: 0fc0c45
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Team
- Run ID:
0b52d7b8-9255-47ce-98d5-179118aece6d
External image Commits
-
Reviewing files that changed from the base of the PR and between 6577c6b6185167c0e502fa01f9e8e8f2dee6ff25 and 0fc0c457067238ce4f59965cca4e265cd4b1dca6.
External image Files selected for processing: 2
-
apps/web/src/components/chat/AssistantCitationChip.browser.test.tsxapps/web/src/components/ui/popover.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
External image Recent review info
-
External image Run configuration
-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: t3/citation-popover-corner-slide
- File: .coderabbit.config.ts
- Commit: 0fc0c45
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Team
- Run ID:
0b52d7b8-9255-47ce-98d5-179118aece6d
External image Commits
-
Reviewing files that changed from the base of the PR and between 6577c6b6185167c0e502fa01f9e8e8f2dee6ff25 and 0fc0c457067238ce4f59965cca4e265cd4b1dca6.
External image Files selected for processing: 2
-
apps/web/src/components/chat/AssistantCitationChip.browser.test.tsxapps/web/src/components/ui/popover.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
-