Skip to content

fix(web): composer rests on scroll when a thread opens above its end - #14248

Closed
pujitha24 wants to merge 1 commit into
pingdotgg:mainfrom
pujitha24:auto/issue-14232
Closed

pujitha24 wants to merge 1 commit into
pingdotgg:mainfrom
pujitha24:auto/issue-14232

Conversation

@pujitha24

@pujitha24 pujitha24 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

What Changed

timelineContentOverflowsViewport now treats a last row that has an estimated position but no measured size as a 1px lower bound. getRowBottom is unchanged.

Why

When a thread opens above its end, the last row hasn't been measured, so the overflow check reported "fits" and the composer never rested on scroll until the last row rendered at the end. Following the maintainer triage, the fallback applies only inside the overflow check, and a last row whose top is still inside the viewport keeps reporting "fits".

Validation: the new unit test fails before the change and passes after (vp test run --project unit on timelineScrollAnchoring.test.tsx); lint and format are clean. I did not check it in a running client.

Fixes #14232

UI Changes

No visual change beyond the fix. No before/after screenshots or video are included.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes (n/a, no visual change beyond the fix)
  • I included a video for animation/interaction changes (n/a)

Summary by CodeRabbit

  • Bug Fixes
    • Corrected chat timeline overflow detection when the last row’s size has not yet been measured, improving scroll behavior near the viewport edge.

Motivation: With "Collapse composer on scroll" on, a thread that reopens
above its end before its last rows have rendered never rests the composer
on scroll. timelineContentOverflowsViewport needs the last row's size, and
LegendList only knows sizes of rows that were rendered and measured, so the
overflow check reported "fits" until the last row mounted at the end.

Approach: In timelineContentOverflowsViewport only, when the last row has a
finite (estimated) position but no measured size, use position + 1px as a
lower bound. If that is past the visible area the thread overflows; if the
top is still inside the viewport it keeps reporting "fits", so short
threads are unaffected. getRowBottom is unchanged, so anchored-turn
metrics still return null for unmeasured rows.

Validation: `vp test run --project unit
src/components/chat/timelineScrollAnchoring.test.tsx` (via the local
vite-plus binary): the new test fails before the change (1 failed, 9
passed) and passes after (10 passed). Lint and format checks are clean on
the two changed files. I did not run the app in a browser or a full
typecheck.

Impact: Narrow. The composer now rests on the first scroll in this case
instead of after scrolling to the very end. Nothing else changes.

Report: pingdotgg#14232
Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>
Assisted-by: claude-sonnet-5-5 (via Claude Code)
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Sep 29, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at d5dcefb

Macroscope's review found this PR approvable — This is a narrowly scoped bug fix that improves overflow detection only for an unmeasured final timeline row, with existing measured-row and anchored-scroll behavior preserved. Targeted tests cover both the overflow and non-overflow cases, and the PR does not change product defaults or static-analysis configuration.

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: 31675104-e30a-45ee-a051-380f9fa0c371

📥 Commits

Reviewing files that changed from the base of the PR and between d2c9281 and d5dcefb.

📒 Files selected for processing (2)
  • apps/web/src/components/chat/timelineScrollAnchoring.test.tsx
  • apps/web/src/components/chat/timelineScrollAnchoring.ts

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 timeline overflow check now uses the last row’s finite position plus one pixel when its size is unmeasured. Tests cover positions inside and beyond the viewport.

Changes

Timeline overflow detection

Layer / File(s) Summary
Unknown-size last-row overflow
apps/web/src/components/chat/timelineScrollAnchoring.ts, apps/web/src/components/chat/timelineScrollAnchoring.test.tsx
When the last row has a finite position but no measured bottom, the check uses its position plus one pixel. Tests verify that positions beyond the viewport count as overflow and positions within it do not.

Priority: ⬇️ Low

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

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: maria-rcks

Merge Risk: ⚪ Minimal · up to d5dce

The change enables the composer to collapse when an unmeasured final row extends beyond the visible area, while preserving the existing behavior for invalid positions. No material merge risk is evident.

Architecture Summary

Architecture risk: 🔵 Low · up to d5dce

The change affects 1 system.

Changed systems: apps/web

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — apps/web (ui) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in apps/web/src/components/chat/timelineScrollAnchoring.test.tsx: Adds coverage for unmeasured last-row sizes, expecting overflow when the row’s position is past the viewport and no overflow when it is within the viewport.
  • observed — Modified behavior in apps/web/src/components/chat/timelineScrollAnchoring.ts: The function documentation now states that a last row with a position but no measured size counts as overflowing when its estimated top is past the visible area.
  • observed — Modified behavior in apps/web/src/components/chat/timelineScrollAnchoring.ts: The last row’s bottom now falls back to its finite top position plus one pixel when getRowBottom cannot provide a measured bottom. If neither a measured bottom nor a finite top is available, the existing null handling returns false.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the web bug fix: the composer remains resting during scroll when a thread opens above its end.
Description check ✅ Passed The description includes the change, rationale, validation results, linked issue, and checklist. It explains why screenshots and video are not applicable because the fix has no visual change.
Linked Issues check ✅ Passed PR #14248 addresses issue #14232. timelineContentOverflowsViewport now treats a finite last-row position with no valid measured size as at least 1px tall. A row positioned beyond the viewport theref…
Out of Scope Changes check ✅ Passed The changes are limited to overflow detection in apps/web/src/components/chat/timelineScrollAnchoring.ts and its unit test in timelineScrollAnchoring.test.tsx. These changes directly support issue…
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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

Copy link
Copy Markdown
Member

Note

This comment is posted by Julius' dot

The unit regression matches the approved overflow fix, but the PR explicitly says it was not checked in a running client and includes no visual evidence. Please add before/after screenshots and a short recording showing a thread opened above its unmeasured end now rests the composer on scroll, while a short thread still stays expanded. The verification rule requires evidence for this timing-dependent UI behavior. Closing pending that evidence; add it and request reconsideration.

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

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: The composer doesn't rest on scroll when a thread opens above its end, until I scroll to the very end

2 participants