Repository navigation
feat(lab): MobileTokenizer — touch Tokenizer prototype - #6640
Conversation
Standalone Lab port of the stacked manage+add sheet flow using public Core APIs only; API mirrors Core Tokenizer for graduation. Core promotion (Tokenizer presentation) stacks on top separately.
Remove Tags/Add item headings and the N selected text; manage sheet is rows + close, add sheet is rows + bottom filter/Done. Sheet accessible names remain via BottomSheet label.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
New Lab component adds components/lab/mobile-tokenizer; refresh the reviewed route lock (generate-data.mjs checkShadcnRouteLock).
PR Analysis Report
New ComponentsMobileTokenizer (@astryxdesign/lab)
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Visual Regression25 of 420 shot(s) changed. View the report A change here is a question, not a failure: check whether the after is the
and 5 more. Generated by PR Enrichment workflow | View full report |
TextInput Field root shrink-wraps; give it flex-basis 0 + width 100% so it takes all filter-row space except Done and gap.
There was a problem hiding this comment.
Thanks for putting this touch Tokenizer flow together as a Lab prototype — the problem it addresses is clear, and keeping Core unchanged while the flow is tried in Lab is the right shape.
Approval needs a maintainer decision first. This adds MobileTokenizer as a new public @astryxdesign/lab export, and the PR notes there is currently no specification for it. A maintainer needs to provide or identify the governing spec for this addition — specifically what settles its public API (searchSource/value/onChange, hasCreate, maxEntries, renderItem) and its stacked manage/add-sheet behaviour with immediate tap-to-toggle selection — before it can be approved.
Two smaller fixes are also needed, independent of that decision:
- If the search source rejects, the add sheet keeps showing the previous query's results as if they matched the current filter, and those stale rows can still be tapped. Please clear the results (or show the empty-results text) when a search fails.
- The component doc describes
labelas a sheet heading even though the sheets deliberately render no heading, and its props list omits several exported props (description,isOptional,isDisabled,maxMenuItems,minQueryLength,debounceMs,emptySearchResultsText,onChangeQuery). Please align the doc with the exported interface.
No Core behaviour changes in this PR, and the additive, canary-only scope is welcome.
[Automated review]
The pre-commit hook (lint-staged: eslint --fix + prettier --write) ran on the upstream/main merge commit dc0e1e4 and rewrote 12 files that this PR never touched, so they showed up as formatting-only churn in the PR diff. This restores each of them byte-for-byte from upstream/main (82fb22c, the merge's second parent): - apps/storybook/stories/MobileTokenizer.stories.tsx - internal/vibe-tests/stepper-collapse-naming-test/PLAN.md - internal/vibe-tests/stepper-collapse-naming-test/docs/arm-{a-collapsed,b-bare,c-summary,d-enum,recall}.md (gen-docs.mjs output; PLAN.md relies on the arms staying byte-identical outside their substitutions) - packages/core/src/Carousel/Carousel.test.tsx - packages/core/src/Chat/__tests__/ChatMessageMetadata.a11y.chromium.spec.ts - packages/core/src/TextInput/TextInput.test.tsx - packages/lab/src/MobileTokenizer/MobileTokenizer.{tsx,test.tsx} (meta#6640) Committed with the hook bypassed, because lint-staged would otherwise re-prettify exactly these staged files. After this commit, `git diff --stat upstream/main HEAD` lists only the PR's 16 files.









User need
On compact touch devices, the Core Tokenizer's inline combobox (tokens + input + anchored menu in one field) cannot hold token chips, a 44px-target result list, and the software keyboard at once. Builders need a way to try the touch flow — summary field, stacked manage/add sheets — before it is specified for Core.
Lab is the staging area for exactly this: canary-only, no stability promise, iterate freely.
Problem and solution fit
MobileTokenizerin@astryxdesign/lab— field trigger opens a manage BottomSheet (selected rows, remove, Clear all, Add item), Add item stacks an add BottomSheet (result rows above, filter + Done in the bottom row above the keyboard, tap +/check toggles immediately).Lab/MobileTokenizer, colocated tests, component doc.Current specification
None for Lab (by design). The Core graduation is a separate stacked change:
Tokenizer presentation="bottom-sheet" | "adaptive", mirroring the released Selector/MultiSelectorpresentationcontract. This Lab API mirrors Core Tokenizer (searchSource/value/onChangewith single-item change,hasCreate,maxEntries,renderItem) so graduation is an import swap.Public delta and caller burden
New Lab-only export; no Core API changed.
Defaults: no
maxEntriescap,debounceMs=150,emptySearchResultsText='No results found'.Design and alternatives
BottomSheetSwitcher(one dialog, one scrim, stacked handoff) — rejected: two standalone sheets (two modals/scrims).useMobileKeyboardscrolls the focused filter into the safe area).BottomSheet label.Evidence
packages/lab/src/MobileTokenizer2/2 (field→manage→add flow, remove/clear).Scope
Testing
vitest run packages/lab/src/MobileTokenizer/— 2 passed. Storybook:Lab/MobileTokenizer — Touch flow.