Repository navigation
feat(PowerSearch): list value-only matches in the sheet's content search - #14170
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec c3c8f4b |
PR Analysis Report🔎 Preview ·
|
c3c8f4b to
fe40c0b
Compare
|
/approve-spec fe40c0b |
There was a problem hiding this comment.
Changes requested on the top of this stack; the two pull requests below it are approvable at their current heads. A pull request lands only when it and every pull request below it are approved.
#14159 — approvable
The opening query behaves as the BaseTypeahead, Typeahead and Tokenizer records describe at this head, and the two findings from the last review are fixed: the mount Effect that called the owner's onClose for a disabled field is gone, and the sheet's close is now read from the sheet's own panel, with a case for the owner's element being gone.
#14163 — approvable
The doc example now reads "Owner is any of Jane Doe", matching its operator label; nothing else changed since the last review.
#14170 — changes requested
- The value-only module's load is deferred to a new Effect (
packages/core/src/PowerSearch/PowerSearchBottomSheet.tsx:922), although the handler that opens the flow,openSheetinpackages/core/src/PowerSearch/PowerSearch.tsx:1546, is the single opener and can start it;architecture:react-component-runtimeINV2 keeps work caused by one action in its handler, so please callloadValueOnlyMatches()there behind the samehasValueOnlyOptIn(config)guard and delete the Effect. - The description says the opposite of the code: "The value-only module starts loading from the trigger's handler as the flow opens" and "No new Effect: the load starts in the trigger's handler" are both false at this head, since the sheet's source is built without the value-only options and nothing but that Effect starts the load — please fix the code as above, or the two sentences.
.changeset/powersearch-value-only-matches-sheet.md:5promises "at most three per field and then a "More {field} matching '{text}'" row", but a field with three or fewer matches and no search source gets no "More" row; FR30's own wording is the fix: a field's "More" row after its rows when it has more.
Two smaller things, neither blocking: the new case named "…and Escape dismisses Add filter" (packages/core/src/PowerSearch/PowerSearchBottomSheet.test.tsx:5053) only sends Enter twice, so FR30's Escape case is unverified; and four cases FR30's verification row names have no sheet test here — a string search source's Typeahead query, a string_list value's Tokenizer query, an enum_list value's CheckboxList full list, and a Save that leaves the people draft empty after Clear all.
Whole stack: the three increments compose — one shared planner, one deferred chunk, and the only public addition is the isValueOnlyMatchAllowed operator flag — so the stack is sound once #14170's findings are fixed.
Claims and files checked
Review mode: full; reason: no-earlier-review
Claims, #14170:
- The sheet's content search lists an opted-in operator's value-only rows after the other suggestions, field by field with source-free fields first, at most three per field — verified (
valueOnlyMatches.tssheet row builder; the sheet case asserting the exact twelve-row list for "fic"). - The sheet asks no search source for them — verified (the same case asserts both source mocks were never called).
- A search-source field lists its source-free rows and then its "More" row for its first opted-in operator with a source — verified (the planner case in the source unit tests, which also checks the row's field, operator and carried text).
- A "More" row opens the value step with the typed text as a text field's value, a search source's query or a list Tokenizer's query, and an enum editor opens on its full list — verified (three sheet cases).
- A people field's "More" row opens that operator's Tokenizer sheet directly, searching the text, with focus on its panel and no trigger left behind; its Save adds one filter, shows Filters with focus on the new row and announces the add — verified (the people case).
- A dismissal, including the Tokenizer's own discard confirmation, returns to Add filter with the text kept and focus on the search — verified (the dismissal case). The matching empty-Save case is correct in the code but has no test.
- A value row adds the filter and closes Add filter; Enter commits the content-search row; a composing Enter commits nothing; a config with no content-search field lists fields only — verified (three sheet cases). Escape dismissal is named in a case that never presses Escape.
- The rows load as the flow opens and appear once the module lands — verified as behaviour (the loader case), but not by the stated mechanism: it is an Effect, not the trigger's handler (first finding).
- "No new Effect: the load starts in the trigger's handler" — false (second finding).
- "at most three per field and then a More row" in the changeset — false for a field with three or fewer matches and no source (third finding).
- No public API beyond the operator flag the pull request below adds — verified (the edit popover's new option and the sheet host's new panel reference are not reachable from any package entry point).
- First-load growth of 187 B gzip on a page that renders PowerSearch without the feature — reported, from the author's run.
- The listed suites, typecheck, lint and repository checks pass, and the new tests fail on the base — reported; CI's lint and typecheck pass at this head, and its unit, build and docsite jobs are deferred.
Claims, #14159 and #14163 (rechecked at their current heads):
- A disabled-at-mount Tokenizer opens no sheet and its owner opens none for a disabled field — verified (the record sentence and the case, with the Effect that told the owner now removed).
- A sheet opened at mount calls the owner's close callback once the exit has completed, even when the element the owner named is gone — verified (the close path now reads the window from the sheet's own panel; the case with no return target).
- The doc example's row text matches its operator label — verified.
- Everything else in those two pull requests is unchanged since the reviews that verified it.
Files, #14170: the sheet component (first finding); its tests (the Escape naming note); the sheet changeset (third finding); the planner and its loader, the source unit tests, the other changeset edit, the record's status cell and the story — clear.
Files, #14159: the Tokenizer and its sheet host (both earlier findings fixed; the close signal remains a noted edge), their tests, the context module, BaseTypeahead and its tests, Typeahead's tests, the three records and the changeset — clear.
Files, #14163: the doc example (fixed), the planner, the source hook, the component, the edit popover, the types, the catalog, the story, the record and both test files — clear.
fe40c0b to
25e060c
Compare
|
/approve-spec 25e060c |
25e060c to
f8bc6d6
Compare
|
/approve-spec f8bc6d6 |
There was a problem hiding this comment.
Approved pending CI, on the top of this stack and on the two pull requests below it. Heavy CI (build, test, docsite-test) is deferred on this head until review passes, so this is not yet ready to merge; those checks run before merge.
#14159 — approved
Unchanged since the last review, which verified the opening query against the BaseTypeahead, Typeahead and Tokenizer records; carried forward.
#14163 — approved
The only change since the last review is that the value-only module now loads through the repository's shared module loader, and the typeahead's bootstrap starts that load; behaviour and public surface are unchanged.
#14170 — approved
All three findings from the last review are fixed, each rechecked here:
- The module load now runs in
openSheet(packages/core/src/PowerSearch/PowerSearch.tsx:1550) behind the same opt-in guard, and the sheet's Effect is gone — it only subscribes to the loader throughuseSyncExternalStore. - The description's "No new Effect: the load starts in the trigger's handler" is now true of the code.
- The sheet changeset now bounds the "More" row as the record does, "after a field's rows when it has more".
The four cases that had no sheet test now have one each (a string search source's typeahead query, a string_list Tokenizer query, an enum_list full list, and a Save that leaves the people draft empty after Clear all), and Escape has its own case. Reproduced locally: vitest run --project ui packages/core/src/PowerSearch/ packages/core/src/Typeahead/ packages/core/src/Tokenizer/ passes 35 files and 1,236 tests, and the package typecheck, the knowledge check and the changeset check pass too.
Whole stack: the three increments compose — one shared planner with two entry points, one deferred chunk, and a single optional operator flag as the only public addition. A pull request lands only when it and every pull request below it are approved.
Claims and files checked
Review mode: full; reason: history
Claims, #14170:
- The sheet's content search lists an opted-in operator's value-only rows after the other suggestions, source-free fields first, at most three per field, with a "More" row after a field's rows when it has more — verified (the sheet case asserting the exact twelve-row list for "fic", and the planner's row builder).
- The sheet asks no search source for them — verified (the same case asserts both source mocks were never called, and a second case asserts it for a string source, a list source and an enum list).
- A "More" row opens the value step on the typed text: a text field's value, a search source's query, a list Tokenizer's query, and an enum or enum-list editor on its full list — verified (four sheet cases).
- A people field's "More" row opens that operator's people search directly, with focus on its panel and no trigger left behind; its Save adds one filter, shows the filter list with focus on the new row and announces the add — verified (the people case).
- An empty Save after Clear all, and a dismissal including the discard confirmation, return with the typed text kept and add nothing — verified (two cases).
- Enter commits the content-search row, a composing Enter commits nothing, Escape dismisses Add filter, and a config with no content-search field lists fields only — verified (three cases).
- The module starts loading from the handler that opens the flow, and the list fills once it lands — verified (the opener is the only place that opens the sheet, and the loader case).
- No public API beyond the operator flag the pull request below adds — verified (the surface generator reports three added rows, all that flag, all from #14163).
- The first-load growth on a page that renders the component without the feature is 163 B gzip, under the 307 B allowance — reported, from the author's own run.
- The listed suites and repository checks pass, and the new tests fail on the base — the suites, typecheck, knowledge and changeset checks were re-run here and pass; the base run is reported.
Claims, #14159 and #14163 (rechecked at their current heads):
- The opening query behaves as the three records describe, and the two earlier findings stay fixed — verified.
- The loader change in #14163 keeps the same behaviour through the shared module loader — verified (the typeahead's bootstrap starts the load; the public surface is unchanged).
Files, #14170: the sheet component, its tests, the opener in the field component, the planner and its loader, the source unit tests, both changesets, the record's status cell and the story — each read and clear.
Files, #14159: the Tokenizer and its sheet host, their tests, the context module, the typeahead and its tests, the three records and the changeset — carried forward, clear.
Files, #14163: the planner, the loader, the source hook, the field component, the edit popover, the types, the catalog, the doc example, the story, the record and both test files — each read and clear.
f8bc6d6 to
9e2a055
Compare
|
/approve-spec 9e2a055 |
9e2a055 to
c529c29
Compare
|
/approve-spec f2e546c |
There was a problem hiding this comment.
#14159 — approved. No finding: the package-internal opening query mounts the input with the text and the caret at its end, and the record wording it changes now carries PowerSearch FR30's people row with it.
#14163 — approved. No finding.
#14185 — approved. No finding: the record change is owner-approved at its exact head.
#14170 — changes requested.
- Miss: a search source replaced while Add filter's query is waiting is never cancelled and the new source is never asked, so the content search keeps its loading indicator with no empty state until the person retypes, and the replaced source's items list under the field if it answers (
packages/core/src/PowerSearch/PowerSearchBottomSheet.tsx:1045-1096); reproduced here on this head, where the popover presentation drops the same answer.spec:AST-092FR4 drops a query "when the source is replaced", whichcomponent:PowerSearchFR18 at this head adopts for every sheet list, so the description's "A stale answer is dropped … (FR4)" does not hold for that case. The smallest fix is to end the query when the source changes, as the close path already does — addsuggestionSourceto the effect at:1093, or compare it withcontentSourceRef.current— with a sheet test that replaces the source during a pending query.
One non-blocking point: the result count announced inside Add filter is the settled answer's length, not the rows the sheet lists after it filters them through the current config (:1082-1084).
Whole stack: passes. On a PowerSearch page that sets no isValueOnlyMatchAllowed the stack adds +201 B gzip of first-load JavaScript, inside the 0.3 KB allowance and inside the reading the maintainer gave for the opening-query wiring (measured here with the repository's pnpm size:pages, merge base to this head); the public delta is the one optional operator flag; and the PowerSearch, Typeahead and Tokenizer suites pass when run here (35 files, 1,237 tests). A pull request lands only when it and every pull request below it are approved, so #14159, #14163 and #14185 wait on #14170's fix. The heavy CI jobs are deferred at this head and must pass before merge.
Claims and files checked
Review mode: full; reason: rebase
- Rows that need no source show at once and source rows join below them, one call per distinct source after the hold: verified by the new sheet tests, run here.
- A stale answer for a superseded query is dropped, and the flow closing — the field turning disabled included — cancels the source: verified by the sheet tests; the same claim for a replaced source is false, as the finding above says.
- A row whose field a controlled config update removed stops listing: verified by the sheet test.
- No empty state while a source waits, the search busy, and the count announced once at settle inside Add filter: verified by the sheet tests.
- A value row adds one filter with focus and announcement on the new row; "More" rows open the value step with the text where the editor takes it, and an
enumorenum_listvalue lists in full: verified by the sheet tests. - A people field's "More" row opens the Tokenizer's own sheet on the text; its Save adds one filter, and an empty Save or a dismissal returns with the text kept: verified by the sheet tests.
- Enter commits the content-search row while a source is pending, a composing Enter commits nothing, Escape dismisses: verified by the sheet tests.
- The sheet's
bootstrapstarts no module load and the trigger's open handler starts it: verified by test and code. - Suite result (35 files, 1,237 tests), formatting, type check, lint, the import-boundaries check, the changeset check, the comment-provenance baseline and the knowledge check: verified, all run here.
- First-load size tables in the three descriptions: reported; an independent run here gives +201 B gzip for the whole stack on a PowerSearch page without the feature.
- Red-first runs stated in the descriptions: reported, not re-run here.
- #14163's and #14159's description and changeset claims (the opt-in's rows, bounds, folding, the 150 ms hold, the development warning, the opening query read once, no public change beyond the flag): verified against the code and their tests.
- #14185's record claims: verified against the record diff and the records at the tip of the default branch.
- Files: all 31 changed files visited, each clear apart from
PowerSearchBottomSheet.tsx.
f2e546c to
8588f9d
Compare
|
/approve-spec 8588f9d |
There was a problem hiding this comment.
Changes requested on #14170; the three pull requests below it keep their approvals, and the stack's combined diff raises nothing new.
#14170 — request changes
- Add filter's content search renders the answer stored when the query ran (
PowerSearchBottomSheet.tsx:1467-1486), filtered only by whether each row's field and operator keys still exist, so a controlled config update that renames a field, retitles an operator or adds a field leaves stale rows listed until the next keystroke: reproduced locally on this head and on #14185's head, where typing "gen" listsGenreandGenre is, and renaming Genre to Category leaves this head listing both while the base re-derives and lists neither; the smallest fix is to run the query again when the suggestion source changes and the typed query is non-empty, plus a sheet test that renames a field during a typed query.
Two notes you may want with that fix: the re-ask path added for a pending query keys on the derived source's identity, so a caller that rebuilds its config object on each render re-asks the same search source on every parent render (reproduced locally: four calls and three cancels for one typed query), which comparing the config's own searchSource objects would settle along with the staleness above; and the description's test tally (1,237) is one behind this head (1,238 pass here).
#14163 — approved (carried forward, head unchanged). No blocking finding.
#14159 — approved (carried forward, head unchanged). No blocking finding.
#14185 — approved (carried forward, head unchanged). No blocking finding.
Whole stack: pass. The combined diff is consistent: one public API delta (isValueOnlyMatchAllowed on the three operator types), the record text and the changesets agree across the four pull requests, and the first-load cost of a PowerSearch page that does not use the feature is +152 B gzip, inside the 0.3 KB allowance. A pull request lands only when it and every pull request below it are approved, so the stack waits on the fix at the top.
Claims and files checked
Review mode: full; reason: rebase
- Claim: the sheet lists value-only rows after the other suggestions, at most three per field, with a "More" row only when a field has more — verified (the new sheet cases, run here, and frames of the story in both trees).
- Claim: the list follows incremental results — rows that need no source at once, source rows below them after the 150 ms hold, one call per distinct source — verified (the shared-source case asserts a single call).
- Claim: while a query waits, the search is busy with no empty state, and the count is announced once at settle — verified (the pending case asserts one announcement in Add filter's dialog).
- Claim: a "More" row carries the typed text where the editor takes one, and an enum or enum_list value lists in full — verified (four cases).
- Claim: a people field's "More" row opens that operator's Tokenizer sheet directly, its Save adds one filter, and a dismissal or an empty Save returns with the text kept — verified (four cases).
- Claim: the stored answer is filtered through the current config, so an update that removes a field drops its rows — verified for removal; the rename and addition cases are the blocking finding above.
- Claim: the sheet's bootstrap starts no module load — verified (the source hook's new case).
- Claim: the record change moves FR18's and FR30's status cells — verified.
- Reported (not re-run here): the red-first run on the base, and the author's size figures; the size check run here agrees that both deltas pass.
- Files: the two changesets; the Storybook story; the PowerSearch record;
PowerSearch.tsx;PowerSearchBottomSheet.tsx;PowerSearchBottomSheet.test.tsx;powerSearchSheetUtils.ts;usePowerSearchSource.ts;usePowerSearchSource.test.ts— each clear exceptPowerSearchBottomSheet.tsx.
8588f9d to
f1f0b9f
Compare
|
/approve-spec f1f0b9f |
There was a problem hiding this comment.
Changes requested on #14170; the three pull requests below it keep their approvals, and the stack's combined diff raises nothing new.
#14170 — request changes
- When an app writes its config inline with a React element or a function (a field's
icon, an entity list'srenderItem), every parent re-render while a typed query is open in Add filter removes the source rows already shown, turns the search busy and asks the unchanged source again, becauseisSameConfigContentcompares elements and functions by identity (powerSearchSheetUtils.ts:132-161, re-run atPowerSearchBottomSheet.tsx:1130-1140), so the description's "a caller that rebuilds its config on each render asks no source again" is false and the one-call-per-source rule does not hold (reproduced locally with an inlineicon); please treat a rebuilt config with the same search sources and the same keys, labels, operators and values as unchanged, and add a sheet test that re-renders an inline config with aniconduring a settled and a pending query.
#14159 — approved (head unchanged since its approval)
#14163 — approved (head unchanged since its approval)
#14185 — approved (head unchanged since its approval)
Whole stack: pass; a pull request lands only when it and every pull request below it are approved, so the stack waits on the fix at the top.
Claims and files checked
Review mode: full; reason: rebase
- Claim: the sheet's Add filter lists value-only matches of opted-in operators after its other suggestions, at most three per field, with a "More" row only when a field has more — verified (the new sheet cases, run locally).
- Claim: rows that need no source show at once and a source's rows join below when it answers, after the 150 ms hold, one call per distinct source — false for a config written inline with a React element or a function: a parent re-render removes the shown source rows and calls the source again (local probe); verified for configs of plain values (shared-source and same-content tests).
- Claim: while a query waits on a source the search shows its loading indicator and no empty state, and the count is announced once at settle; a query that waits on no source announces none — verified (pending case; announcement only in the settle path).
- Claim: a stale answer is dropped and every close, including the field turning disabled, cancels a working source — verified (stale, replaced-source and disabled-close cases).
- Claim: a value row adds its filter to the draft, shows Filters with focus on the new row and speaks "Added …" — verified (value-row case; the same announcement path as other value suggestions).
- Claim: a "More" row opens the value step on the operator of the field's first row not listed and carries the typed text where the editor takes one; an enum or enum_list value lists in full — verified (five cases).
- Claim: a people field's "More" row opens the Tokenizer's own sheet already searching the text; Save adds one filter, and a dismissal, a confirmed discard or an empty Save returns with the text kept — verified (four cases).
- Claim: Enter commits the content-search row also while a source is pending, a composing Enter commits nothing, and Escape dismisses Add filter — verified (two cases).
- Claim: the sheet's bootstrap starts no module load and the trigger's opening handler starts it — verified (the source hook's new case and the opening handler).
- Claim: a controlled update that removes or renames a field drops or re-lists its rows — verified (two cases; retitling an operator and adding a field also checked locally).
- Claim: a new config object with the same content leaves the query as it is, so a caller that rebuilds its config on each render asks no source again — false: true only when the config holds no element or function written inline (local probe).
- Claim: the record change moves FR18's and FR30's status cells only — verified.
- Claim: no public API change beyond the operator option from the pull request below; patch changeset — verified (API comparison run locally).
- Reported: the red-first run on the base, the first-load figures (+20 B, +123 B; a local run gives +40 B and +155 B, both inside the allowance) and the test tally (36 files, 1,241 tests; 35 files, 1,240 tests here).
- Files: the sheet changeset — clear; the edited typeahead changeset — clear; the Storybook story — clear; the PowerSearch record — clear;
PowerSearch.tsx— clear;PowerSearchBottomSheet.tsx— finding;PowerSearchBottomSheet.test.tsx— clear;powerSearchSheetUtils.ts— finding;usePowerSearchSource.ts— clear;usePowerSearchSource.test.ts— clear.
f1f0b9f to
f171e30
Compare
|
/approve-spec f171e30 |
There was a problem hiding this comment.
Approved pending CI, on the top of this stack and on the three pull requests below it: the heavy CI jobs started after this review's verdict and have not finished on this head yet.
#14170 — approved
The inline-config fix holds: a config written inline with a new icon element or renderItem callback on each render keeps Add filter's shown rows and asks its source once (your new sheet case fails on the previous revision and passes here, reproduced locally). Non-blocking: the description's first-load figures (+20 B, +123 B) and test tally (36 files, 1,241 tests) differ from a local run (+35 B, +153 B; 35 files, 1,240 tests), all inside the 0.3 KB allowance.
#14159 — approved (head unchanged since its approval)
#14163 — approved (head unchanged since its approval)
#14185 — approved (head unchanged since its approval)
Whole stack: pass; a pull request lands only when it and every pull request below it are approved.
Claims and files checked
Review mode: full; reason: rebase
- Claim: Add filter's content search lists the value-only matches of opted-in operators after its other suggestions, fields that need no source first, then search-source fields, at most three per field, with a "More" row only when a field has more — verified (the new sheet cases, run locally).
- Claim: rows that need no source show at once, and a source's rows join below them when it answers, after the 150 ms hold, one call per distinct source; a stale answer is dropped and the flow closing cancels the query; a search-source field with no match lists no row — verified (pending, stale, shared-source, disabled-close and no-match cases).
- Claim: while a query waits on a source the search is busy with its loading indicator and no empty state, and the count is announced once at settle inside Add filter; a query that waits on no source announces none — verified (pending case; only the asynchronous settle path announces, from reading the code).
- Claim: a value row adds its filter to the draft, shows Filters with focus on the new row and speaks "Added …" — verified (value-row case; the same announcement path as other value suggestions).
- Claim: a "More" row opens the value step on the operator of the field's first row not listed and carries the typed text where the editor takes one; an enum or enum_list value lists in full — verified (six cases).
- Claim: a people field's "More" row opens the Tokenizer's own sheet already searching the text; Save adds one filter and shows Filters; an empty Save or a dismissal returns to Add filter with the text kept and focus on the search — verified (four cases; every sheet dismissal goes through one close handler; with the content search removed meanwhile focus lands on the first field row, and a field that turns disabled returns focus to the trigger, both probed locally).
- Claim: Enter commits the content-search row also while a source is pending, a composing Enter commits nothing, and Escape dismisses Add filter — verified (two cases).
- Claim: the sheet's bootstrap starts no module load and the trigger's opening handler starts it — verified (the source hook's new case and the opening handler).
- Claim: a controlled update that removes a field or operator drops its rows, and one whose content changes runs the query again on the new source — verified (removed-field, renamed-config and replaced-source cases).
- Claim: a rebuilt config that lists the same rows leaves the query as it is, search sources compared by identity and functions and elements ignored, so an inline config with icons and render callbacks asks no source again — verified (the new inline-config case, which fails on the previous revision, run locally).
- Claim: the spoken count at settle is the count of rows the list shows — verified (the settle path counts the listed rows).
- Claim: the record change moves FR18's and FR30's status cells only — verified (word diff).
- Claim: no public API change beyond the operator option from the pull request below; patch changeset — verified (API comparison run locally).
- Claim: both changesets describe the sheet and typeahead behavior as shipped — verified against the tests above.
- Reported: the red-first run on the base, the first-load figures (+20 B, +123 B; a local run gives +35 B and +153 B, both inside the allowance) and the test tally (36 files, 1,241 tests; 35 files, 1,240 tests here).
- Files: the sheet changeset — clear; the edited typeahead changeset — clear; the Storybook story — clear; the PowerSearch record — clear;
PowerSearch.tsx— clear;PowerSearchBottomSheet.tsx— clear;PowerSearchBottomSheet.test.tsx— clear;powerSearchSheetUtils.ts— clear;usePowerSearchSource.ts— clear;usePowerSearchSource.test.ts— clear.
|
/approve-spec f171e30 |
f171e30 to
ea01dc0
Compare
|
/approve-spec ea01dc0 |
There was a problem hiding this comment.
Approved pending CI, on this pull request and on the two below it in the stack: the heavy jobs (build, test, docsite-test) report "Heavy CI deferred" at this head and have not run yet.
#14163 — approved. The opt-in, the row planner and the deferred load match the current PowerSearch claims for value-only matches; the three added type members are optional and default to off.
#14185 — approved. Records only, and owner-approved for this exact head.
#14170 — approved. Add filter lists the opted-in rows in order, keeps the search busy with no empty state while a source works, speaks one count at settle, and opens a people field's own sheet on the typed text; reproduced here in the three suites and in a browser capture of the sheet story.
- Non-blocking: the description's numbers are stale — it reports +20 B gzip for this pull request and +123 B for the stack, where a run here gives +43 B and −1 B against
main(the opening-query change it counted has landed), and 36 files / 1,241 tests where the same suites give 35 / 1,240. Everything stays inside the 0.3 KB allowance; please refresh the figures before merge. - Non-blocking: Add filter lists the answer stored when the query ran, so a controlled update that changes
maxSearchResults,maxOperatorMenuItemsor the locale in the same render in which an inline config is rebuilt with the same rows keeps the shown rows and the old source until the next keystroke (PowerSearchBottomSheet.tsx:1183-1206, from reading the code).
Whole stack: pass. A pull request lands only when it and every pull request below it are approved.
Claims and files checked
Review mode: full; reason: rebase
- Claim: Add filter lists the value-only matches of opted-in operators after its other suggestions, fields that need no source first, then search-source fields, at most three per field, with a "More" row only when a field has more — verified (the two ordering cases of the new sheet suite, run here).
- Claim: the rows that need no source show at once and a source's rows join below them after the 150 ms hold, one call per distinct source; a stale answer is dropped; the flow closing cancels the query; a search-source field with no match lists no row — verified (the pending, stale, shared-source, replaced-source, disabled-close and no-match cases).
- Claim: while a query waits on a source the search is busy with its loading indicator and no empty state, and the count is announced once at settle; a query that waits on no source announces none — verified (the pending case, and a browser capture showing
aria-busyset with only the content-search row listed, then cleared with the source row joined). - Claim: a value row adds its filter to the draft, shows Filters with focus on the new row, and speaks "Added …" — verified (the value-row and people-Save cases).
- Claim: a "More" row opens the value step on the operator of the field's first row not listed and carries the typed text where the editor takes one; an enum or enum_list value lists in full — verified (six cases covering text, search-source, string_list, entity_list, enum and enum_list).
- Claim: a people field's "More" row opens the Tokenizer's own sheet above Add filter already searching the text, its Save adds one filter and shows Filters, and an empty Save or a dismissal returns with the text kept and focus on the search — verified (four cases).
- Claim: Enter commits the content-search row also while a source is pending, a composing Enter commits nothing, and Escape dismisses Add filter — verified (three cases).
- Claim: the sheet's bootstrap starts no module load, and the trigger's opening handler starts it — verified (the source hook's case and the opening handler).
- Claim: a controlled update that removes a field or operator drops its rows, one whose content changed runs the query again on the new source, and a rebuilt inline config with the same rows asks no source again — verified (the removed-field, renamed-config, replaced-source and inline-config cases).
- Claim: the record change moves FR18's and FR30's status cells only — verified (word diff against the pull request below).
- Claim: no public API beyond the operator option from the pull request below; patch changeset — verified (API surface comparison run here).
- Reported: the red-first run on the base, the first-load figures and the test tally (a run here gives +43 B for this increment, −1 B for the stack against
main, and 35 files / 1,240 tests). - Files, this pull request: the new changeset — clear; the edited typeahead changeset — clear; the Storybook story — clear; the PowerSearch record — clear;
PowerSearch.tsx— clear;PowerSearchBottomSheet.tsx— the stored-rows note above;PowerSearchBottomSheet.test.tsx— clear;powerSearchSheetUtils.ts— clear;usePowerSearchSource.ts— clear;usePowerSearchSource.test.ts— clear. - Files, #14163: the changeset, the story, the record, the comment-provenance baseline line, the locale catalog,
PowerSearch.doc.mjs,PowerSearch.tsx,PowerSearch.test.tsx,PowerSearchEditPopover.tsx,PowerSearchValueEditor.tsx,searchItemValues.ts,types.ts,usePowerSearchSource.ts,usePowerSearchSource.test.ts,valueOnlyMatchLoader.ts,valueOnlyMatches.ts— all clear. Files, #14185: the PowerSearch record — clear.
ea01dc0 to
be6650c
Compare
|
/approve-spec be6650c |
There was a problem hiding this comment.
Approved pending CI, on this pull request and on #14185 below it. Lint, typecheck and the smoke test pass at this head, but the heavy jobs (build, test, docsite-test) are deferred until review passes and have not run yet.
#14185 — approved. The change is records only, and an engineering owner approved its exact head.
#14170 — approved. Add filter lists the opted-in rows in order and keeps the search busy, with no empty state, while a source works. It speaks one count at settle and opens a people field's own sheet on the typed text. This was reproduced locally in the sheet suites and in a browser capture of the value-only story.
- Non-blocking: dismissing Add filter back to Filters does not end the content query, so a waiting search source keeps running until the next Add filter open or Done (
handleFieldsOpenChange,PowerSearchBottomSheet.tsx:2072-2084, reproduced locally). Ending the query there would match the typeahead, which cancels when its list closes. - Non-blocking: the description's figures are stale. A local run gives +39 B gzip from today's
main, +130 B counting #14159, and 35 files / 1,240 tests, where the description says +20 B, +123 B and 36 / 1,241. All are inside the 0.3 KB allowance.
Whole stack: pass. A pull request lands only when it and every pull request below it are approved.
Claims and files checked
Review mode: full; reason: rebase
- Claim: Add filter lists opted-in operators' value-only rows after its other suggestions. Fields that need no source come first, then search-source fields in config order, three per field, and a More row only past three. Verified by the ordering and no-match sheet tests, run here.
- Claim: rows that need no source show at once, and source rows join below after the same 150 ms hold, one call per distinct source. Verified by the pending and shared-source tests, the shared source path's timer (read in the code) and a browser capture.
- Claim: a stale answer is dropped, and the flow closing cancels the query, including when the field turns disabled. Verified by the stale-answer, replaced-source and disabled-close tests; the close Effect covers every close of the flow.
- Claim: a search-source field with no match lists no row, and no More row stands in for source rows. Verified by the no-match test.
- Claim: while a query waits on a source, the search is busy with its loading indicator, announces its busy start once and shows no empty state; the count is announced once, at settle, inside Add filter; a query that waits on no source announces no count. Verified by the pending test, TextInput's busy announcement and the capture; in the code, a list answer returns before any announcement.
- Claim: a value row adds its filter to the draft and shows Filters with focus on the new row, where "Added …" is spoken. Verified by the value-row test and the existing value-suggestion path, read in the code.
- Claim: a More row opens the value step on the operator of the field's first row not listed, and carries the text into a text field, a search-source typeahead or a list Tokenizer; enum and enum_list values list in full. Verified by six More-row tests.
- Claim: a people field's More row opens the Tokenizer's own sheet above Add filter, titled with the field and searching the text. Save adds one filter and shows Filters; an empty Save or a dismissal returns with the text kept and focus on the search. Verified by four people-field tests.
- Claim: Enter commits the content-search row, also while a source is pending; a composing Enter commits nothing; Escape dismisses Add filter. Verified by the key tests.
- Claim: the sheet's bootstrap starts no module load, and the opening handler starts it. Verified by the source-hook test and the opening handler's call.
- Claim: a controlled update that removes a field or operator drops its rows, and a changed config asks the new source again. An inline config with the same rows, icons and render callbacks included, asks no source again. Verified by the removed-field, renamed-config, replaced-source and inline-config tests; operator removal was read in the row filter.
- Claim: the count spoken at settle is the count of rows shown. Verified: both use the same row filter (read in the code).
- Claim: no public API beyond the earlier operator option, and a patch changeset. Verified by an API surface comparison run here, which lists no rows.
- Claim: this pull request's record change moves two status cells only, and #14185 changes records only. Verified by word diff.
- Reported: the red-first runs on the base, the first-load figures (+20 B; +123 B for the stack) and the test tally (36 files, 1,241 tests). Runs here give +39 B from today's main, +130 B from before the opening-query change, and 35 files, 1,240 tests.
- Files, #14170: the new changeset, clear; the edited typeahead changeset, clear; the story, clear; the PowerSearch record, clear; PowerSearch.tsx, clear; PowerSearchBottomSheet.tsx, the Add filter dismissal note; PowerSearchBottomSheet.test.tsx, clear; powerSearchSheetUtils.ts, clear; usePowerSearchSource.ts, clear; usePowerSearchSource.test.ts, clear.
- Files, #14185: the PowerSearch record, clear.
be6650c to
8eed499
Compare
|
/approve-spec 8eed499 |
There was a problem hiding this comment.
Approved pending CI: lint, typecheck, the Core and Storybook builds and the visual-regression job pass at this head, and the test jobs (test-ui, test-node) and browser checks are still running.
Add filter in the sheet now lists the opted-in value-only rows in order, keeps the search busy with no empty state while a source works, speaks one count when the query settles, and opens a people field's own sheet on the typed text. This was reproduced locally in the sheet suites and in a browser capture of the value-only story.
- Non-blocking: dismissing Add filter back to Filters does not end the content query, so a waiting search source keeps running until the next Add filter open or Done (
handleFieldsOpenChange,PowerSearchBottomSheet.tsx:2072-2084). Ending the query there would match the typeahead, which cancels when its list closes. - Non-blocking: the description's +20 B gzip and 36 files / 1,241 tests differ from a local run, which gives +35 B from
mainand 35 files / 1,240 tests (its +123 B for the whole feature matches the local +122 B); every figure is inside the 0.3 KB allowance.
Claims and files checked
Review mode: full; reason: rebase
- Claim (title, release note): the sheet's content search lists opted-in value-only rows after its other suggestions, fields that need no source first, then search-source fields, three per field, and a More row only when a field has more. Verified by the ordering and no-match sheet tests, run locally.
- Claim (release note, description): rows that need no source show at once, and source rows join below after the same 150 ms hold, one call per distinct source. Verified by the pending and shared-source tests, the shared module's timer (read in the code) and a browser capture.
- Claim (release note, description): while a source works the search is busy with its loading indicator and announces its busy start once, shows no empty state, and speaks one count at settle inside Add filter. Verified by the pending test, the text field's busy announcement (read in the code) and the capture.
- Claim (description): a query that waits on no source announces no count. Verified in the code: a list answer returns before any announcement.
- Claim (description): a stale answer is dropped, and every close of the flow cancels the query, including Done, a dismissal of the flow and the field turning disabled. Verified by the stale-answer and disabled-close tests, and in the code: Done and every dismissal of the flow go through the close handler that ends the query, and the close Effect follows the flow's open state.
- Claim (description): a search-source field with no match lists no row, and no More row stands in for source rows. Verified by the no-match test.
- Claim (description): a value row adds its filter to the draft and shows Filters with focus on the new row, where "Added …" is spoken. Verified by the value-row test, the capture and the existing value-suggestion path.
- Claim (release note, description): a More row opens the value step on the operator of the field's first row not listed and carries the text where the editor takes one; enum and enum_list values list in full. Verified by six More-row tests.
- Claim (release note, description): a people field's More row opens the Tokenizer's own sheet above Add filter, titled with the field and searching the text; Save adds one filter and shows Filters; an empty Save or a dismissal returns with the text kept and focus on the search. Verified by four people-field tests.
- Claim (description): Enter commits the content-search row, also while a source is pending; a composing Enter commits nothing; Escape dismisses Add filter. Verified by the key tests.
- Claim (description): the sheet's bootstrap starts no module load, and the trigger's opening handler starts it. Verified by the source-hook test and the handler's call.
- Claim (description): a controlled update that removes a field or operator drops its rows, a config whose content changes asks the new source again, and an inline config with the same rows, icons and render callbacks included, asks no source again. Verified by the removed-field, renamed-config, replaced-source and inline-config tests; operator removal read in the row filter.
- Claim (description): the count spoken at settle is the count of rows shown, and the people sheet stays mounted closed and remounts for each More press. Verified in the code.
- Claim (description): the same complete filters as the desktop typeahead. Verified: both presentations call one value-only source (read in the code).
- Claim (description, release note): no public API beyond the existing operator option, and a patch release note. Verified by an API surface comparison run locally, which lists no rows.
- Claim (typeahead release note edit): the sentence saying the sheet lists none of these rows is removed, which this change makes true; the rest describes the typeahead, whose suites pass locally. Verified.
- Claim (description): the record change only moves two status cells from their gaps to their evidence. Verified by a per-cell comparison.
- Reported: the red-first runs on the base, the first-load figures, the test tally and the local lint, typecheck and knowledge checks. A local run gives +35 B and +122 B and 35 files / 1,240 tests; CI's lint and typecheck pass at this head and its test jobs are running.
- Files: the new sheet release note, clear; the typeahead release note, clear; the story, clear; the PowerSearch record, clear; PowerSearch.tsx, clear; PowerSearchBottomSheet.tsx, the Add filter dismissal note, an inline-config refresh corner and two long comments (non-blocking); PowerSearchBottomSheet.test.tsx, clear; powerSearchSheetUtils.ts, clear; usePowerSearchSource.ts, clear; usePowerSearchSource.test.ts, clear.
| // A people sheet that closes without a Save that added a filter returns to | ||
| // Add filter, its text kept and its content search focused once the sheet | ||
| // has handed focus back. |
There was a problem hiding this comment.
Non-blocking (INV29): this description is one 31-word sentence with three topics. Suggested: "A people sheet that closes without adding a filter returns to Add filter. The typed text stays. The content search takes focus after the sheet hands focus back."
| // The people sheet's Save with at least one item adds one filter, as a | ||
| // suggestion that carries a value does, and closes Add filter with it. |
There was a problem hiding this comment.
Non-blocking (INV29): 26 words, over the 25-word limit for a description. Suggested: "A Save with items adds one filter and closes Add filter, as a value suggestion does."
This pull request is on main. The rest of the work is merged: #14159 (the package-internal opening query), #14163 (value-only matches in the typeahead) and #14185 (the record change this PR implements: the sheets' lists follow incremental search results).
User need
A person on a phone who types a value without its field ("fiction", "ada") gets the same complete filters from Add filter's content search that the same query gives in the desktop typeahead, including the matches only a search source finds (
Owner is any of Ada Lovelace). A people field with more matches than fit offers a direct path to its people search on the typed text.Problem and solution fit
component:PowerSearchFR30).spec:AST-092). The rows that need no source show at once. Search-source rows come from feat(PowerSearch): an operator opts into value-only matches in the typeahead #14163's source path (the same deferred module, the 150 ms hold, one call per distinct source) and join below the rows shown when the source answers (FR2). A stale answer is dropped, and the flow closing cancels the query (FR4). A search-source field with no match lists no row. No "More" row stands in for source rows.isLoading), and shows no empty state (FR5). The result count is announced once, at settle, inside Add filter (FR8). A query that waits on no source announces no count, as the sheet's other suggestions do not (AR7).enumorenum_listvalue lists in full.entity_listvalue with asearchSource. Its "More" row opens the Tokenizer's own sheet for that operator directly above Add filter, titled with the field label and already searching the text (FR15a, FR16,component:TokenizerFR16–FR27).Current specification
component:PowerSearchFR13, FR15a, FR16, FR18, FR28–FR30, AR7 as #14185 recorded them (merged);component:TokenizerFR31 andcomponent:BaseTypeaheadFR18 (merged in #14159);spec:AST-092FR2, FR4–FR8. This PR moves FR18's and FR30's status cells from the implementation gap to their evidence.Public delta and caller burden
None beyond #14163's
isValueOnlyMatchAllowed: the sheet presentation now honours it. Changeset:[feat]patch.Design and alternatives
createSheetSuggestionSource, which now passescontext.updateand promises through and keeps every partial and final list to the fields the config knows.presentation: 'sheet'option keepsbootstrapfree of the module load, because the sheet readsbootstrapduring render. The trigger's opening handler starts the load instead.architecture:react-component-runtimeINV2), with a request counter for staleness and the source'scancelfor superseded queries.TokenizerBottomSheet), which PowerSearch's deferred sheet chunk now renders directly, so its rows, selection, Save and discard confirmation are the Tokenizer's. Its first query is the typed text. It closes back to Add filter, stays mounted closed after its exit, and remounts for the next "More" press. Rendering the module directly keeps a sheet-at-mount path out of every Tokenizer's first load (INV10).isSameConfigContent: search sources by identity, functions and React elements ignored, the rest by content), so a caller that writes its config inline, icons and render callbacks included, asks no source again. The count spoken at settle is the count of rows the list shows.Evidence
Focused tests, failing on the base without the sheet changes.
PowerSearchBottomSheet.test.tsx"PowerSearch value-only matches in the sheet (FR18, FR30)":enum"More" row opens the full list, and a text field holds the text.stringsearch source's typeahead and astring_listTokenizer each open on the text, and anenum_listlists in full.entity_listoperator has no source takes the value step.usePowerSearchSource.test.ts: the sheet'sbootstrapstarts no load. Story: "Value-only matches (sheet)" inPowerSearch.stories.tsx.First-load size (
architecture:component-import-boundariesINV10)pnpm size:pages --base <#14185 head> --head <this head> --page powersearch=PowerSearch --unused-on powersearch(esbuild, minified / gzip bytes): the option is unused on every page. The value-only rows' code stays in the deferred module and the sheet's query runner in the sheet's deferred chunk; the eager part is the load call in the trigger's handler and the source'spresentationoption.PASS: the powersearch page grows +20 B gzip without the feature (INV10 limit: 307 B).Whole stack, measured from
mainto the top of the stack on a PowerSearch page that does not useisValueOnlyMatchAllowed:| powersearch (PowerSearch) | 994,250 / 328,970 | 997,053 / 329,093 | +2,803 / +123 |, which isPASS ... +123 B gzip without the feature (INV10 limit: 307 B). The engineering owner ruled that the opening-query wiring counts toward this allowance.Scope
Components: PowerSearch
Writing rubric results
Record touched:
component:PowerSearchFR18 and FR30 (status cells only).Testing
vitest run --project ui packages/core/src/PowerSearch/ packages/core/src/Typeahead/ packages/core/src/Tokenizer/: 36 files, 1,241 tests pass.tsc --noEmitfor core, eslint and Prettier on the changed files, the comment-provenance baseline check,pnpm check:knowledge,node scripts/check-changesets.mjs,pnpm review:pre,pnpm specs:for --diff. Two new Effects sync the content search's source: one with the flow's open state, which releases the waiting query on close or unmount, and one with a replaced source, which, when the config's content changed, ends the query on hand before paint and asks the new source for the same text.