fix(web): lineage show-more no longer clips the last row or drops focus#31295
Problem
In the thread details card, the Lineage "Previous agents" list has three defects in the same component:
- Rows are 2rem high, and the list was capped at 13.5rem (6.75 rows), so the seventh row renders clipped at 75% height with no way to see its full text without a keyboard scroll.
- When "Show more" made the list overflow, a scrollbar appeared and stole 6px from the rows, shifting every row sideways and misaligning them against the rows above.
- Clicking "Show more" on the final page unmounted the button and dropped keyboard focus to
document.body.
Reproduce: open a thread whose previous agents number more than 6 and click "Show 12 more". Expected behavior is a list that renders whole rows, a stable layout when the scrollbar appears, and focus retained on the list when the button disappears.
Change
apps/web/src/components/chat/ThreadRelationshipsControl.tsx:
- Cap is 14rem (exactly seven 2rem rows) instead of 13.5rem.
- List carries
scrollbar-gutter-stableso the 6px scrollbar reserves space instead of narrowing rows. - The list has
tabIndex={-1}and a ref; when "Show more" empties the hidden rows on the last page, focus moves to the list withpreventScroll: true, on the same condition that unmounts the button. The list also carriesoutline-noneplus a quietfocus-visibleinset ring, matching the TimelineWorkGroupRows pattern.
apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsx:
- one new browser test that builds 7 completed subagents, pages to the final row, and asserts focus lands on the list.
Scope and approval
Small, focused fix of one component and its test. Why it qualifies without a prior issue or approval: it's an obvious bug fix in one spot, no new workflow/API/contract/setting is introduced, and no unrelated cleanup rides along. The two-file diff is the whole change.
The adjacent PR #22385 (scrollbar-gutter shift only, still open and conflicting) is covered by this change; this PR additionally fixes the clipped row and the focus drop, all in the same component. This PR could supersede #22385.
Verification
- Focused test:
vp test run apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsxpasses (11 tests). - The new test fails before the fix (focus drops to
document.bodywhen the button unmounts; verified by temporarily removing the focus hand-off) and passes after. vp run check:changedgreen after rebase onto latest main (format, lint, knip, typecheck, tests beside changes, react compiler).- Manual check in an isolated worktree reading a seeded dev copy of
~/.t3/userdata/statev2.sqlite(the worktree's.t3, never the live DB): a thread with 8 real previous agents shows whole rows at 7, the scrollbar reserves its gutter, and the wheel-scroll works without trapping scroll chaining into the card above.
| Before | After |
|---|---|
Related PRs, issues and discussions
Open, directly relevant
- https://github.com/pingdotgg/t3code/pull/22385
- https://github.com/pingdotgg/t3code/pull/28968
- https://github.com/pingdotgg/t3code/pull/29592
- https://github.com/pingdotgg/t3code/pull/29285
- https://github.com/pingdotgg/t3code/pull/26576
- https://github.com/pingdotgg/t3code/pull/27582
- https://github.com/pingdotgg/t3code/pull/30243
- https://github.com/pingdotgg/t3code/pull/30244
- https://github.com/pingdotgg/t3code/pull/30753
- https://github.com/pingdotgg/t3code/pull/28608
Open issues, same list
- https://github.com/pingdotgg/t3code/issues/26411
- https://github.com/pingdotgg/t3code/issues/29485
- https://github.com/pingdotgg/t3code/issues/26883
- https://github.com/pingdotgg/t3code/issues/27553
- https://github.com/pingdotgg/t3code/issues/26907
- https://github.com/pingdotgg/t3code/issues/23837
- https://github.com/pingdotgg/t3code/issues/27004
- https://github.com/pingdotgg/t3code/issues/26766
- https://github.com/pingdotgg/t3code/issues/24053
- https://github.com/pingdotgg/t3code/issues/30220
Merged recently, useful context
- https://github.com/pingdotgg/t3code/pull/29000
- https://github.com/pingdotgg/t3code/pull/30340
- https://github.com/pingdotgg/t3code/pull/29138
- https://github.com/pingdotgg/t3code/pull/29568
- https://github.com/pingdotgg/t3code/pull/28326
- https://github.com/pingdotgg/t3code/pull/24833
- https://github.com/pingdotgg/t3code/issues/28978
Discussions
- https://github.com/pingdotgg/t3code/discussions/15171
- https://github.com/pingdotgg/t3code/discussions/20940
- https://github.com/pingdotgg/t3code/discussions/21266
- https://github.com/pingdotgg/t3code/discussions/28976
No issue exists for this exact bug. The closest prior work sailed without one (#22385).
Model and harness
Pulse Alpha Free via OpenCode in T3 Code.
Checks
Added 1 commit
- fix(web): lineage show-more no longer clips the last row or drops focuse784bfa
Approvability
Verdict: Approved at e784bfa
Macroscope's review found this PR approvable — The change adjusts related-thread list sizing and preserves focus when the final Show more button disappears. Its effects are limited to presentation and accessibility, with pagination and underlying thread behavior unchanged.
You can add or adjust custom eligibility rules. Learn more.
Important
Review skipped
Review was skipped as selected files did not have any reviewable changes.
External image Run configuration
-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: 633438d
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
b5f73a09-a14f-4035-a86b-298b69c784f4
External image Commits
-
Reviewing files that changed from the base of the PR and between e784bfa74be122d0ffe14956e47c729c27cd90ff and 162c316fa016b64954605a1bec8af8d8f29ca4c0.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
- Trigger review
No actionable comments were generated in the recent review.
Walkthrough
-
The Related threads list now receives focus when showing the final rows removes the “Show more” button. The list’s height cap and scrollbar styling also change. A browser test verifies focus retention.
Changes: Related threads focus
Layer / File(s) Summary Focus handling and validation
apps/web/src/components/chat/ThreadRelationshipsControl.tsx,apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsxThe “Show more” handler focuses the list when the remaining rows fit within one page. The list gains programmatic focus, a focus ring, stable scrollbar-gutter styling, and a 14rem height cap. A browser test checks that focus remains on the list after showing the final rows. Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix
Possibly related PRs
- pingdotgg/t3code#28968: Both changes adjust scrolling behavior for the related-thread list.
- pingdotgg/t3code#30243: Both changes adjust height and scrolling behavior for lists in thread details.
Suggested reviewers:
t3dotgg,shivamhwp,macroscopeapp
Merge Risk: External image Minimal · previous review e784b
-
The change preserves focus when the final “Show more” button disappears, with no verified merge-blocking risk.
Pre-merge checks: Passed 4
-
Check name Status Explanation Title check Passed The title names the fix area (lineage show-more) and two of its defects: the clipped last row and the dropped focus. It matches the changeset, which caps the list at seven 2rem rows, adds scrollbar-gu… 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 follows the repository template. It has Problem, Change, Scope and approval, Verification, and Model and harness sections. The problem is stated with three defects, expected behavior, … Full details: Title check
-
Explanation
The title names the fix area (lineage show-more) and two of its defects: the clipped last row and the dropped focus. It matches the changeset, which caps the list at seven 2rem rows, adds scrollbar-gutter, and moves focus to the list on the final page. It leaves out the scrollbar layout shift, which is a minor omission. The title uses the conventional commit format, is one sentence, and is under 72 characters.
Full details: Description check
-
Explanation
The description follows the repository template. It has Problem, Change, Scope and approval, Verification, and Model and harness sections. The problem is stated with three defects, expected behavior, and reproduction steps. The change lists the cap, scrollbar-gutter, and focus hand-off edits by file. Verification reports a focused test run (11 tests), a fail-before and pass-after check, a green check:changed run, and a manual check. Before/after screenshots are embedded. The Scope section argues the change qualifies as a small, focused fix without a prior issue, and it links related PRs and issues. The template requires a linked triaged issue or maintainer approval, or an explicit justification for a small obvious fix. The author gives that justification, and the no-issue note is explicit. The template is also satisfied for the model and harness line. The main weakness is the scope exemption rests on the author's own judgment that this is an obvious bug fix, and the Problem section is not a single underlying problem, since it bundles three defects. Those points are arguable but do not leave the description largely incomplete.
-
Finishing Touches
-
Generate unit tests (beta)
-
- 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: main
- File: .coderabbit.config.ts
- Commit: 67eebac
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
17720d70-1fa4-49e0-bc67-fed81d947823
External image Commits
-
Reviewing files that changed from the base of the PR and between 67eebaca23f8f7bc46e8817434087fc9c5acf8e3 and e784bfa74be122d0ffe14956e47c729c27cd90ff.
External image Files selected for processing: 2
-
apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsxapps/web/src/components/chat/ThreadRelationshipsControl.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.
External image Recent review info
-
External image Run configuration
-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: 67eebac
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
17720d70-1fa4-49e0-bc67-fed81d947823
External image Commits
-
Reviewing files that changed from the base of the PR and between 67eebaca23f8f7bc46e8817434087fc9c5acf8e3 and e784bfa74be122d0ffe14956e47c729c27cd90ff.
External image Files selected for processing: 2
-
apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsxapps/web/src/components/chat/ThreadRelationshipsControl.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.
-
Added 1 commit
- Merge branch 'main' into fix/lineage-show-more162c316