Repository navigation
fix(Tokenizer): the touch sheet's search field is a bordered input box - #8745
imdreamrunner wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
692e847 to
a077a0a
Compare
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.
a077a0a to
470d371
Compare
PR Analysis Report
Modified ComponentsTokenizer (@astryxdesign/core)
Component Size
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 SummaryGzip figures measure each package's entry file, not the code an import pulls in.
Accessibility AuditStatus: 1 accessibility violation(s) found — 1 serious. Tokenizer - 1 issue(s)
Visual RegressionStatus: No visual change across 4 compared shot(s). Generated by PR Enrichment workflow | View full report |
There was a problem hiding this comment.
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 resultssection to the description, which every pull request that changes a spec record reports.
[Automated review]
| 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); | ||
| } | ||
| }); |
There was a problem hiding this comment.
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.
|
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. |
Observed behavior
In Tokenizer's touch sheet (
component:TokenizerDEC-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 forcedbottom-sheetstory): the field box computes to0pxborder,rgba(0,0,0,0)background, 10px radius, 44px tall.Before: artifact
1099040462891356. After: artifact1123739513380028.Expected behavior
The field reads as an input: a 1px
--color-border-emphasizedborder that turns--color-accentwhile focused, the--color-background-surfacebackground,--radius-elementcorners, at the 44px height of the sheet's rows — the same box Lab'sMobileTokenizerdraws for its filter (aTextInput), 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'sfieldXstylehook (for the 44px height); the border and surface were missing from that override.Fix
Sheet-only, through the existing hook:
TokenizerBottomSheet.tsx'ssearchFieldstyle adds the input box —borderWidth: --border-width,solid,borderColoremphasized → accent on:focus-within,borderRadius: --radius-element,backgroundColor: --color-background-surface,transitionProperty: 'border-color, box-shadow'— beside its existingminHeight: 44and padding.PanelSearchInputitself 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:knowledgealigned. Changeset:[chore](internal) for@astryxdesign/core— the sheet is held back behind an internal entry, so the release notes announce nothing.Evidence
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.bottom-sheetstory: before —0px solid, transparent, 44px; after —1px solid rgb(212, 212, 212)(--color-border-emphasizedas the story theme resolves it),rgb(255, 255, 255)surface, 10px radius, 44px (artifacts above).PanelSearchInputchange; Selector/MultiSelector suites not in this change's path), the sheet's behavior (the whole Tokenizer suite, 158 tests, passes).Scope
Testing
pnpm exec vitest run packages/core/src/Tokenizer→ 158 passed (5 files)pnpm -F @astryxdesign/core typecheck→ 0 errorsASTRYX_STRICT_LINT=1 eslint packages/core/src/Tokenizer→ 0 errors (5 pre-existing warnings)pnpm check:repo→ 0;pnpm check:knowledgealigned;pnpm check:changesets✓;git diff --checkclean