Skip to content

Filter the columns worth filtering, and clear them from the toolbar - #30

Merged
Harted merged 1 commit into
mainfrom
feat/register-grid-filters
Aug 27, 2026
Merged

Filter the columns worth filtering, and clear them from the toolbar#30
Harted merged 1 commit into
mainfrom
feat/register-grid-filters

Conversation

@Harted

@Harted Harted commented Aug 27, 2026

Copy link
Copy Markdown
Member

No column in the register grid declared filterable, so every one of them offered a filter because MUI defaults to one, not because anyone chose it:

$ git grep -n 'filterable\|sortable\|disableColumnMenu' spike/mui-latest -- 'src/renderer/src/components/client/ClientGrids/RegisterGrid/columns'
spike/mui-latest:src/renderer/src/components/client/ClientGrids/RegisterGrid/columns/groupIndex.tsx:7:  disableColumnMenu: true,

The rule applied here is not whether filtering works but whether the question it answers gets asked. Addr. and Bit lose theirs, since finding an address is what the scan is for, and BIN loses its column menu outright. HEX keeps its filter, because a status word or a fault code from the manual is often exactly what you are hunting for, and that is filtering on the value rather than on its presentation. The value columns keep theirs.

Clearing a filter

A grid that hides rows looks like a grid that lost them, so ClearFiltersButton sits beside RAW and shows only while a filter is on.

It reads the grid's active items rather than its filter model. Opening the filter panel already puts an empty item in the model, and a form nobody has typed in yet is not something to offer a button for.

Read configuration

RegisterGrid.tsx sets a filter model of its own in that mode, to keep the rows without a data type out of the way. That left a hole: the item could be edited or deleted from the data type column menu, which fills the list with the rows the mode exists to hide.

Filtering is off there now. disableColumnFilter takes away the menu entries and nothing else, so the model set from code still filters.

Tests

15-client-toolbar.spec.ts covers the button appearing only for a filter that is set, clearing restoring the rows, the columns that offer no filter, and read configuration taking filtering away while keeping its own rows hidden.

Draft because the base is the MUI spike in #28.

@Harted
Harted changed the base branch from spike/mui-latest to main August 27, 2026 23:12
The register grid columns never declared filterable, so every column
offered a filter because MUI defaults to one, not because anyone chose
it. Addr., Bit and BIN drop theirs; HEX and the value columns keep
theirs, since filtering on a hex value is filtering on the value, not on
its presentation.

A filter set from a column menu is easy to forget, so the toolbar now
carries a button beside RAW that clears them, visible only while a
filter is on.

Read configuration sets a filter model of its own to hide the rows
without a data type. Filtering is off while it is on: a filter of the
user's could fight it, and that item could be edited or deleted straight
from the column menu, which fills the list with the empty rows it exists
to hide. Only the menu entries go, so a model set from code still
filters.

Claude-Session: https://claude.ai/code/session_01LJ74fxYgZhmViUJdVxG6mb
@Harted
Harted force-pushed the feat/register-grid-filters branch from 06292f1 to e48e15d Compare August 27, 2026 23:27
@Harted
Harted marked this pull request as ready for review August 27, 2026 23:44
@Harted
Harted merged commit a8a0667 into main Aug 27, 2026
1 check passed
@Harted
Harted deleted the feat/register-grid-filters branch August 27, 2026 23:44
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.

1 participant