Skip to content

feat(list view): make the CRUD list page size configurable - #40

Merged
legal-s merged 2 commits into
5.0-mgdisfrom
feat/PLAID-153375-configurable-list-view-page-size
Oct 21, 2026
Merged

legal-s merged 2 commits into
5.0-mgdisfrom
feat/PLAID-153375-configurable-list-view-page-size

Conversation

@legal-s

@legal-s legal-s commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

SUMMARY

The page size of the CRUD list views was hardcoded as const PAGE_SIZE = 25; in every list page — 13 independent declarations, no way to change it without editing each file.

This introduces a LIST_VIEW_PAGE_SIZE config key, exposed to the frontend through FRONTEND_CONF_KEYS, and a single shared PAGE_SIZE constant in src/views/CRUD/constants.ts that every list page now imports.

The key is named LIST_VIEW_PAGE_SIZE rather than PAGE_SIZE because superset/config.py feeds the flat app.config namespace shared with Flask and Flask-AppBuilder, where every neighbouring key is domain-scoped (SAMPLES_ROW_LIMIT, FILTER_SELECT_ROW_LIMIT, FAB_API_MAX_PAGE_SIZE).

The default stays at 25, so behaviour is unchanged on merge. Deployments set their own value in superset_config.py or through the Helm configOverrides.

Out of scope on purpose:

  • features/datasets/constants.ts keeps its own PAGE_SIZE, since ChangeDatasourceModal imports it for a TableView and an API payload.
  • views/CRUD/utils.tsx keeps PAGE_SIZE = 5 for the welcome page cards.
  • components/Select/constants.ts keeps DEFAULT_PAGE_SIZE = 100 for the async dropdown infinite scroll.

PLAID-153375

TESTING INSTRUCTIONS

Automated:

  • npx jest src/views/CRUD/constants.test.ts — covers both branches, missing key falls back to 25, LIST_VIEW_PAGE_SIZE: 10 is honoured.
  • The 19 existing snapshots asserting page_size:25 on the list pages stay green without edits: the Jest setup leaves data-bootstrap empty, so conf is {} and the fallback applies. 132 tests pass across the 13 list pages plus ChangeDatasourceModal.
  • tsc --noEmit clean.

Manual:

  1. Set LIST_VIEW_PAGE_SIZE = 10 in superset_config.py, restart the server.
  2. Open /chart/list/ — 10 rows, footer reads 1-10 of N, page count recomputed on N/10.
  3. Network tab — the request goes out as /api/v1/chart/?q=(...,page_size:10) and the returned count is still the total.
  4. Browse to page 2 then page 3 — correct offsets, no duplicate or missing row.
  5. Check a second list, for instance /dashboard/list/.
  6. Open /chart/list/?pageIndex=7 (a bookmark from the 25-per-page era) — the view falls back to page 0 instead of rendering empty.
  7. Remove the key, restart — back to 25 rows.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@legal-s
legal-s requested review from hamon-a and lefort-a October 14, 2026 08:25
Comment thread superset-frontend/src/views/CRUD/constants.ts
@legal-s
legal-s merged commit 558541a into 5.0-mgdis Oct 21, 2026
51 of 52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants