[fix] Keep the Templates strip header intact at narrow widths - #6325
[fix] Keep the Templates strip header intact at narrow widths#6325ashrafchowdury wants to merge 2 commits into
Conversation
The header was one flex row with no shrink control, so the category tabs overflowed and squeezed the pager: the counter wrapped to two lines and the arrow buttons were compressed out of square. The tabs now take the leftover width and scroll inside it (masked at the overflow edge), and the label, counter, and button cluster hold their size. The arrow and menu buttons move to the shared @agenta/ui small icon button, so they size and disable like every other control instead of hand-rolled chrome.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughSummary by CodeRabbit
Walkthrough
ChangesTemplate strip UI
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized UI change preserves the Templates header layout and interaction behavior, with no actionable merge-blocking risk remaining after normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: fda08e4e-a60a-4da1-8393-380fb0b3065f
📒 Files selected for processing (1)
web/oss/src/components/TemplateStrip/index.tsx
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.
Railway Preview Environment
|
Context
Open the agent playground with the config panel expanded, or just narrow the window, and the Templates strip header fell apart. The header was a single flex row with no shrink control, so the category tabs (All 28, Engineering 10, Support 4, and the rest) overflowed their box and pushed into the pager cluster. The "1–2 of 28" counter wrapped onto two lines and the 32px arrow buttons were squeezed into rectangles.
Changes
The tabs now take the leftover width and scroll inside it instead of overflowing. Each tab keeps its own width (
shrink-0 whitespace-nowrap), and a mask fades the right edge so a clipped tab reads as "there is more" rather than a cut-off word. When nothing overflows, the fade sits over empty space and is invisible.Everything else in the row holds its size: the "Templates" label and the counter/arrows cluster are
shrink-0, and the counter iswhitespace-nowrap.The arrow and options buttons were a hand-rolled 32px square
<button>with their own border, radius, and disabled colors. They are now the sharedButtonfrom@agenta/ui/uiatsize="icon-sm", so they size off thecontrol-smscale and get the standard disabled treatment. The enabled arrows keep their primary border and glyph through aborder-primary text-primaryclass; theatStart/atEndcolour branches are gone because the primitive's owndisabled:styles cover that state. The options button usesvariant="ghost".Note for reviewers: the buttons are 24px now, not 32px, since that is what the design system's small icon button is.
Tests
getBoundingClientRectrather than eyeballing the screenshot.eslintandtsc --noEmitclean for the file.What to QA