[AGE-3943] fix(frontend): scroll the build-mode sessions tab row (#5249) - #5261
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthrough
ChangesSession strip scrolling
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
web/oss/src/components/AgentChatSlice/components/SessionTagBar.tsx (1)
135-145: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value
onUpdatefiresscrollIntoViewon every animation frame.Each
onUpdatecallback during the spring animation forces a layout reflow viascrollIntoView. Spring animations can run for hundreds of milliseconds at 60fps, producing 30+ calls. Since the element's width is already changing (the animation itself triggers layout), the incremental cost is modest, but if you observe jank on lower-end devices, consider throttling (e.g.,requestAnimationFramecoalescing) or only callingscrollIntoViewwhen the element's right edge exceeds the viewport.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 62ab2915-9680-40c4-8528-c674e9c12d83
📒 Files selected for processing (1)
web/oss/src/components/AgentChatSlice/components/SessionTagBar.tsx
|
@coderabbitai review |
✅ Action performedReview finished.
|
Context
In Playground build mode the horizontal sessions tab row could not be scrolled with the mouse wheel or trackpad, so with many sessions some tabs were unreachable. The row had horizontal overflow but no wheel handling, and a mouse wheel only emits a vertical delta.
Changes
A wheel handler maps the wheel delta to horizontal scroll, normalized for line-mode wheels and applied instantly so it does not fight the strip's smooth-scroll. The strip gets a slight left and right edge fade (the same mask idea as the chat viewport) so tabs dissolve into the edges instead of a hard cut. A newly added session scrolls into view as it animates in, so it is never left off-screen.
Tests / notes
What to QA
Closes #5249.