feat: keep and expand ancestor rows when filtering expandable tables#4809
Draft
ernst-dev wants to merge 2 commits into
Draft
feat: keep and expand ancestor rows when filtering expandable tables#4809ernst-dev wants to merge 2 commits into
ernst-dev wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4809 +/- ##
=======================================
Coverage 97.61% 97.61%
=======================================
Files 952 952
Lines 30816 30845 +29
Branches 11318 11326 +8
=======================================
+ Hits 30081 30110 +29
- Misses 688 728 +40
+ Partials 47 7 -40 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ernst-dev
had a problem deploying
to
allure-report
July 23, 2026 16:17 — with
GitHub Actions
Failure
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.
Description
Adds an opt-in enhancement to
TablewithexpandableRows: when the data is filtered, ancestor rows of matching descendants stay visible, those ancestors are auto-expanded so the matches are reachable, and the matched rows are visually highlighted.Addresses AWSUI-61158 ("Filter highlights in expandable table"): with expandable rows + property filtering today, matches nested inside collapsed parents are not reachable and it is unclear which rows actually matched. This change makes matches immediately discoverable without breaking existing behavior.
New (optional)
expandableRowssub-properties onTableProps.ExpandableRows:highlightMatched?: boolean— turns the behavior on.isItemMatched?: (item) => boolean— predicate identifying which items match the current filter. Used to decide which ancestors to auto-expand and which rows to highlight.Both are optional and default to the previous behavior, so this is fully backward compatible.
Implementation notes:
useExpandableTableProps(src/table/expandable-rows/expandable-rows-utils.ts): a full-tree pass collects matched items and every ancestor on the path to a match into an auto-expand set; the visible-row traversal then treats an item as expanded when it is either consumer-expanded or auto-expanded (isEffectivelyExpanded).row-match-highlightmarker (and a background-only cell treatment viacolor-background-status-info, so no row-height shift; selection still takes precedence).aria-expanded="true"and toggling one firesonExpandableItemTogglewithexpanded: false, keeping the consumer'sexpandedItemsmodel authoritative.findMatchedRows()to the table test-utils DOM wrapper.Related links, issue #, if available: AWSUI-61158
How has this been tested?
src/table/__tests__/expandable-rows-filter-highlight.test.tsx(8 tests, all passing) covering auto-expansion of ancestors, single/multi-level highlighting,aria-expanded, toggle semantics, backward compatibility, no expansion of non-matching subtrees, and coexistence with manually expanded items.expandable-rows+group-selectionsuites re-run green (42 tests) — no regressions.pages/table/expandable-rows-filter-highlight.page.tsxfor manual/visual testing (type in the filter to see ancestors auto-expand and matches highlight; toggle the behavior off to compare).eslint,stylelint,quick-build, andtsc(pages) all green.Reviewers can run:
TZ=UTC npx jest --config jest.unit.config.js src/table/__tests__/expandable-rows-filter-highlight.test.tsxand open the new dev page vianpm start.Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md. (opt-in, default behavior unchanged)CONTRIBUTING.md.Security
checkSafeUrlfunction. (n/a — no URLs)Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.