Repository navigation
Conversation
Adopt the input-field family's busy and Transition Action contracts. isLoading marks the value as busy (FR5): the end-lane Spinner shows and the combobox carries aria-busy while the search source and its results stay untouched (AST-001). changeAction runs after onChange with the same (items, change) arguments, in a transition, on every value path (add, create, remove, Backspace, clear-all), with the proposed tokens shown optimistically until value catches up (FR6). A search in flight and a busy value share one Spinner and one aria-busy (FR7): the busy signal reaches BaseTypeahead through a package-internal context, so no public prop is added there. Hidden form inputs keep the accepted value, and the clear-all control follows the accepted value like Selector's clear. Also closes three edits that slipped through while the field is disabled with a reason (FR4): Backspace on an empty input removing the last token, ArrowDown then Enter selecting one of the entries shown on focus (the base key handler now returns while disabled; that hunk is byte-identical to the Typeahead change for meta#5941), and a custom token's remove callback. The component spec records the API delta per AST-002 FR12/FR13, and 27 tests pin the behaviour: Action ordering and change payloads for every path, concurrent Actions, rollback, the duplicate guard and maxEntries on the proposed list, hidden inputs on the accepted list, the error boundary path, unmount while pending, and every Action path blocked while focusable-disabled. Part of meta#5941 (Tokenizer checkbox). Claude-Session: https://claude.ai/code/session_01N5RkmXVgx725F6rqZTGecR
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewNo new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: 1 accessibility violation(s) found — 1 serious. Tokenizer - 1 issue(s)
Visual RegressionStatus: No visual change across 420 compared shot(s). Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
…sable-disabled The disabled key guard swallowed Tab, skipping the keydown dismissal that stops Chrome dropping focus to <body> when the open menu hides during focusout. Tab now passes through; Escape needs no passthrough because the layer stack routes an unclaimed press to the topmost layer. Also closes the pointer half of FR4: handleSelect now ignores clicks while disabled, so a menu left open by a mid-flight disable cannot commit a selection. Three regression tests, each kept red under a one-line mutation; changeset wording updated.
cixzhang
left a comment
There was a problem hiding this comment.
An external value update can leave users looking at stale tokens until a pending save settles. The current test explicitly keeps the old proposal on screen, but the input-family contract says optimism ends when the controlled value accepts or replaces it. Please let the replacement win immediately.
Tokenizer.spec.md also says no public concept or declaration changed, although this adds two exported props. Please make the current component record describe the actual public delta.
[Reviewed by Robohands]
kentonquatman
left a comment
There was a problem hiding this comment.
The design looks good! Thanks @AKnassa!
There was a problem hiding this comment.
Thanks for adopting the input family's busy and Transition Action contracts in Tokenizer — the mutation coverage across add, create, remove, Backspace, and clear-all, and the focusable-disabled fixes, are thorough.
One change is needed before this can be approved. When a parent replaces the controlled value while a changeAction is still pending, the older proposed tokens stay on screen until the Action settles. The family contract (input-fields FR6) ends the optimistic presentation when the controlled value accepts or replaces the proposal, so the replacement should become visible immediately. The focused test "holds the proposal when the parent replaces value mid-Action" currently asserts the stale display — please update the behaviour and that test so the replacement (Bob) replaces the proposal (Alice) before settlement. Until then, what a person sees can disagree with what a form would submit.
Smaller, non-blocking: in Tokenizer.spec.md, "No public concept is introduced" sits next to the new isLoading/changeAction props. Qualifying it to say no Tokenizer-owned concept is invented — the two family concepts are newly exposed as props — would prevent a misreading.
[Automated review]
Resolved conflicts:
- packages/core/src/Tokenizer/Tokenizer.spec.md: kept both sides. The
Compatibility section keeps the isLoading/changeAction bullets and main's
hasEntriesOnFocus FR13-FR15 correction, folding main's "public API is
unchanged" bullet into the released-default bullet (the props change the
API). Main's committed-value retention bullet now notes that a pending
changeAction proposal is filtered like committed tokens until it ends.
Public concepts keeps the family-concept paragraph and main's sentence;
the verification map keeps main's rows plus the Input busy row.
- docs/families/input-fields.md: Tokenizer adoption row lists isLoading and
changeAction and keeps main's DEC-5 exception, dropping "no family
isLoading or changeAction"; main's iOS anti-zoom paragraph is kept.
- packages/core/src/Typeahead/BaseTypeahead.tsx: aria-busy keeps
`isLoading || isInputBusy` with main's renamed inputAriaDescribedBy /
inputAriaLabelledBy.
Merge fallout: the "isLoading turns off while a search is still in flight"
test re-rendered with a fresh `value={[]}`, which now re-derives the filtered
source mid-search, and BaseTypeahead drops a replaced source's in-flight
search since meta#6370. The test now passes one array across renders.
…once
astracat F1 (and cixzhang's 09-08 review): a parent that replaced `value`
while a changeAction was pending kept seeing the stale proposed tokens and
aria-busy until that Action settled, so the field showed one list while a
form would submit another. input-fields.md FR6 ends optimism when the
controlled value accepts or replaces the proposal.
The pending proposal is now the optimistic state, carrying the value it was
proposed against, and it shows only while `value` still holds those token
ids: a replacement arriving mid-Action wins immediately and ends that
proposal's busy state. The base is compared by id, not array identity, so a
parent re-rendering with a fresh array of the same tokens (an inline
`value={[...]}`) keeps the proposal. Stacked proposals keep the latest, and
React still reverts each one as its Action settles.
Tests: the mid-Action replacement test now asserts Bob shows, Alice is gone,
and no Spinner or aria-busy remains before the old Action resolves (red
before the fix: Bob's token was absent), and settles its Action in a
finally so a failure cannot entangle later tests. A new guard keeps the
proposal across a fresh array of the same ids; it fails if the base is
compared with `===`. The changeAction prop description, doc and changeset
now say "until value accepts or replaces them" instead of "catches up".
astracat F2 (and cixzhang's 09-08 review): Tokenizer.spec.md said no public concept or declaration changed, beside two new exported props. - Contract at a glance: Public contract names the two optional TokenizerProps members instead of "None"; Builder impact lists them as new optional caller choices. - Compatibility class records the declaration delta (`isLoading?: boolean`, `changeAction?: (items, change) => void | Promise<void>`) instead of saying the declaration is unchanged, and names the disabled-reason fix as `family:input-fields` FR4, not this record's FR4. - Public concepts: no Tokenizer-owned concept is introduced; the two family concepts are newly exposed as optional props. - The proposal is busy until `value` "accepts or replaces" it, and the Input busy verification row adds the replaced-mid-Action state and its failure. Docs only, no red state: scripts/check-knowledge.mjs passes before and after.
…arlier one astracat F1, follow-up to ca6eecd. Each pending proposal recorded only the `value` it was proposed against. A parent that accepts each change once its save settles, with a plain update after the await (the TransitionAction story's pattern), turns `value` into the earlier proposal's tokens while a later Action is still pending. That value matched neither base, so the later token disappeared and the Spinner and aria-busy dropped until its own save settled, then the token came back: FR6's "optimistic feedback disappears" and the spec's "aria-busy drops while busy". A proposal now carries the chain of values it may stand on: the value it was proposed against and, when stacked on a proposal still standing, that proposal's bases and tokens. It stands while `value` holds the ids of any of them. Accepting an earlier stacked proposal leaves the later one standing; a genuine replacement matches no base and still wins at once. Tests: new "keeps a later proposal and busy while the parent accepts an earlier one" (stateful parent, add Alice, add Bob, settle Alice's save, then Bob, Spinner and aria-busy must remain). Red at bfd9610: Bob's remove button was null at Tokenizer.test.tsx:2508. It passes on the pre-fix merge source (e50b39c) and after this change; the replacement and fresh-array tests still pass. Settles in a finally so a red run cannot entangle later tests. Docs: the Chinese changeAction description in Tokenizer.doc.mjs still said "until value catches up"; it now matches the English "accepts or replaces them".
|
Thanks @cixzhang, and thanks astracat. You were both right, and I'm sorry this sat so long after the 09-08 review. Pushed at 7320fb7:
I also merged main (e50b39c). That meant resolving conflicts in the spec, the family adoption row and the Still to do on my side: the screenshots the description says will follow in a comment. Could you take another look? |
There was a problem hiding this comment.
Thanks for the follow-up — the two issues from the last review are both addressed, and this now matches the input family's busy and Transition Action contracts.
- A parent replacement now wins right away: the pending proposal remembers the token-id chain it stands on, so a replacement shows immediately and that proposal's Spinner and
aria-busyend, while a fresh array of the same tokens keeps the proposal and accepting an earlier stacked change keeps a later one standing. The mid-Action test now asserts the replacement, with new tests for the same-ids and stacked cases. Tokenizer.spec.mdnow records the public delta: both new optional props are listed in the contract and compatibility sections, and the public-concepts wording now says no Tokenizer-owned concept is introduced while the two family concepts are newly exposed as props.
One non-blocking remainder: the screenshots mentioned in the description are still listed as to do in your latest comment — please add the busy, pending, and settled shots when you get a chance.
[Automated review]
There was a problem hiding this comment.
Thanks for the follow-up: the replacement and spec-delta points from the earlier reviews are fixed, and both new props match the input family's busy and Transition Action contracts. Approval now waits on a maintainer decision: Tokenizer.spec.md adds three rules the current Tokenizer record does not state, and the record's owner needs to approve or reject them. Those rules are that pending changeAction tokens leave the suggestions (lines 87–90, where current FR13 keeps an unaccepted proposal eligible), that Clear all follows the accepted value (lines 82–84), and the new Input busy verification row (line 339). Separately, please:
- Drop the
aria-expandedpremise and its “auto-closing would flicker” rationale fromopenMenuThenDisable(Tokenizer.test.tsx:1171–1201), because the current Tokenizer record requires an open popup to close when the field becomes disabled. - Add
## Writing rubric resultsfor the two changed records to the description, asdocs/contributing/spec-writing.mddescribes, and rewrite the “Before it … After it” narration atTokenizer.spec.md:78–80in the present tense. - Rebase onto
main, whereTokenizer.tsx,Tokenizer.test.tsx,Tokenizer.doc.mjsandBaseTypeahead.tsxnow conflict.
[Automated review]
| available. The one addition is a `changeAction` proposal still pending: its | ||
| tokens are on screen, so FR13 filters them from the cohorts like committed | ||
| ones until the proposal ends, and one the caller did not accept is eligible | ||
| again. |
There was a problem hiding this comment.
This makes FR13 treat a pending changeAction proposal like a committed value. The current FR13 excludes only committed ids and keeps an unaccepted proposed value eligible, so this rule needs the record owner's approval before it lands as written.
| (`family:input-fields` FR5–FR7). The clear-all control follows the | ||
| accepted `value`, as Selector's clear does, while the tokens follow the | ||
| proposal. |
There was a problem hiding this comment.
This adds a behaviour rule. During a pending clear, Clear all stays on screen with no tokens, and a pending first add shows a token without Clear all. The family contract does not decide this, so it also waits on the record owner.
| // The premise the tests below stand on: the flip itself leaves the | ||
| // menu open. If a future change closes it here, these tests would | ||
| // pass without exercising anything. | ||
| expect(input).toHaveAttribute('aria-expanded', 'true'); |
There was a problem hiding this comment.
This premise asserts the menu stays open after the field becomes disabled. The current Tokenizer record's Disabled state says “an open popup closes and clears its active descendant”. Dropping this assertion, and the “auto-closing would flicker” rationale above, keeps the edit-blocking checks without locking in the gap.
|
Closing as stale to reduce CI load; feel free to reopen or push a fresh branch if it's still needed. Posted by Cindy's agent on her behalf. |
What this does
Tokenizer can now show that its value is busy, and can run a save step after every change to the token list.
isLoadingmarks the value as resolving or saving.changeActionruns afteronChange, inside a React transition, and the field shows the proposed tokens as busy until the parent'svaluecatches up.Why
The input-field family contract gives every field the same two ideas: a busy value (FR5) and a Transition Action (FR6). Tokenizer only knew how to show a search in flight, and a caller who wanted "saving…" after adding or removing a token had nothing to reach for. #5941 lists this as a gap. AST-001 also applies:
isLoadingmust never be read as "the suggestions are still loading", and this keeps the two meanings apart.What changed
isLoadingprop: the end-lane Spinner shows and the combobox carriesaria-busy. The search source and its results are untouched.changeActionprop, called with the same(items, change)thatonChangereceives, on every value path: add, create, remove, Backspace, and clear-all.onChangestill runs first; the Action runs in a transition; the tokens show the proposed list at once; if the parent never accepts it, the field falls back to the accepted list.aria-busyfor both meanings (FR7).bodyin Chrome), and Escape still closes it through the shared layer stack.How to see it
Storybook → Tokenizer → "Value busy" and "Transition action". In the second story, add a name: the token appears at once with the Spinner, and settles about a second later. Screenshots of the busy, pending and settled states follow in a comment.
Evidence
The
input busy: isLoading and changeActionsuite has 27 tests (file total 103; a post-open review round added three focusable-disabled regression tests to thedisabledMessagesuite — Tab's keydown dismissal, the Escape invariant, and the option click on a menu left open by a mid-flight disable — each kept red under a one-line mutation). The first 9 were red before the change. Of the 18 edge-case tests, two were red on the change as written (the Backspace path and the custom token's remove callback) and are green after the fixes, and extending the focusable-disabled test with ArrowDown then Enter turned it red and green after the base guard; the rest pass on the change as written, so each was kept only after a one-line mutation made it fail: building the next list from the accepted value instead of the proposed one, deduplicating against the accepted list, reading the hidden inputs from the proposed list, countingmaxEntriesagainst the accepted list, swallowing a rejected Action, awaiting a void Action as a promise, and dropping the Spinner's accessible name each turn one specific test red.Covered: a second add while the first Action is pending, with both Actions running in order; removing from the proposed list mid-Action; create-on-Enter through the Action; a withdrawn remove restoring the token; busy holding while either
isLoadingor an Action is active;isLoadingturning off mid-search keeps the single Spinner; the duplicate guard andmaxEntriescounting the proposed list; hidden form inputs and the clear-all control staying on the accepted value, with a second clear during a pending clear being a no-op; a parent replacing the list mid-Action; every Action path blocked while focusable-disabled; a rejected Action reaching the nearest error boundary once; a synchronous Action; unmounting mid-Action;aria-describedbyorder while busy; and the Spinner named from the i18n catalog.Local checks, all on top of the current upstream main: Tokenizer and Typeahead suites (192 tests), Selector and InputGroup suites (211 tests), core typecheck and docs typecheck, eslint with only the three pre-existing BaseTypeahead warnings, prettier, and the knowledge, changeset and SYNC checks.
Pre-existing behaviour seen along the way, not changed here
body. The optimistic path behaves exactly like the existing controlled path.Rubric
Triage: new API surface · non-breaking · low blast radius → deep path (the API shape is the maintainers' call; this is the shape #5941 and family FR5–FR7 ask for) · checks: §1 A1–A7/A11–A12, §3 P1–P7/P15–P18, §7 C1–C8/C11, §8 X5/X9–X12, §9 I1–I5, §3 P11–P12 · X20 changeset, §5b screenshotsPart of #5941 (Tokenizer
isLoading+changeActioncheckbox). The busy-context change inbusyIndicatorLane.tsxandBaseTypeahead.tsxis byte-identical to the Typeahead PR for the same issue, so whichever lands second rebases clean.