Skip to content

fix(Tokenizer): the touch sheet's search field is a bordered input box - #8745

Closed
imdreamrunner wants to merge 1 commit into
mainfrom
fix/tokenizer-sheet-filter-border
Closed

imdreamrunner wants to merge 1 commit into
mainfrom
fix/tokenizer-sheet-filter-border

Conversation

@imdreamrunner

@imdreamrunner imdreamrunner commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Observed behavior

In Tokenizer's touch sheet (component:Tokenizer DEC-3, FR18), the search field at the top of the sheet has no border and no background of its own: the magnifier, placeholder and clear action sit directly on the sheet's white surface, with nothing marking where the field begins and ends. Seen in the sheet's browser screenshot during review of the hold-back change; measured in Chromium (iPhone 13 profile, the forced bottom-sheet story): the field box computes to 0px border, rgba(0,0,0,0) background, 10px radius, 44px tall.

Before: artifact 1099040462891356. After: artifact 1123739513380028.

Expected behavior

The field reads as an input: a 1px --color-border-emphasized border that turns --color-accent while focused, the --color-background-surface background, --radius-element corners, at the 44px height of the sheet's rows — the same box Lab's MobileTokenizer draws for its filter (a TextInput), so the two sheets match.

Root cause

The sheet renders the shared PanelSearchInput, which is borderless by design: a dropdown panel is already a bordered, elevated box, and a bordered input inside it "draws a second box within that box" (its file header). Selector, MultiSelector and the other dropdown panels rely on that. The sheet is not a box of that kind — a full-width surface under a handle — so the same field reads as unframed there. The sheet already restyles the field through the component's fieldXstyle hook (for the 44px height); the border and surface were missing from that override.

Fix

Sheet-only, through the existing hook: TokenizerBottomSheet.tsx's searchField style adds the input box — borderWidth: --border-width, solid, borderColor emphasized → accent on :focus-within, borderRadius: --radius-element, backgroundColor: --color-background-surface, transitionProperty: 'border-color, box-shadow' — beside its existing minHeight: 44 and padding. PanelSearchInput itself is untouched, so every dropdown panel keeps its borderless field; the keyboard focus ring the panel field draws (inset 2px accent) still applies on the sheet's field, inside the new border.

Record: FR18 and the anatomy row ("Sheet search row") now say the shared panel search field is drawn in the sheet as a bordered input box; nothing else in the record described the field's look. check:knowledge aligned. Changeset: [chore] (internal) for @astryxdesign/core — the sheet is held back behind an internal entry, so the release notes announce nothing.

Evidence

  • New test in TokenizerBottomSheet.test.tsx: the field box (the search input's styled ancestor) carries the atomic classes StyleX compiles for exactly those declarations (1px emphasized/accent border, element radius, surface background, 44px); fails without the style change, passes with it.
  • Chromium, iPhone 13 profile, forced bottom-sheet story: before — 0px solid, transparent, 44px; after — 1px solid rgb(212, 212, 212) (--color-border-emphasized as the story theme resolves it), rgb(255, 255, 255) surface, 10px radius, 44px (artifacts above).
  • Unchanged: the dropdowns' field (no PanelSearchInput change; Selector/MultiSelector suites not in this change's path), the sheet's behavior (the whole Tokenizer suite, 158 tests, passes).

Scope

  • One defect is fixed: the sheet's search field is framed as an input.
  • Unrelated fixes, cleanup, and policy changes were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label — the sheet's parts expose no theming targets while the option is held back (DEC-3), and this is the sheet's own field style.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm exec vitest run packages/core/src/Tokenizer → 158 passed (5 files)
  • pnpm -F @astryxdesign/core typecheck → 0 errors
  • ASTRYX_STRICT_LINT=1 eslint packages/core/src/Tokenizer → 0 errors (5 pre-existing warnings)
  • pnpm check:repo → 0; pnpm check:knowledge aligned; pnpm check:changesets ✓; git diff --check clean
  • Chromium screenshots before/after as above.

@vercel

vercel Bot commented Oct 27, 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 27, 2026 8:57pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Nov 3, 2026, 3:43 AM UTC

@github-actions github-actions Bot added needs:spec-owner-review Current knowledge records await owner approval needs:design-review Affects visuals — Design should review labels Oct 27, 2026
@imdreamrunner
imdreamrunner force-pushed the fix/tokenizer-sheet-filter-border branch from 692e847 to a077a0a Compare October 27, 2026 20:33
The shared panel search field is borderless because a dropdown panel is
already a bordered box; the sheet is a full-width surface, where the same
field read as unframed. In the sheet it now takes the input box — 1px
emphasized border, accent on focus, surface background, element radius —
at the 44px height of the sheet's rows, through the field's own style hook.
The dropdowns' field is unchanged. Record: FR18 and the anatomy row name
the bordered box.
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

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

Modified Components

Tokenizer (@astryxdesign/core)
Metric Before After Delta
Entry File (ESM) 331B 331B 0B
Lines of Code 1923 1937 -
Complexity Very High Very High (308) -

Component Size

Component Import before Import after Delta CSS before CSS after Delta
core/PowerSearch 158.2KB 158.2KB 0B 19.9KB 19.9KB 0B
core/Tokenizer 68.8KB 68.8KB 0B 16.5KB 16.5KB 0B

Sizes are gzip. Import counts the JavaScript the import loads eagerly; CSS counts the package stylesheet rules referenced by the modules it can load from its own package, lazily loaded ones included.

Bundle Size Summary

Gzip figures measure each package's entry file, not the code an import pulls in.

Package Entry (ESM) Entry gzip before Entry gzip after Delta
@astryxdesign/core 4.9KB 1.2KB 1.2KB 0B
Package stylesheet Gzip before Gzip after Delta
@astryxdesign/core 34.6KB 34.6KB 0B

Accessibility Audit

Status: 1 accessibility violation(s) found — 1 serious.

Tokenizer - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/26 stories · Learn more
    • WCAG: 1.4.3 (Level AA)

Visual Regression

Status: No visual change across 4 compared shot(s).


Generated by PR Enrichment workflow | View full report

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 27, 2026
@imdreamrunner
imdreamrunner marked this pull request as draft October 27, 2026 21:07

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval is waiting on a spec decision: this change adds a new requirement to component:Tokenizer FR18 and its Sheet search row (the touch sheet's search field drawn as a bordered input box instead of the shared panel field's borderless look), which the record on main does not state yet. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner; if the look is not approved, the sheet keeps the shared field's look. Whichever way that goes, two fixes are needed:

  • Remove the new class-name test in TokenizerBottomSheet.test.tsx, which copies the style's declarations; the repository's test-sufficiency architecture asks for real-browser before/after evidence for a paint change instead.
  • Add the ## Writing rubric results section to the description, which every pull request that changes a spec record reports.

[Automated review]

Comment on lines +241 to +271
it('draws the search field as a bordered input box — 1px emphasized border, element radius, surface background, 44px — unlike the borderless panel field the dropdowns share (FR18)', () => {
// The same declarations as the sheet's style compile to the same atomic
// classes; the field's own panel style has none of them.
const atoms = (style: stylex.StyleXStyles) =>
stylex
.props(style)
.className!.split(' ')
.filter(name => !name.includes('__'));
const box = stylex.create({
field: {
borderWidth: borderVars['--border-width'],
borderStyle: 'solid',
borderColor: {
default: colorVars['--color-border-emphasized'],
':focus-within': colorVars['--color-accent'],
},
borderRadius: radiusVars['--radius-element'],
backgroundColor: colorVars['--color-background-surface'],
minHeight: 44,
},
});
render(<Harness />);
fireEvent.click(openTrigger());
const input = screen.getByLabelText('Search Tags');
// The field box is the input's styled ancestor, the one the shared panel
// field rings on keyboard focus.
const field = input.parentElement!;
for (const name of atoms(box.field)) {
expect(field).toHaveClass(name);
}
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test re-declares the sheet style's border, radius, fill and height in a test-local stylex.create and checks the generated class names on the field box, so it passes whenever the source repeats itself and cannot see the rendered box. docs/architecture/component-test-sufficiency.md (INV6, INV11 and its test-quality exclusions) asks for real-browser before/after evidence for a paint change instead of a class assertion. Suggest removing this test and the borderVars/radiusVars import it added, and pointing to before/after frames in the description.

@imdreamrunner

Copy link
Copy Markdown
Contributor Author

Closing: superseded by #9708, which turns the Tokenizer sheet presentation back on and carries the bordered search field at the large input height along with the rest of the touch flow.

@github-actions
github-actions Bot deleted the fix/tokenizer-sheet-filter-border branch November 3, 2026 06:05

This branch was successfully deployed

1 active deployment
Preview — 470d371c Deployed Oct 27, 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. needs:design-review Affects visuals — Design should review needs:spec-owner-review Current knowledge records await owner approval

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant