Reset-state addon

Give users a way back

A support queue lets users sort and filter aggressively, then recover the full table with one clear reset action.

Scenario

Filtered support queues need recovery

The user goal is to try different views without getting stuck in an empty result or forgotten sort order.

reset-state hash-state filter-state

Try it

Make a messy view, then reset it

Example

Support incident queue

Choose filters to narrow the queue.

Reset status will appear here.

No incidents match the selected filters.

Scroll horizontally to view all columns.

Support incidents
INC-204 1 - Critical 42 min Frontend Open
INC-203 2 - High 118 min Platform Blocked
INC-202 3 - Medium 12 min Billing Resolved
INC-201 2 - High 75 min Frontend Blocked

Accessibility notes

Recovery is explicit

  • The reset action is a real button.
  • Filter controls use visible labels and native selects.
  • Result and reset messages use polite live regions.
  • Rows are restored from the hidden state.
  • The helper dispatches a11y-sortable-table:reset for other addons.

Developer notes

Copy points

  • Use createSortableTableReset after table initialization.
  • Pass a trigger button or call resetController.reset().
  • Keep filter hash prefixes consistent with filter-state.
  • Use a status element so reset recovery is announced.

Import path

Reset helper setup

import { createSortableTable } from "../../dist/index.js";
import { createSortableTableReset } from "../../dist/reset-state.js";

const instance = createSortableTable(table, { allowUnsort: true });

createSortableTableReset(instance, {
  table,
  trigger: "#reset-queue",
  statusElement: "#reset-status",
  filterPrefix: "filter-",
  sortParamName: "sort"
});