Repository navigation
test(PowerSearch): guard the token row's search input against covering tokens and blank rows - #8249
Merged
Merged
Conversation
…g tokens and blank rows Add two PowerSearch stories whose play functions the story play guard now runs in Chromium: - Default filters beside the search input (and its RTL twin): filter tokens that reach past the field's center must not overlap the search input, and its center must hit-test as the input and focus it on press. - Token row when resting styles win: for each resting declaration of the empty search input that an empty-query rule overrides, force the resting value to win (as an app's own unlayered StyleX output does when it emits the same atomic class) and require the input to stay on the token row with no change in field height. Both fail on the layout before #7922, where the empty input was an absolutely positioned overlay under the tokens, and pass on main.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
AI review status for this pull request.
|
Contributor
PR Analysis Report
No new or modified components detected. Bundle Size SummaryNo component packages changed. Accessibility AuditStatus: No accessibility violations detected. Visual Regression46 of 502 shot(s) changed. A change here is a question, not a failure: check whether the after is the
and 26 more. Generated by PR Enrichment workflow | View full report |
ejhammond
marked this pull request as ready for review
October 24, 2026 19:09
ejhammond
requested review from
cixzhang,
imdreamrunner and
josephfarina
as code owners
October 24, 2026 19:09
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.
Maintainer impact
Two PowerSearch layout bugs reached apps on the released 0.6.x and 0.7.x lines, and nothing in CI guards against them coming back:
getByRole('combobox').click()) failed with "intercepts pointer events" unless they clicked the bar's empty end.:placeholder-shownrules beating its resting rules. Astryx ships its CSS in theastryx-baselayer with StyleX's defaultxclass prefix, so an app that compiles its own StyleX unlayered can emit the same atomic class (for example.x1n2onr6{position:relative}), and that unlayered copy beats the layered empty-query override. The input then fell back into the flex flow at nearly full width and took a row of its own, so the field grew a blank row even with plenty of room beside the tokens.#7922 moved the empty input into the flow after the last token, which fixes both on main (not yet released). This PR adds guards so neither can come back.
Intended invariant
With filters present and an empty query, the search input sits on the token row, after the last token. No token paints over it, its center hit-tests as the input, and the field grows no blank row. That holds even when a consumer stylesheet makes one of the input's resting declarations outrank its empty-query override.
Change
Test-only: two PowerSearch stories with play functions, plus their entries in the story play guard (
.github/scripts/story-play-guard.js), which runs them in Chromium in CI.Default filters beside the search input(and an RTL twin): three default filters reach past the field's center (the play function fails closed if they stop doing so). No token may overlap the input's box, the input's center must hit-test as the input, and pressing it must focus it.Token row when resting styles win: the play function collects the input's own atomic rules. For each resting declaration that a:placeholder-shownrule overrides, it forces the resting value to win with a one-rule stylesheet, then requires the input to stay on the last token's row and the field height to stay the same. It fails closed if no such declaration exists.No component, style or public API changes.
Evidence
ee74c1822^) with these stories applied, the guard fails all three new targets:default-filters-beside-searchand-rtl:Token "Status: isOpen" covers 116.03px of the search inputtoken-row-when-resting-styles-win:With the resting "position: relative" winning, the empty search input left the token row (input middle 62.00, row 20.00-44.00)packages/changes.vitest run packages/core/src/PowerSearch packages/core/src/Tokenizer: 11 files, 343 tests passed.Screenshots
A minimal PowerSearch page that loads the published
astryx.cssin its cascade layer. Before is the latest release,@astryxdesign/core0.7.4 (the same layout as every release since the overlay input shipped). After is this branch, current main plus these stories.1. Default filter chips cover the empty search input
The search input has a red outline. In 0.7.4 it spans the whole row under the chips, so its center lands on a chip's remove button. On main it starts after the last chip.
Pressing the middle of the search input (the red dot is the pointer). In 0.7.4 the press lands on the "Status: is Pending review" chip's remove button and deletes that filter. On main it focuses the input and opens the field menu.
2. The empty input wraps onto a blank second line
Both pages add one unlayered rule,
.x1n2onr6{position:relative}, the atom an app's own unlayered StyleX output emits for anyposition: 'relative'. In 0.7.4 that rule beats the input's layered:placeholder-shownoverride, the input drops into the row at nearly full width, and every field grows a blank line: 28/32px becomes 51/55px. On main the fields keep one row.Scope
Testing
The three new targets pass on this branch and fail on
ee74c1822^. In my Linux Chromium environment the existingnear-full-token-rowandnear-full-token-row-rtltargets fail the same way on untouched main: their fixture fails closed on platform font metrics, as that story's comments describe. They are unrelated to this change.prettier,eslintandcheck:repopass on the changed files.