Repository navigation
Make filterable table controls easier to use - #4920
Open
nastasha-solomon wants to merge 9 commits into
Open
nastasha-solomon wants to merge 9 commits into
nastasha-solomon wants to merge 9 commits into
Conversation
The search box, the dropdowns, and the count shared one wrapping row, so each new dropdown squeezed the search box and the rows wrapped unevenly. The controls now have three rows: the search box on its own, the dropdowns in an equal-width grid with their labels above them, and the count. A "Clear filters" button appears next to the count while anything is filtered, and a dropdown that's narrowing the table gets a highlighted border. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A search or filter that matched nothing left only the header row, which looked like a broken table. A message now appears under the header row, naming what's narrowing the table: the search, the filters, or both. It isn't a live region, because the count already announces "Showing 0 of N". The reset button is now labeled "Clear", which also fits search-only tables. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Five dropdowns take several rows above a table before any data shows. The dropdowns now start collapsed behind a "Filters" button beside the search box. The button shows how many filters are on, visibly and in its accessible name, so readers can tell the table is narrowed with the panel shut. It's a disclosure button with aria-expanded and aria-controls, and it's hidden when the table has no dropdowns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 18, 2026
… into filterable-table-controls # Conflicts: # src/Elastic.Documentation.Site/Assets/markdown/table.css
With NAVIGATION_PREVIEW on, pages load ds.css instead of styles.css, and ds.css takes its table styles from Components/Markdown/Table/table.css. That file still styled the old one-row controls, so the new search row, the Filters button, the dropdown grid, Clear, and the no-results message were unstyled there, and the print rules didn't hide the new buttons. The design-system stylesheet now carries the same controls, written with its tokens so they follow its light and dark themes. The Filters button's icons also get width and height attributes, because the design-system reset makes SVGs block-level with no size of their own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 18, 2026
Member
Author
… into filterable-table-controls # Conflicts: # src/Elastic.Documentation.Site/Components/Markdown/Table/table.css
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4919.
Note
This PR is stacked on #4915, and its base branch is #4915's branch. After #4915 merges, change the base to
main.Summary
This PR reworks the controls above every
:filterable:table so they stay out of the way until readers need them. The search box gets its own row, the dropdowns collapse behind a Filters button that counts the filters that are on, a Clear button resets everything, and an empty table explains why it's empty.Authors don't need to change anything. Every filterable table gets the new controls, with the same search and the same dropdowns as before.
The problem
The search box, the dropdowns, and the count shared one wrapping row. With several dropdowns, the search box got squeezed, the controls wrapped unevenly, and they pushed the table's data down the page. This is the Security LLM performance matrix with its seven automatic dropdowns:
Readers also couldn't tell at a glance which filters were on, had to undo each filter one at a time, and saw only a header row when nothing matched.
The new controls
The search box gets its own row
The search box spans the row, with a Filters button beside it. The dropdowns no longer take space from it.
Dropdowns start collapsed behind a Filters button
Readers see the table first. Filters opens the dropdowns, lined up in equal columns, each with its label above it. They wrap into fewer columns on narrow screens.
The button shows how many filters are on, even with the panel closed, so readers can always tell the table is narrowed. On a table with no dropdowns, such as one with
:filterable: search, the button doesn't appear.Active filters stand out
A dropdown that isn't set to All gets a blue border, so readers can see which filters are narrowing the table without reading every dropdown.
One button resets everything
While a search or filter is set, a Clear button appears next to the "Showing N of M" count. It empties the search box, sets every dropdown back to All, and moves the cursor back to the search box.
An empty table says why
When nothing matches, a message appears under the header row and names what's narrowing the table: "No rows match your search.", "No rows match your filters.", or "No rows match your search and filters."
This recording shows the controls in use:
6-filter-columns-provider-demo.webm
What stays the same
Try it
The docs preview for this PR has working examples under Filterable table:
https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4920/syntax/tables#filterable-table
How the screenshots were made
The screenshots and recording use the live preview of elastic/docs-content#9483, with its real styles and data. This branch's filter code and controls CSS replace the old ones on the page. A script also split the Model column into Provider and Model, and set the table to filter by Provider with #4915's
:filter-columns:.Technical details for reviewers
Markup
.filterable-table-search-row(the search input and a.filterable-table-togglebutton),.filterable-table-facets(a CSS grid oflabel.filterable-table-facet, each with a.filterable-table-facet-labelabove itsselect), and.filterable-table-summary(the status and a.filterable-table-clearbutton).selectclass names are unchanged, so the fullscreen copy of the filter state still finds them.Behavior
aria-expanded, andaria-controlspointing at the panel, which gets a unique id. The panel startshidden. The button shows a count badge of the dropdowns that aren't All, and its accessible name becomes "Filters, N on". It's hidden when the table has no dropdowns.applyFilterssetsdata-activeon each dropdown that isn't All and shows Clear only while a search or filter is set. Clearing resets everything and moves focus back to the search box.applyFilterssetsdata-emptyon the host and shows adiv.filterable-table-emptyafter the table. It's adivbecause the page's paragraph styles would add a top margin to ap. It isn't a live region, because the count already announces "Showing 0 of N". A fullscreen copy is cloned from an enhanced host, so the component removes a carried-over message before adding its own.Tests
Sixteen new tests, in three groups:
The vitest suite,
tsc, ESLint, and Prettier pass locally.🤖 Generated with Claude Code