Repository navigation
chore: Indent expandable table rows with a custom property - #5112
Open
TrevorBurnham wants to merge 3 commits into
Open
TrevorBurnham wants to merge 3 commits into
TrevorBurnham wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused implementation preserves existing behavior and compatibility with adequate regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Replaces per-level expandable table indentation rules with a numeric CSS custom property, substantially reducing generated CSS while preserving compatibility.
Changes:
- Sets capped indentation levels inline for expandable cells.
- Consolidates SCSS indentation rules while retaining legacy level classes.
- Adds regression tests for nesting, capping, column scope, editing, and classes.
| File | Description |
|---|---|
src/table/cell-base/_cell-box.scss |
Calculates indentation from the custom property. |
src/table/body-cell/td-element.tsx |
Sets capped levels and preserves legacy classes. |
src/table/body-cell/styles.scss |
Retains declaration-free compatibility classes. |
src/table/__tests__/expandable-rows.test.tsx |
Tests custom-property and class behavior. |
build-tools/utils/custom-css-properties.js |
Registers the table custom property. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
TrevorBurnham
force-pushed
the
table-expandable-level-custom-property
branch
from
October 7, 2026 12:32
7bc380d to
d932442
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5112 +/- ##
==========================================
- Coverage 97.70% 93.83% -3.88%
==========================================
Files 990 989 -1
Lines 31818 27559 -4259
Branches 11752 9496 -2256
==========================================
- Hits 31089 25861 -5228
- Misses 722 786 +64
- Partials 7 912 +905 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch was previously 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.
Description
cell-padding-inline-startintable/cell-base/_cell-box.scssgenerates a rule pair for each of the 11 expandable levels (0-9 andnext), andbody-cell/styles.scsscalls it in 11 contexts. That accounts for 220 of the 375 rules intable/body-cell/styles.scoped.css.This PR sets the level as an inline custom property (
tableExpandableLevel, capped at 9 as before) on expandable column cells, and the mixin emits one rule pair keyed on.body-cell-expandable. That class is applied under the same condition as the level classes and has the same specificity, so the cascade is unchanged.Several internal apps select on
[class*="expandable-level-N"]to tint rows or extend indentation past level 9, so the level classes are still applied and kept in the class map as rules with no declarations.table/body-cell/styles.scoped.css:Adding a custom property changes the shared hash in every generated custom property name, as with any addition to the list. The second commit updates the nine
styles.test.tsxsnapshots that contain the hash; the only change in them iska4djmtofikhx4.Related links, issue #, if available: n/a
How has this been tested?
expandable-level-nextrule to its.body-cell-expandablereplacement and dropping levels 0-9, the remaining rules are identical and in the same order. Every removed level-N declaration equals the new one with the property set to N, either textually or, for the toggle wrapper, after evaluating the calc.src/__tests__unit suites pass, apart from the Style API docs tests that need a full build.Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md.CONTRIBUTING.md.Security
checkSafeUrlfunction.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.