Skip to content

[codex] Upgrade Legend List chat scrolling (#3545)#124

Merged
aaditagrawal merged 2 commits into
mainfrom
sync/upstream-20260626-chat-scroll-list
Jun 26, 2026
Merged

[codex] Upgrade Legend List chat scrolling (#3545)#124
aaditagrawal merged 2 commits into
mainfrom
sync/upstream-20260626-chat-scroll-list

Conversation

@aaditagrawal

@aaditagrawal aaditagrawal commented Jun 26, 2026

Copy link
Copy Markdown
Owner

What Changed

Why

UI Changes

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

Summary by CodeRabbit

  • New Features

    • Chat and thread views now keep replies anchored around newly sent messages, improving scroll positioning after sending.
    • Composer height is now measured more accurately, so message lists and “scroll to bottom” controls stay aligned with the input area.
    • Branch, model, and chat lists now handle keyboard navigation and item types more smoothly.
  • Bug Fixes

    • Improved thread and chat scrolling behavior when switching conversations or sending messages.
    • Updated several app dependencies for stability and compatibility.

Co-authored-by: Julius Marminge <julius@mac.lan>
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@aaditagrawal, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 42 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 398a4506-e2a1-4bd4-a331-2b97bc80c40b

📥 Commits

Reviewing files that changed from the base of the PR and between b89ca56 and 8a89796.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (20)
  • apps/mobile/package.json
  • apps/mobile/src/features/threads/ThreadComposer.tsx
  • apps/mobile/src/features/threads/ThreadDetailScreen.tsx
  • apps/mobile/src/features/threads/ThreadFeed.tsx
  • apps/mobile/src/lib/threadActivity.test.ts
  • apps/mobile/src/lib/threadActivity.ts
  • apps/mobile/src/lib/threadFeedLayout.test.ts
  • apps/mobile/src/lib/threadFeedLayout.ts
  • apps/mobile/src/state/use-thread-composer-state.ts
  • apps/web/package.json
  • apps/web/src/components/BranchToolbarBranchSelector.tsx
  • apps/web/src/components/ChatView.tsx
  • apps/web/src/components/chat/ChatComposer.tsx
  • apps/web/src/components/chat/MessagesTimeline.test.tsx
  • apps/web/src/components/chat/MessagesTimeline.tsx
  • apps/web/src/components/chat/ModelPickerContent.tsx
  • apps/web/src/index.css
  • packages/shared/package.json
  • packages/shared/src/chatList.test.ts
  • packages/shared/src/chatList.ts
📝 Walkthrough

Walkthrough

The PR adds shared chat list anchoring utilities, rewires mobile and web thread flows to return message IDs and anchor timelines around sent messages, updates composer and inset handling, and adjusts branch/model list interactions to the updated LegendList API.

Changes

Chat anchoring and composer flow

Layer / File(s) Summary
Shared anchor resolver
packages/shared/src/chatList.ts, packages/shared/src/chatList.test.ts, packages/shared/package.json
resolveChatListAnchoredEndSpace is added, exported, and covered by tests for matching, override, and null-anchor cases.
Mobile send contract
apps/mobile/src/lib/threadActivity.ts, apps/mobile/src/lib/threadActivity.test.ts, apps/mobile/src/state/use-thread-composer-state.ts, apps/mobile/src/features/threads/ThreadComposer.tsx
Thread activity, composer state, and composer props now return message IDs and stop emitting queued-message rows.
Mobile thread anchoring
apps/mobile/src/features/threads/ThreadDetailScreen.tsx, apps/mobile/src/features/threads/ThreadFeed.tsx, apps/mobile/package.json
Thread detail and feed wiring now measure composer layout, pass anchor/freeze inputs, and switch to the updated keyboard-aware LegendList dependency.
Web chat anchor flow
apps/web/src/components/ChatView.tsx, apps/web/src/components/chat/MessagesTimeline.tsx, apps/web/src/components/chat/MessagesTimeline.test.tsx, apps/web/src/components/chat/ChatComposer.tsx, apps/web/src/index.css, apps/web/package.json
Chat view and timeline now measure the composer overlay, anchor the message list around a sent message, and update the composer surface styles and list dependency.

LegendList picker updates

Layer / File(s) Summary
Picker list behavior
apps/web/src/components/BranchToolbarBranchSelector.tsx, apps/web/src/components/chat/ModelPickerContent.tsx
Branch and model picker lists now classify items and ignore optional scroll-call results.

Sequence Diagram(s)

sequenceDiagram
  participant ChatView
  participant ChatComposer
  participant MessagesTimeline
  participant LegendList
  ChatView->>ChatComposer: render composer overlay
  ChatComposer-->>ChatView: ResizeObserver reports height
  ChatView->>MessagesTimeline: anchorMessageId and contentInsetEndAdjustment
  MessagesTimeline->>LegendList: anchoredEndSpace and adjusted inset
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • aaditagrawal/t3code#9: Introduced the modular chat component structure that these chat anchoring and overlay changes build on.

Suggested labels

size:XXL

Poem

A rabbit hopped through lists at dusk,
with anchor carrots in its tusk.
The composer glowed, the threads aligned,
and scrolls at end were sweetly timed. 🐇
Thump thump — the chats are now refined.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is just the template placeholders, with no actual What Changed, Why, or UI Changes details filled in. Fill in What Changed, Why, and UI Changes with concrete details, and update the checklist to reflect the PR's scope.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: upgrading Legend List chat scrolling.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sync/upstream-20260626-chat-scroll-list

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Jun 26, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/mobile/src/features/threads/ThreadComposer.tsx`:
- Around line 450-452: The handleSend callback in ThreadComposer currently
discards the promise from onSendMessage, which can leave send failures
unhandled. Update handleSend to explicitly handle rejections from onSendMessage,
either by attaching a catch for logging/cleanup or by ensuring the onSendMessage
contract cannot reject. Use the existing handleSend and onSendMessage symbols to
locate the change.

In `@apps/web/src/components/ChatView.tsx`:
- Around line 3731-3740: The new message anchoring is only applied in the main
send flow, so plan follow-up sends still bypass the anchored timeline behavior.
Update the plan follow-up send path in ChatView.tsx, alongside the existing
onSend logic that sets timelineAnchor, so the optimistic message created for
“implement/refine plan” also sets the same anchored target using threadKey and
messageId. Keep the behavior consistent with the main send path so follow-up
sends land in the reserved anchored space instead of using the old bottom-scroll
flow.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0f7fd6b1-f6af-4619-a9e6-5a380ddfbe90

📥 Commits

Reviewing files that changed from the base of the PR and between d7b8d8e and b89ca56.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (20)
  • apps/mobile/package.json
  • apps/mobile/src/features/threads/ThreadComposer.tsx
  • apps/mobile/src/features/threads/ThreadDetailScreen.tsx
  • apps/mobile/src/features/threads/ThreadFeed.tsx
  • apps/mobile/src/lib/threadActivity.test.ts
  • apps/mobile/src/lib/threadActivity.ts
  • apps/mobile/src/lib/threadFeedLayout.test.ts
  • apps/mobile/src/lib/threadFeedLayout.ts
  • apps/mobile/src/state/use-thread-composer-state.ts
  • apps/web/package.json
  • apps/web/src/components/BranchToolbarBranchSelector.tsx
  • apps/web/src/components/ChatView.tsx
  • apps/web/src/components/chat/ChatComposer.tsx
  • apps/web/src/components/chat/MessagesTimeline.test.tsx
  • apps/web/src/components/chat/MessagesTimeline.tsx
  • apps/web/src/components/chat/ModelPickerContent.tsx
  • apps/web/src/index.css
  • packages/shared/package.json
  • packages/shared/src/chatList.test.ts
  • packages/shared/src/chatList.ts
💤 Files with no reviewable changes (2)
  • apps/mobile/src/lib/threadFeedLayout.ts
  • apps/mobile/src/lib/threadFeedLayout.test.ts

Comment thread apps/mobile/src/features/threads/ThreadComposer.tsx
Comment thread apps/web/src/components/ChatView.tsx
@aaditagrawal
aaditagrawal force-pushed the sync/upstream-20260626-chat-scroll-list branch from b89ca56 to 8a89796 Compare June 26, 2026 13:11

aaditagrawal commented Jun 26, 2026

Copy link
Copy Markdown
Owner Author

Merge activity

  • Jun 26, 3:03 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 26, 3:04 PM UTC: @aaditagrawal merged this pull request with Graphite.

@aaditagrawal
aaditagrawal merged commit 70cac9d into main Jun 26, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 effective changed lines (test files excluded in mixed PRs). 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