Skip to content

fix(web): scope PR title collapse to tab scrollers - #14302

Closed
Adamulek123 wants to merge 1 commit into
pingdotgg:mainfrom
Adamulek123:fix/pr-panel-scroll-ownership
Closed

Adamulek123 wants to merge 1 commit into
pingdotgg:mainfrom
Adamulek123:fix/pr-panel-scroll-ownership

Conversation

@Adamulek123

@Adamulek123 Adamulek123 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

What Changed

The PR title now collapses and reopens only when the active tab's main vertical scroller moves. Summary, Timeline, and Code register their own scroller; Code also registers its loading, error, empty, and raw diff views. The scroll adjustment made when the title collapses is tied to the same tab and element that triggered it. A focused panel test covers nested scrolls, tab switches, and that adjustment.

Why

While viewing a PR with a long, unwrapped code block in its description, scrolling the block sideways could reopen a collapsed title even though the Summary tab had not moved vertically. The panel's onScrollCapture treated every descendant scroll target as the tab scroller and later applied its scroll adjustment to whichever descendant had most recently scrolled. The nested "Conversations not on the current diff" list in Code could therefore change the title and receive that adjustment too.

The Code diff's horizontal scroller lives inside the viewer's shadow DOM; its sideways scroll does not reach the panel. The Code tab's main vertical scroller does, so scrolling back to the top can already reopen the title. This change makes that ownership explicit without changing horizontal diff scrolling.

Scope and approval

This is a small, focused fix for an obvious bug: scrolling nested content must not change the PR title when the active tab's main vertical scroller has not moved. It keeps the existing collapse and reopen behavior and qualifies for the focused bug-fix exception in CONTRIBUTING.md. It applies to the shared web panel used by web and desktop; mobile has a separate UI. It changes no provider behavior or wire contracts.

UI Changes

Before:

T3_Code_.Nightly._elxplgRCW0.mp4

After:

brave_Xutwhtk2DP.mp4

After video recorded on head 3d48f423e707d290a9e8a4a6edbed12988b819ea, rebased onto main base a97a4a9d189f145afe79c3a6f8533bbf9a6b40b1, using the isolated web dev server.

Validation

  • vp test run apps/web/src/components/pullRequest/PullRequestDetailPanel.test.tsx apps/web/src/components/pullRequest/PullRequestSummaryTab.test.tsx: 32 tests passed. The new test checks that nested scrolls do not change the title, the active tab's scroller does, and scroll adjustment stays on that scroller.
  • Before/After videos captured in a real vp run dev session against isolated dev state.
  • Targeted lint: completed with warnings in these files, no errors.
  • Targeted format check: passed for all six changed files.
  • Web typecheck: no errors in the six changed files; full apps/web tsc --noEmit still reports pre-existing errors elsewhere (e.g. useBrowserViewportResize.ts, threadSort.test.ts, ProviderSettingsPanel.logic.test.ts).

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

GPT-6-Sol via the Codex harness in T3 Code.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Sep 29, 2026
@Adamulek123
Adamulek123 marked this pull request as ready for review September 29, 2026 19:40
@macroscopeapp

macroscopeapp Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 9a572b5

Macroscope's review found this PR approvable — This focused web bug fix restricts PR-title collapse and scroll compensation to the active tab’s main scroller, preventing nested or inactive content from affecting the panel. The implementation is localized and covered by regression tests, with no product-default, schema, security, or static-analysis changes.

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

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: b315772c-fe8b-4228-b702-380bf8517b70

📥 Commits

Reviewing files that changed from the base of the PR and between 5e83e99 and 9a572b5.

📒 Files selected for processing (6)
  • apps/web/src/components/pullRequest/PullRequestCodeTab.tsx
  • apps/web/src/components/pullRequest/PullRequestDetailPanel.test.tsx
  • apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx
  • apps/web/src/components/pullRequest/PullRequestSummaryTab.test.tsx
  • apps/web/src/components/pullRequest/PullRequestSummaryTab.tsx
  • apps/web/src/components/pullRequest/PullRequestTimelineTab.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.


📝 Walkthrough

Walkthrough

The summary, timeline, and code tabs now expose their scroll containers to the detail panel. The panel tracks scrolling and title-fold compensation against the active tab’s registered scroller.

Changes

Pull request tab scroll tracking

Layer / File(s) Summary
Register tab scrollers
apps/web/src/components/pullRequest/PullRequestCodeTab.tsx, apps/web/src/components/pullRequest/PullRequestSummaryTab.tsx, apps/web/src/components/pullRequest/PullRequestTimelineTab.tsx, apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx, apps/web/src/components/pullRequest/PullRequestSummaryTab.test.tsx
Each tab accepts a scrollerRef callback and attaches it to its scroll container. The detail panel registers a separate scroller for each tab.
Scope title folding and compensation
apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx, apps/web/src/components/pullRequest/PullRequestDetailPanel.test.tsx
The panel handles scroll events only from the active tab’s registered scroller. It applies compensation only when the tab and scroller still match, and clamps the scroll position. Tests cover active and inactive scrollers, nested targets, tab switches, and scroll positions.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested reviewers: bil0000

Merge Risk: ⚪ Minimal · up to 9a572

The change appears ready to merge after normal checks; no concrete issue requiring a fix was identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly and concisely describes the main change: limiting pull request title collapse to the active tab's scroller.
Description check ✅ Passed The description includes the required What Changed, Why, UI Changes, and Checklist sections. It explains the bug, implementation, validation, and UI evidence in sufficient detail.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

Adamulek123 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor Author

gpt-6.1-sol - responding

Leaving the docstring-coverage warning unaddressed. This fix adds scroller callback refs and identity guards to existing components. The nearby comments already explain per-tab chrome state and why scroll compensation runs after the fold commits. Docstrings on the three ref setters would restate their assignments without explaining an additional constraint.

Copy link
Copy Markdown
Member

Note

This comment is posted by Julius' dot

The links labeled Before and After currently serve the same 9.28-second recording, including the title reopening during horizontal scrolling. That leaves the changed interaction unshown. Closing under verification. Replace the After clip with a current-head recording showing sideways scrolling leaving the title unchanged and the main vertical scroller still collapsing and reopening it, then request reconsideration.

@Adamulek123

Copy link
Copy Markdown
Contributor Author

@juliusmarminge The After clip has been replaced and the rebased head pushed. GitHub would not let me reopen this PR, so the replacement is #14644.

The replacement includes the updated recording, labeled with its head 3d48f423e7 and main base a97a4a9d18. Please reconsider with the corrected verification evidence.

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). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants