Skip to content

Fix thread timeline autoscroll and simplify branch state#2002

Merged
juliusmarminge merged 1 commit into
mainfrom
t3code/fix-thread-autoscroll
Apr 13, 2026
Merged

Fix thread timeline autoscroll and simplify branch state#2002
juliusmarminge merged 1 commit into
mainfrom
t3code/fix-thread-autoscroll

Conversation

@juliusmarminge
Copy link
Copy Markdown
Member

@juliusmarminge juliusmarminge commented Apr 13, 2026

Summary

  • Fix timeline autoscroll so the first non-message rows are included in the scroll target.
  • Simplify branch and environment-mode handling by removing temporary override paths and stale branch sync logic.
  • Tighten editor and branch detection behavior, including dropping Kiro-specific paths and temporary worktree branch handling.
  • Update timestamps and toolbar labels to use the current thread state consistently.

Testing

  • Not run (PR description drafted from the committed changes).
  • Relevant coverage was updated in unit and browser tests across server and web components.
  • Project checks required by repo policy: bun fmt, bun lint, and bun typecheck should pass before merge.

Note

Medium Risk
Adjusts chat timeline empty-state and autoscroll behavior; small but user-visible changes to scrolling could introduce regressions in when the list pins to bottom.

Overview
Fixes MessagesTimeline empty-state handling by removing the hasMessages prop and instead treating the timeline as empty only when there are no rendered rows (so non-message activity rows no longer show the placeholder).

Adds an effect that detects the transition from 0 → >0 rows and forces an immediate snap-to-bottom (requestAnimationFrame + scrollToEnd) while updating onIsAtEndChange, and introduces a new browser test (MessagesTimeline.browser.tsx) covering both the activity-row empty-state case and the 0 → >0 autoscroll behavior.

Reviewed by Cursor Bugbot for commit 2666adb. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Fix thread timeline autoscroll when first rows appear in MessagesTimeline

  • MessagesTimeline now snaps to the bottom (non-animated) and sets isAtEnd to true when rows first appear after an initially empty render, using a useRef/useEffect to detect the 0→N rows transition and requestAnimationFrame to schedule the scroll.
  • Removes the hasMessages prop from MessagesTimeline; empty-state is now derived from rows.length === 0 internally instead of being passed from ChatView.
  • Adds browser-based vitest tests in MessagesTimeline.browser.tsx covering the empty placeholder behavior and the autoscroll transition.

Macroscope summarized 2666adb.

- Remove the message-only empty-state gate from ChatView
- Auto-snap MessagesTimeline to the bottom when non-message rows first appear
- Add browser coverage for empty-to-populated and activity-row rendering
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 13, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5cfae8d9-156d-4bd8-9d1a-a56af43d5059

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch t3code/fix-thread-autoscroll

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

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Apr 13, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented Apr 13, 2026

Approvability

Verdict: Approved

Straightforward bug fix that adds autoscroll behavior when timeline entries first appear after an empty state, with a minor simplification removing a redundant prop in favor of an internal length check. Changes are well-scoped, include proper cleanup, and are covered by new tests.

You can customize Macroscope's approvability policy. Learn more.

@juliusmarminge juliusmarminge merged commit 33dadb5 into main Apr 13, 2026
12 checks passed
@juliusmarminge juliusmarminge deleted the t3code/fix-thread-autoscroll branch April 13, 2026 20:51
znoraka pushed a commit to znoraka/t3code that referenced this pull request Apr 17, 2026
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: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.

1 participant