Repository navigation
refactor(Typeahead): invalidate a replaced searchSource during render, not in an effect - #6370
Merged
Merged
Conversation
…, not in an effect Follow-up to #6357. A source swap is a fact of the render that carries it, so compare against the previous source there: cancel it, adopt the new one, and advance the search generation. The effect that did this on cleanup — and the lint suppression it needed to read a live ref — go away; what remains is a pure unmount cleanup for the debounce timer and the current source. Also trims the PowerSearchEditPopover comments added in #6357 to the non-obvious "why".
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
nynexman4464
force-pushed
the
fix/powersearch-value-editor-followup
branch
from
September 18, 2026 18:06
98ac21f to
d168508
Compare
nynexman4464
marked this pull request as ready for review
September 18, 2026 18:19
nynexman4464
requested review from
cixzhang,
imdreamrunner and
josephfarina
as code owners
September 18, 2026 18:19
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsPowerSearch (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: 36 accessibility violation(s) found — 2 critical, 34 serious. Button pattern - 1 issue(s)
ChatComposer - 1 issue(s)
ChatComposerInput - 1 issue(s)
ChatReasoning - 1 issue(s)
ChatToolCalls - 1 issue(s)
Checkbox pattern - 1 issue(s)
CheckboxList - 1 issue(s)
ClickableCard - 1 issue(s)
CodeEditor - 1 issue(s)
CodeEditorPerf - 1 issue(s)
CodeEditorTheme - 1 issue(s)
CodeTheme - 1 issue(s)
DateRangeInput - 1 issue(s)
FileInput - 1 issue(s)
GridMasonry - 1 issue(s)
Heading - 1 issue(s)
Icon - 1 issue(s)
LogStream - 1 issue(s)
MediaTheme Auto - 1 issue(s)
PowerSearch - 1 issue(s)
ProgressBar - 1 issue(s)
Radio group pattern - 1 issue(s)
RadioList - 1 issue(s)
RichTextEditor - 2 issue(s)
SelectableCard - 1 issue(s)
Stepper - 1 issue(s)
TableGroupedRows - 1 issue(s)
TableTree - 1 issue(s)
Text - 1 issue(s)
Theme - 1 issue(s)
PopArt - 1 issue(s)
Thumbnail - 1 issue(s)
Timestamp - 1 issue(s)
Token - 1 issue(s)
Tokenizer - 1 issue(s)
Visual RegressionStatus: No visual change across 4 compared shot(s). Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
github-actions
Bot
deleted the
fix/powersearch-value-editor-followup
branch
September 19, 2026 06:20
AKnassa
added a commit
to AKnassa/astryx
that referenced
this pull request
Sep 26, 2026
Resolved conflicts: - docs/families/input-fields.md: took upstream's reformatted adoption table (meta#6407 widened the Recorded exception column) and re-applied this PR's Typeahead row (`isLoading`, `changeAction`, ..., source busy | search lifecycle is component-owned), then ran prettier on the table. BaseTypeahead.tsx and Typeahead.test.tsx auto-merged (picking up meta#6370's searchSource invalidation during render).
AKnassa
added a commit
to AKnassa/astryx
that referenced
this pull request
Sep 26, 2026
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.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User impact
None visible. Follow-up to #6357, which shipped correct behavior with two things worth cleaning before it reaches a release: an over-explained pair of comments in
PowerSearchEditPopover, and asearchSource-replacement effect inBaseTypeaheadthat needed a lint suppression to read a live ref in its cleanup.Problem and solution fit
A
searchSourceswap is a fact of the render that carries it. #6357 handled it in the[searchSource]effect's cleanup — which runs a commit later, and had to readsearchGenRef.currentlive, hence theeslint-disable. Doing the comparison during render (prevSearchSourceRef !== searchSource) cancels the old source, adopts the new one, and advances the generation in the same pass, with no effect and no suppression. What remains is a pure[]unmount cleanup for the debounce timer and the current source.Render-time side effects are safe here because both are idempotent: the counter is monotonic (an extra bump on a discarded render only invalidates work that was already invalid), and
cancel()is idempotent by contract.Expected behavior and authority
BaseTypeahead.spec.mdFR3 / PR1 as amended in #6357: source replacement invalidates stale asynchronous work. Unchanged by this PR.Smallest restoration
BaseTypeahead.tsx: render-time source comparison replaces the[searchSource]cleanup effect; the effect becomes unmount-only; theeslint-disableis gone.PowerSearchEditPopover.tsx: two JSDoc blocks reduced to one- and two-line comments. No code change.Evidence
Typeahead.test.tsx › discards a response from a source that was replaced while it was in flightstill passes, and still fails whenBaseTypeahead.tsxis reverted to its pre-fix(PowerSearch): replace an open value menu when the field or operator changes #6357 state (confirmed by swapping the file and re-running).Scope
Testing