fix(monitor): compact pagination for narrow drift-panel columns - #579
Conversation
The shared Pagination component was designed for full-width tables. In the monitor Devices / Protocols / IP Addresses drift panels it sits in a ~250px column, where its "Previous"/"Next" text labels wrapped under the chevron and "Next" got clipped at the container edge (the "Page Navigation" nav). Add a `compact` prop: icon-only direction buttons, fewer page numbers (limit 3), and a stacked layout so the whole pager fits on one row. Opt the three drift panels into it. Also make direction buttons nowrap and let the number list wrap defensively so no pager can overflow its container. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 6 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 reviews. How do review 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 refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
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 |
NotYuSheng
left a comment
There was a problem hiding this comment.
Self-review
Reviewed the diff for correctness, scope, and regression risk. It's clean and does what it claims. Notes below.
✅ Correctness
directionVariant="icon"is a valid SGDS value ('icon' | 'icon-text' | 'text'inPagination.d.ts), so the compact path is type-safe — confirmed bytsc --noEmitpassing.compactdefaults tofalse, so every existing caller keeps the exact previous render (limit=5,icon-text, horizontal layout). Only the three drift panels opt in.- Functionally verified in the live container: page-number, Next, and Prev clicks all advance/return the page correctly.
🔎 One line with cross-cutting reach — intentional, safe
.pagination-container .pagination { flex-wrap: wrap; } applies to all pagers, not just compact ones. This is deliberate: it's a defensive guard so no pager can spill past its container. For a full-width table that already fits on one row it's a no-op (nothing to wrap); it only activates under overflow, which is strictly better than the current clipping. Called out so a future reader doesn't mistake it for compact-only.
💅 Minor / non-blocking
- Colors in this stylesheet are hardcoded hex (pre-existing pattern); my additions only add
font-size, so no new theming debt. - Could have used a
clsx-style helper for the className, but the existing file has no such helper and the ternary is readable — kept it consistent with the file.
Scope
Purely presentational; no API, DTO, or backend changes, so no OpenAPI baseline regen needed.
Verdict: LGTM. Merging is safe.
Problem
In the monitor IP Addresses (and Devices / Protocols) drift panels, the "Page Navigation" pager was visually broken. The shared
Paginationcomponent was built for full-width tables, but in these panels it sits in a ~250px column, where:Root cause:
directionVariant="icon-text"renders an icon and a text label per direction button, plus 5 page numbers — too much for a narrow column.Fix
Add a
compactprop to the sharedPaginationcomponent and opt the three drift panels into it:limit3 →‹ 1 2 3 … ›)Plus two defensive base rules (
white-space: nowrapon direction buttons,flex-wrapon the number list) so no pager can overflow its container.Full-width table usages (FileList, Conversations, Change Events, etc.) don't pass
compact, so their render path is unchanged.Verification (Playwright, against the live container)
compact=true, clean single row, 104px tall (was 160px, broken)Before → After
‹ 1 2 3 … ›on a single row🤖 Generated with Claude Code