Skip to content

Commit a3b10c7

Browse files
feat(mobile): keep mat-paginator within viewport, smarter first-page 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>
1 parent 869e97a commit a3b10c7

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

frontend/src/app/components/dashboard/db-table-view/db-table-view.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ export class DbTableViewComponent implements OnInit, OnChanges {
198198
private cdr: ChangeDetectorRef,
199199
private paginatorIntl: MatPaginatorIntl,
200200
) {
201-
this.paginatorIntl.itemsPerPageLabel = 'Rows per page:';
201+
this.paginatorIntl.itemsPerPageLabel = 'Per page:';
202202
this.paginatorIntl.changes.next();
203203
}
204204

frontend/src/styles.scss

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,4 +243,27 @@ body:has(.ai-panel-sidebar-content_open) .add-row-fab {
243243
app-db-table-view .field-copy-button {
244244
display: none !important;
245245
}
246+
247+
/* Last-page button always hidden on mobile — would push the paginator wider
248+
than the viewport (causing page-wide horizontal scroll) once the range
249+
label gets long (e.g. "1 – 30 of 5000"). Prev/Next is enough on mobile. */
250+
.mat-mdc-paginator-navigation-last {
251+
display: none !important;
252+
}
253+
254+
/* First-page button only visible when there is a previous page (i.e., not on
255+
page 1). Material marks it disabled on page 1, which we use as a hook
256+
via multiple attribute/class names depending on Material version. */
257+
.mat-mdc-paginator-navigation-first[disabled],
258+
.mat-mdc-paginator-navigation-first[aria-disabled="true"],
259+
.mat-mdc-paginator-navigation-first.mat-mdc-button-disabled,
260+
.mat-mdc-paginator-navigation-first.mdc-icon-button--disabled {
261+
display: none !important;
262+
}
263+
264+
/* Wrap the long range label so the paginator stays within the viewport. */
265+
.mat-mdc-paginator .mat-mdc-paginator-range-label {
266+
white-space: nowrap;
267+
font-size: 12px;
268+
}
246269
}

0 commit comments

Comments
 (0)