Skip to content

Offer a column's known values as its filter, add multiple row selection, and give the filter a real icon - #322

Merged
einari merged 3 commits into
mainfrom
fix/datatable-filter-options-and-icon
Sep 24, 2026
Merged

einari merged 3 commits into
mainfrom
fix/datatable-filter-options-and-icon

Conversation

@einari

@einari einari commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Added

  • Column.filterOptions supplies the values a column can be filtered by, rendered as a list instead of a free-form input, with the match modes narrowed to equals/not equals.
  • selectionMode='multiple' on the data tables and DataPage, with a checkbox per row, a select-all header checkbox, and selectedItems/onSelectedItemsChange.
  • dataTable.selectAllRows message for localizing the select-all accessible name.

Fixed

  • The column filter trigger rendered U+2315 TELEPHONE RECORDER in a span at the ambient font size, so it showed as a tiny mark that does not read as a filter. It is now a funnel SVG sized against the header row.

Notes

A column whose values come from a known set — a status, a kind, an enum rendered as text — could previously only be filtered by typing. ColumnFilterMenu picked its value input from dataType alone, and boolean was the only case that listed values. An enum column declared dataType='numeric' therefore asked the user to type the underlying number while the cell showed the word, which is indistinguishable from the filter not working.

Multiple selection is additive rather than a change to the existing single-selection contract: selection/onSelectionChange keep their current types, and the new set is reported through selectedItems/onSelectedItemsChange. Nothing that compiles today changes meaning.

Select-all covers the rows the filter currently leaves visible, not the whole loaded page — a bulk action that silently included rows hidden behind a filter would act on more than it showed.

Consumed by Cratis/Chronicle#4140 and Cratis/Chronicle#4141.

…al icon

A column whose values come from a known set - a status, a kind, an enum rendered
as text - could only be filtered by typing. The menu picked its input from
dataType alone, and 'boolean' was the only case that listed values, so an enum
column declared numeric asked the user to type the underlying number while the
cell showed the word.

Column.filterOptions supplies those values, rendered as a list and narrowed to
equals/not equals, because 'starts with' means nothing over a closed set.

The trigger also rendered U+2315 TELEPHONE RECORDER in a span, sized by the
ambient font - which is why it read as a tiny unrecognizable mark rather than a
filter. It is now a funnel drawn as an SVG and sized against the header row.
@einari einari added the minor label Sep 24, 2026
The parts manifest is the contract for what a component emits, so a new
data-cratis-part has to be declared there; the pinned Storybook index count moves
by the two stories added for the new filter and selection behavior.
@einari
einari merged commit dd3a7c8 into main Sep 24, 2026
49 checks passed
@einari
einari deleted the fix/datatable-filter-options-and-icon branch September 24, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant