Skip to content

test(PowerSearch): guard the token row's search input against covering tokens and blank rows - #8249

Merged
ejhammond merged 1 commit into
mainfrom
test/powersearch-token-row-guards
Oct 24, 2026
Merged

ejhammond merged 1 commit into
mainfrom
test/powersearch-token-row-guards

Conversation

@ejhammond

@ejhammond ejhammond commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

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:

  1. Default filter chips cover the search input. While the query was empty, the input was an absolutely positioned, full-width overlay under the tokens, so a filter row that reached past the field's center covered the input's middle. Pressing the middle of the bar hit a chip, and browser tests that click the input (getByRole('combobox').click()) failed with "intercepts pointer events" unless they clicked the bar's empty end.
  2. The input wraps onto a blank second row under the filters. That overlay depended on its :placeholder-shown rules beating its resting rules. Astryx ships its CSS in the astryx-base layer with StyleX's default x class 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-shown rule 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

  • Failure before the change: on the commit before fix(Tokenizer): place the caret after the last token #7922 (ee74c1822^) with these stories applied, the guard fails all three new targets:
    • default-filters-beside-search and -rtl: Token "Status: isOpen" covers 116.03px of the search input
    • token-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)
  • Success after the change: on this branch (rebased on current main) all three pass.
  • Product/runtime behavior verified unchanged: no source under 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.css in its cascade layer. Before is the latest release, @astryxdesign/core 0.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.

Before (0.7.4) After (main)
Before: the outlined search input spans the row under the three chips; its center hits "Remove Status: is" After: the outlined search input starts after the last chip; its center hits the input

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.

Before (0.7.4) After (main)
Before: pressing the middle of the bar removes the Status filter After: pressing the middle of the bar 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 any position: 'relative'. In 0.7.4 that rule beats the input's layered :placeholder-shown override, 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.

Before (0.7.4) After (main)
Before: three PowerSearch fields, each with a blank second line under its tokens After: the same three fields, each on one row

Scope

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

pnpm storybook:build
node .github/scripts/story-play-guard.js --storybook-dir apps/storybook/dist

The three new targets pass on this branch and fail on ee74c1822^. In my Linux Chromium environment the existing near-full-token-row and near-full-token-row-rtl targets 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, eslint and check:repo pass on the changed files.

…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.
@vercel

vercel Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 24, 2026 2:14pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 24, 2026
@astracat-bot

astracat-bot Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🔄 In progress (for maintainers only) Oct 24, 2026, 7:09 PM UTC

@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

Preview availability: Storybook and Sandbox are not both ready on the exact-head Vercel preview.

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

46 of 502 shot(s) changed.

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Selector Indicator Space Bottom Sheet Narrow End RTL neutral light 753,933
Selector Indicator Space Bottom Sheet Wide Start neutral light 740,072
Chat Full AI Chat probe light 230,823
Chat Full AI Chat probe dark 229,805
RichTextEditor Markdown parity: side by side probe dark 94,866
RichTextEditor Markdown parity: side by side probe light 89,762
Collapsible Dividers probe dark 66,445
Collapsible Dividers probe light 66,445
Chat Default neutral dark 36,304
Chat Default neutral light 35,767
Chat Empty State probe light 23,531
Chat Empty State probe dark 22,622
ChatAutoScroll Scroll Behavior Comparison neutral dark 15,378
ChatAutoScroll Scroll Behavior Comparison neutral light 14,107
Chat With Attachments probe light 13,406
Chat With Attachments probe dark 11,232
ProgressBar With Target Mark probe dark 7,895
ProgressBar With Target Mark probe light 7,895
Markdown Default neutral dark 7,573
Markdown Default neutral light 7,566

and 26 more.


Generated by PR Enrichment workflow | View full report

@ejhammond
ejhammond marked this pull request as ready for review October 24, 2026 19:09
@ejhammond
ejhammond merged commit 92ba450 into main Oct 24, 2026
70 checks passed
@github-actions
github-actions Bot deleted the test/powersearch-token-row-guards branch October 25, 2026 06:20

This branch was successfully deployed

1 active deployment
Preview — 01f29a9f Deployed Oct 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant