mobile: keep paginator within viewport, smarter first-page button#1834
mobile: keep paginator within viewport, smarter first-page button#1834karinakharchenko wants to merge 1 commit into
Conversation
…button - Hide last-page button on mobile — it pushed the paginator past the viewport edge once the "1 – 30 of N" label got long (e.g. N=5000), triggering page-wide horizontal scroll - First-page button now hidden only while disabled (i.e. on page 1); appears once the user paginates past it and disappears again when they navigate back via that button. Selector covers all the disabled-state markers Material uses across versions (attribute, aria, mdc class) - Unify table paginator label "Rows per page:" → "Per page:" to match the audit page Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe PR makes targeted refinements to the paginator component's mobile presentation: shortening the "items per page" label text to save space and adding CSS rules to the mobile media query that hide unnecessary navigation buttons and constrain the range label to prevent wrapping. ChangesMobile Paginator UX Refinement
🎯 2 (Simple) | ⏱️ ~8 minutes
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@frontend/src/styles.scss`:
- Around line 264-268: Update the misleading comment above the CSS rule for
.mat-mdc-paginator .mat-mdc-paginator-range-label: replace "Wrap the long range
label so the paginator stays within the viewport." with a clarification that
matches the rule's behavior, e.g., "Prevent the range label from wrapping and
reduce font size to keep the paginator within the viewport." Leave the CSS
selectors and properties (white-space: nowrap; font-size: 12px;) unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: bc22ac4d-7abf-490f-9d5b-57f9cd3eea46
📒 Files selected for processing (2)
frontend/src/app/components/dashboard/db-table-view/db-table-view.component.tsfrontend/src/styles.scss
| /* Wrap the long range label so the paginator stays within the viewport. */ | ||
| .mat-mdc-paginator .mat-mdc-paginator-range-label { | ||
| white-space: nowrap; | ||
| font-size: 12px; | ||
| } |
There was a problem hiding this comment.
Clarify the comment: "Wrap" is misleading when using white-space: nowrap.
The comment says "Wrap the long range label" but the CSS rule white-space: nowrap prevents wrapping (keeps text on a single line). In CSS context, "wrap" typically refers to text flowing to multiple lines, making this comment confusing.
Consider rewording to: "Prevent the range label from wrapping and reduce font size to keep the paginator within the viewport."
📝 Proposed fix for comment clarity
- /* Wrap the long range label so the paginator stays within the viewport. */
+ /* Prevent the range label from wrapping and reduce font size to keep the paginator within the viewport. */
.mat-mdc-paginator .mat-mdc-paginator-range-label {
white-space: nowrap;
font-size: 12px;
}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@frontend/src/styles.scss` around lines 264 - 268, Update the misleading
comment above the CSS rule for .mat-mdc-paginator
.mat-mdc-paginator-range-label: replace "Wrap the long range label so the
paginator stays within the viewport." with a clarification that matches the
rule's behavior, e.g., "Prevent the range label from wrapping and reduce font
size to keep the paginator within the viewport." Leave the CSS selectors and
properties (white-space: nowrap; font-size: 12px;) unchanged.
Summary
Fix the mobile paginator so it stops pushing the page into horizontal scroll on large tables, and bring back the « first-page button only when it's actually useful.
[disabled],[aria-disabled="true"],.mat-mdc-button-disabled,.mdc-icon-button--disabled)Test plan
[Prev] N–M of K [Next]on page 1; the « (first-page) button is not visible[« First] [Prev] N–M of K [Next]🤖 Generated with Claude Code
Summary by CodeRabbit