Skip to content

Server mode, several filters, states, selection and bulk actions (0.3.0) - #2

Merged
trueqap merged 2 commits into
mainfrom
feature/server-mode
Sep 24, 2026
Merged

trueqap merged 2 commits into
mainfrom
feature/server-mode

Conversation

@trueqap

@trueqap trueqap commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Implements the essentials requested in #1.

What's in

  • Server (controlled) mode — rows, total, totalPages, query, onQueryChange; one query shape shared with client mode. Debounced search (searchDelay, 300 ms default in server mode), page-past-the-end correction, previous rows kept while loading. Out-of-order responses: AbortController pattern documented in the README.
  • Several filters — filters: [ { field, label, options, multiple?, type? } ]; any-of within, all across; chips, or a select above 6 options; array-valued row fields; per-filter "Clear" and "Clear all".
  • States — isLoading (aria-busy, dimmed rows or aria-hidden skeleton), error + errorAction (role="alert"), separate empty / emptyAll labels.
  • Toolbar slot, per-page select, opt-in selection + bulk actions — tri-state header checkbox, row-named checkboxes, "3 selected, 1 on this page", eligibility ("applies to 2 of 3"), destructive styling, focus moved to the selection count after an action. Selection is kept by id across pages and shown, never silent.
  • Smaller things — Intl.Collator sorting (numeric, base sensitivity), column sortValue / searchValue / defaultSortDirection, cached search text, RTL.
  • Accessibility — explicit table roles for the mobile card layout, visible cell labels (no ::before content), chip check icon + ≥ 24 px targets, 3:1 control outlines, forced-colors styles, focusable labelled scroll region, debounced polite result announcements.

Checks

  • 42 tests (logic, query model, jsdom component tests) + axe on a fully featured table: 0 violations.
  • Size budget in CI (npm run size): JS 4.58 KB gz (budget 5 KB), CSS 1.51 KB gz (budget 2 KB).

Not done / trade-offs

  • JS + CSS together are ~6.1 KB gz, so the "full package ≤ 5 KB" target is met for JS only.
  • Opt-in features are statically part of DataTable, so an unused feature still ships (principle 2 is met for behaviour, not for weight).
  • Manual NVDA + Chrome / VoiceOver + Safari passes are still to do — hence 0.3.0, not 1.0.

Breaking

Filters live in the query. See the migration table in the README.

Merging releases 0.3.0 to npm through the Release workflow.

Closes #1

Implements the essentials from #1:
- Server (controlled) mode sharing one query shape with client mode;
  debounced search, page-past-the-end correction, previous rows kept
  while loading
- Several filters (chips or select), array-valued fields, clear controls
- Loading (aria-busy, skeleton), error (role=alert) and separate empty
  states
- Toolbar slot, per-page select, opt-in selection and bulk actions with
  eligibility and focus handling
- Locale-aware sorting, column sortValue/searchValue/defaultSortDirection,
  cached search text
- Accessibility: explicit table roles for the mobile layout, visible cell
  labels, chip check icons and target size, 3:1 control outlines,
  forced-colors styles, focusable scroll region, RTL, debounced result
  announcements
- jsdom component tests + axe check, size budget in CI (JS 4.6 KB gz)

Breaking: filters live in the query (see README migration table).

Closes #1
@trueqap
trueqap merged commit 0492db6 into main Sep 24, 2026
1 check passed
@trueqap
trueqap deleted the feature/server-mode branch September 24, 2026 12:53
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.

Feature request: server mode & admin-list essentials

1 participant