Skip to content

fix(chat): jump to messages without scrolling animation - #27612

Merged
AmethystLiang merged 2 commits into
mainfrom
jump-chat-ui-without-animation
Oct 12, 2026
Merged

AmethystLiang merged 2 commits into
mainfrom
jump-chat-ui-without-animation

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​26 $\color{#cf222e}{\Huge{\mathbf{−}}}$​71 $\color{#cf222e}{\Huge{\mathbf{−}}}$​45
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​9 $\color{#cf222e}{\Huge{\mathbf{−}}}$​27 $\color{#cf222e}{\Huge{\mathbf{−}}}$​18

ELI5

Clicking an old message in the chat rail now jumps directly to it without a scrolling animation.

What Changed

The transcript alignment hook now uses immediate scrolling for message and diff navigation, including the fallback when the virtualized transcript is unavailable. Existing navigation tests expect immediate scrolling. Removed the reduced-motion-specific test because jumps no longer depend on that preference.

Why

Readers can reach older messages without waiting for the transcript to scroll past intervening content. Changing the existing alignment hook keeps its message positioning and older-history loading behavior instead of adding another navigation path or animation setting.

Linked Issue

No linked issue; requested directly by a maintainer.

Visual Proof

Before/after recording not captured. Reviewer check: open a long chat and click an older prompt in the right-hand message rail; the selected message should appear at the top immediately. Repeat with a prompt whose older history needs to load.

Testing

  • I manually tested these changes locally
  • Automated tests updated

Passed on macOS:

  • Five targeted suites covering rail history jumps, diff navigation, transcript alignment, windowing, and content growth.
  • Re-ran the rail history jump suite after removing the reduced-motion test: 12 tests passed.
  • pnpm tc:web
  • pnpm run check:code-quality:changed

Rendered Electron, Linux, Windows, and SSH checks were not run locally. Full lint, typecheck, test, and build remain for CI.

Review

Self-reviewed the virtualized and fallback alignment paths and the updated assertions.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Renderer-only scrolling change; no platform-specific paths, keyboard shortcuts, workspace assumptions, or remote protocol changes.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

📝 Walkthrough

Walkthrough

Native chat viewport alignment now uses automatic scrolling for index-based, offset-based, and direct container alignment. The alignment hook no longer reads reduced-motion preference. Tests now expect automatic scrolling for message selection and diff reveal, verify that diff reveal does not use smooth scrolling, and require automatic behavior for transcript-window alignment. A reduced-motion rail-jump test was removed, and a nearby comment now describes end-follow detachment and landing retention as older history arrives.


Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to 01714

Native chat jumps request automatic scrolling, but no remaining test verifies that a rail jump lands immediately. Retaining a one-frame landing assertion would reduce the chance of an animation regression going unnoticed.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: chat message jumps now occur without scrolling animation.
Description check Passed The description explains the user-facing change, implementation, rationale, testing, and scope. It does not provide a linked issue or the required before-and-after visual proof, but the remaining cont…
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.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/renderer/src/components/native-chat/NativeChatMessageList.rail-history-jump.test.tsx (1)

147-153: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Retain a one-frame landing assertion for rail jumps.

The remaining tests assert that callers request behavior: 'auto' or eventually reach the bottom. They do not assert the row's rendered position after one frame. A regression could accept 'auto' while still animating the rendered scroll, and these tests would pass. Keep or restore a rail-jump test that advances one frame and checks the row's landing position.


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 54af91c4-d4ba-46bd-8554-66449d1e9023
📥 Commits

Reviewing files that changed from the base of the PR and between c9730df and 0171436.

📒 Files selected for processing (4)
  • src/renderer/src/components/native-chat/NativeChatMessageList.rail-history-jump.test.tsx
  • src/renderer/src/components/native-chat/NativeChatMessageList.subagent-sections.test.tsx
  • src/renderer/src/components/native-chat/use-native-chat-transcript-window.options.test.tsx
  • src/renderer/src/components/native-chat/use-native-chat-viewport-align.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.

@AmethystLiang

Copy link
Copy Markdown
Contributor Author

@coderabbitai Fixing. Will be in the next commit

@coderabbitai

coderabbitai Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@AmethystLiang Thanks for the update. The finding remains open until the fix is complete.

You are interacting with an AI system.

Smooth scrolling let rows measured mid-animation shift the target, so jumps could land short or cancel near the end of the transcript. Jumps now write the scroll offset directly, and the align hook keeps its target until the row settles. Tests assert no smooth scroll is requested and that a loaded target lands within one frame.
@AmethystLiang
AmethystLiang merged commit af33858 into main Oct 12, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant