Skip to content

feat(PowerSearch): an operator opts into value-only matches in the typeahead - #14163

Merged
imdreamrunner merged 1 commit into
mainfrom
feat/powersearch-value-only-matches
Dec 2, 2026
Merged

imdreamrunner merged 1 commit into
mainfrom
feat/powersearch-value-only-matches

Conversation

@imdreamrunner

@imdreamrunner imdreamrunner commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Stack: #14163 -> #14185 -> #14170

This pull request is the bottom of the stack, on main. It builds on the package-internal opening query that #14159 merged.

User need

A person who knows a value but not which field holds it ("fiction", "jane") gets nothing from PowerSearch today unless they type the field label first. An operator that opts in now answers the value alone with complete filters (Genre is Fiction, Owner is any of Jane Doe) after the field and field-and-operator rows, so the filter is one pick away. The option is off by default, per operator, because a value-only row is a product choice (it can send typed text to a search source).

Problem and solution fit

  • PowerSearchOperatorBase.isValueOnlyMatchAllowed (stable, optional, default off; component:PowerSearch DEC-8, "Public concepts").
  • valueOnlyMatches.ts plans which fields and opted-in operators answer a value-only query (FR27): a query that neither equals a visible field label nor starts with one plus a space; the field's isValueMatchAllowed: false and the length minimum (two characters, or typeaheadMinQueryLength) gate each field; string/string_list without a source add a free-text row (and string_list with isArbitraryStringAllowed); enum/enum_list match values by word start under the shared type-to-select fold (architecture:internationalization INV17), whole label first, then label start, then the rest; source operators add source rows; while the content-search row shows, the content field's default operator adds none.
  • usePowerSearchSource appends those rows after the capped typed rows (they never count toward maxSearchResults), field by field, no-source fields first, at most three per field, with a "More {field} matching '{text}'" row after a field's rows when it has more (FR29). With a search-source field, the rows that need no source list at once through context.update; after the text rests 150 ms each distinct source is asked once; a search-source field's rows append, all together, once its sources and every earlier search-source field's have settled; a rejecting source adds nothing; cancel drops the hold and cancels a working source (FR28). BaseTypeahead keeps the highlight, ids, busy state and the one count announcement (spec:AST-092 FR2, FR4–FR8, AR7).
  • Choosing a value row commits its filter like a field-prefixed value row. Choosing a "More" row opens the value editor of the first hidden row's operator: a text field holds the text as its value, and an editor that searches opens with it as its query through the opening query (merged in feat(Typeahead, Tokenizer): open on a package-internal opening query #14159); an enum Selector opens on its full list.
  • An opt-in under isValueMatchAllowed: false adds nothing, asks no source, and warns once in development, naming the field and the operator.
  • Row text comes from three new catalog messages (@astryx.powersearch.valueOnlyMatch.{text,value,more}), so a locale can reorder the parts (INV1a).
  • The value-only code (valueOnlyMatches.ts) loads through Core's shared module loader (createModuleLoader) on first intent (architecture:component-import-boundaries DEC-1): the field's focus, or a typed query, on a field whose config opts an operator in. A query typed while it loads lists its other rows at once and its value-only matches once it lands. A page whose config opts no operator in never loads it.
  • The sheet presentation's content search keeps its current suggestions: PowerSearch builds one source, for the presentation that renders, and only the typeahead's lists value-only matches. FR30 follows in the next PR.

Current specification

component:PowerSearch FR27–FR29, AR7, AV7, DEC-8 (current); component:BaseTypeahead FR1, FR3, FR5, FR18; spec:AST-092 FR2, FR4–FR8. This PR moves the FR27–FR29 status cells from "Implementation gap" to the evidence they now have.

Public delta and caller burden

  • Added: optional isValueOnlyMatchAllowed?: boolean on PowerSearchOperatorBase (so on every PowerSearchOperator). No other prop, type, default or export changes.
  • A config that sets it on no operator renders and announces exactly as before.
  • Caller decision: which operators answer a typed value, knowing that a search-source operator then receives the typed text.
{
  key: 'genre',
  label: 'Genre',
  operators: [
    {key: 'is', label: 'is', value: {type: 'enum', values: genres}, isValueOnlyMatchAllowed: true},
  ],
}

Changeset: [feat] patch (spec:AST-017 FR5; DEC-8).

Design and alternatives

DEC-8 records the decision and its rejected alternatives (a config-level switch, a second operator prop, grouped headings, a silent cap). Implementation choices:

  • Deferred load rather than a separate import: DEC-8 makes the option an operator boolean, so architecture:component-import-boundaries INV7's own-import route does not fit; INV10's other route, a load on first intent, keeps an unused option within the 0.3 KB allowance (numbers below).
  • The 150 ms hold lives in PowerSearch's source, as spec:AST-092 leaves a delayed remote request to its source; the main field's debounce stays zero, so field rows and no-source rows show at once.
  • A source row commits through searchItemValues.ts, the helpers the string, string_list and entity_list value editors now call for a picked item (the photo round-trip included), so a row commits what its editor would store.
  • PowerSearch's source cancels only sources it started and that are still working, so two operators sharing one source make one call and never cancel each other.
  • The opening query reaches only the editor of the field and operator the "More" row opened, not one the person switches to, and not a caller's components.Editor.

Evidence

Focused unit tests, failing on the base without the source changes:

  • usePowerSearchSource.test.ts "value-only matches": before the module loads, a config with no opt-in loads nothing, focus (the bootstrap) starts the load, a query typed meanwhile lists its other rows at once and its value-only matches once the module lands, and a query superseded while it loads is dropped; no opt-in; free-text and enum rows with whole-label and label-start ranking; no mid-word match; case, accents, stroked letters and Turkish İ; no label-led query in any case; the two-character default and typeaheadMinQueryLength above and below two; isValueMatchAllowed: false (no row, no source call); three rows then a More row with its operator and text; maxSearchResults 2 with three contributing fields; content-search row first and the content field's free-text row gone; with deferred sources: no-source rows at once, one call per shared source after 150 ms, entity, string and string_list values; config order kept when two source fields answer out of order; a rejecting source; a superseded query (no call before the hold, a working source cancelled); maxOperatorMenuItems; a string source operator with isArbitraryStringAllowed (source rows only).
  • PowerSearch.test.tsx "value-only matches": the rendered flat listbox (no group), the first row highlighted through aria-activedescendant, appended rows keeping its id, one count announced after the source settles counting the More row; a chosen value row committing one filter, clearing the text and closing the list; Enter on the content search while a source is pending, and a composing Enter choosing nothing; Escape keeping the text with a pending answer not reopening the list; a More row reached by the arrow keys opening the entity Tokenizer on the text; an enum More row opening the Selector with no query; an enum_list More row opening its Tokenizer searching the text; a reordering locale message; the development warning once, with no source call; one source call for a word typed within 150 ms while the other rows show at once.
  • Story: "Value-only matches" in PowerSearch.stories.tsx (a slow people source shows rows appending).

First-load size (architecture:component-import-boundaries INV10)

pnpm size:pages --base <#14159 head, now on main> --head <this head> --page powersearch=PowerSearch --unused-on powersearch (esbuild, minified / gzip bytes): the option is unused on every page.

Page (components) Base Head Change
docs (Text, Heading, Link, Card, Divider, List) 243,514 / 80,659 243,514 / 80,659 +0 / +0
form (Button, IconButton, TextInput, CheckboxInput, Text, Heading, Card) 330,393 / 111,777 330,393 / 111,777 +0 / +0
menu (DropdownMenu, ContextMenu, Button, Text) 403,296 / 138,308 403,296 / 138,308 +0 / +0
table (Table, Text, Button) 373,470 / 127,132 373,470 / 127,132 +0 / +0
powersearch (PowerSearch) 994,564 / 329,122 997,151 / 329,073 +2,587 / −49

PASS: the powersearch page grows −49 B gzip without the feature (INV10 limit: 307 B). The split point adds first-load chunks, which is where the minified bytes go; with the value-only module bundled eagerly the same page grew +1,893 B gzip.

Whole stack, measured from main to the top of the stack on a PowerSearch page that does not use isValueOnlyMatchAllowed: | powersearch (PowerSearch) | 994,250 / 328,970 | 997,053 / 329,093 | +2,803 / +123 |, which is PASS ... +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

  • One capability is added.
  • Unrelated fixes, cleanup, and policy changes were removed or split.
  • Consumer docs, focused tests, and migration evidence ship with the feature. (PowerSearch.doc.mjs example, the type's JSDoc, a story; no migration: the option is new and off.)
  • Public text and artifacts contain no internal Meta context.

Writing rubric results

Record touched: component:PowerSearch FR27–FR29 (status cells only).

  • R1 narration: none; each cell now names its evidence.
  • R2 research in the record: none.
  • R3 evidence naming a change: none; the cells name test files, not this PR.
  • R4 rejected alternatives over one line or outside a decision: none.
  • R5 pull request or issue references remaining: none.
  • R6 ruled open questions still listing options: none.
  • R7 project status (build status or work order): the three "Implementation gap" notes are removed now that the behavior ships; FR30's stays until the sheet path ships.

Testing

  • vitest run --project ui packages/core/src/PowerSearch/ packages/core/src/i18n/ packages/core/src/Typeahead/ packages/core/src/Tokenizer/
  • tsc --noEmit for core, eslint and Prettier on the changed files, node scripts/check-i18n-catalog.mjs, node scripts/generate-i18n-runtime.mjs --check, pnpm check:knowledge, node scripts/check-changesets.mjs, pnpm review:pre (no findings), pnpm specs:for --diff (no concern-routed claim).

@vercel

vercel Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Dec 2, 2026 8:15pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Dec 1, 2026
@astracat-bot

astracat-bot Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Dec 2, 2026, 8:09 PM UTC

@imdreamrunner
imdreamrunner force-pushed the feat/typeahead-opening-query branch from e0e5ac1 to 6743a90 Compare December 1, 2026 19:22
@imdreamrunner
imdreamrunner force-pushed the feat/powersearch-value-only-matches branch from bb5b99e to 7a8f794 Compare December 1, 2026 19:22
@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec 7a8f794

…peahead

An operator's new isValueOnlyMatchAllowed suggests its complete filters
for a typed value with no field label before it (component:PowerSearch
FR27-FR29, AR7, DEC-8). Typing "fiction" offers "Genre is Fiction"
after the field and field-and-operator rows.

- Free-text rows for string and string_list operators without a source,
  enum and enum_list values by word start under the shared fold, and
  the items of an operator's search source.
- At most three rows per field from two characters (or the field's
  typeaheadMinQueryLength), then a "More {field} matching '{text}'"
  row that opens the value editor on the text through the opening
  query. None counts toward maxSearchResults.
- Each distinct source is asked once per query after the text rests
  150 ms; its field's rows append in config order once it settles, and
  a superseded query cancels the hold and any working source.
- A field's isValueMatchAllowed: false turns these rows off, and an
  opt-in under it warns once in development.
- The value-only code loads on first intent (the field's focus or a
  typed query) on a field whose config opts an operator in, so a page
  that opts none in pays for its wiring alone; a query typed while it
  loads lists its other rows at once.
- The sheet presentation's content search keeps its suggestions.

The FR27-FR29 status cells move from the implementation gap to their
evidence.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested. The feature itself reads clean against the current PowerSearch requirements — the option, the row planning, the 150 ms source hold and the "More" row match FR27–FR29, AR7 and DEC-8 — but two things need your attention before it can be approved.

  • The changeset, the PowerSearch.doc.mjs example and the new story all say the "More {field} matching '{text}'" row "opens its value editor on the typed text"; for an enum operator the editor is a Selector that opens on its full list with the text dropped, as FR29 requires and as your own test "opens an enum field More row on the Selector, with no query" asserts, so please bound that sentence in .changeset/powersearch-value-only-matches.md:5, packages/core/src/PowerSearch/PowerSearch.doc.mjs:218 and apps/storybook/stories/PowerSearch.stories.tsx:1677 the way your pull-request description already does.
  • architecture:component-import-boundaries INV10 asks a pull request that adds an optional feature to report the first-load gzip delta on a page that renders the component without it, and valueOnlyMatches.ts is imported unconditionally by PowerSearch.tsx and usePowerSearchSource.ts, so please report the base-against-head number for a page that renders PowerSearch with no operator opted in; if it is over 0.3 KB, the feature takes INV7's own-import route or a deferred load (DEC-1).

Two non-blocking notes: PowerSearch now builds a second typeahead source for the sheet on every render while only one of the two is ever used, and two of the added comments run past INV29's one-topic, short-sentence rule.

Claims and files checked

Review mode: full; reason: no-earlier-review

Claims:

  • A new optional operator flag suggests that operator's complete filters for a typed value alone — verified (types.ts:299; unit test "lists a free-text row and enum rows by word start, whole label first, after the other rows").
  • A string or string_list operator with no source offers the typed text, and a string operator with a source offers only source rows — verified (valueOnlyMatches.ts:194-204; unit test "gives a string search-source operator only source rows, even with isArbitraryStringAllowed").
  • enum and enum_list values match by word start, ignoring case and accents, whole label first — verified (shared type-to-select fold; unit test "folds case, accents, stroked letters and Turkish İ when matching").
  • Each distinct source is asked once per query, once the text has rested 150 ms, and its rows append below the others — verified (unit test "shows the rows that need no source at once and asks each source once after 150 ms"; "appends source fields in config order whatever order they answer in").
  • A field shows at most three rows, from two characters or its typeaheadMinQueryLength — verified (unit tests "needs two characters, or the field typeaheadMinQueryLength" and "shows at most three rows per field…").
  • The "More" row opens that field's value editor on the typed text — false for an enum operator (first finding above).
  • Value-only rows and "More" rows do not count toward maxSearchResults — verified (unit test of the same name).
  • The option is off by default, so a config that opts no operator in keeps every list as it is — verified (usePowerSearchSource.ts:241; unit test "lists nothing more for an operator that does not opt in").
  • A field's isValueMatchAllowed: false turns the rows off, and an opt-in under it warns once in development — verified (component test "warns once in development…"; unit test "adds nothing, and asks no source…").
  • The sheet presentation's content search does not list them — verified (the sheet keeps a source built without the option, PowerSearch.tsx:644 and :1759).
  • Only the one optional boolean is added to the public surface — verified (the package's PowerSearch and PowerSearch/utils entry points export neither the aux-data type nor the edit popover).
  • The record change touches the FR27–FR29 status cells only — verified (row-by-row comparison with the base; no requirement text differs).
  • The new unit tests fail on the base without the source changes — reported; not run in this review and no CI job ran at this revision.
  • The listed local commands (unit tests, typecheck, lint, the i18n catalog checks, review:pre, specs:for --diff) passed — reported.

Files:

  • .changeset/powersearch-value-only-matches.md — first finding.
  • packages/core/src/PowerSearch/PowerSearch.doc.mjs — first finding.
  • apps/storybook/stories/PowerSearch.stories.tsx — first finding; the story config and its slow source are otherwise clear.
  • packages/core/src/PowerSearch/valueOnlyMatches.ts — clear.
  • packages/core/src/PowerSearch/usePowerSearchSource.ts — clear; one comment note.
  • packages/core/src/PowerSearch/PowerSearch.tsx — clear; the duplicate source and one comment note.
  • packages/core/src/PowerSearch/PowerSearchEditPopover.tsx — clear.
  • packages/core/src/PowerSearch/types.ts — clear.
  • packages/core/locales/en.json — clear.
  • docs/specs/components/PowerSearch/PowerSearch.spec.md — clear.
  • packages/core/src/PowerSearch/usePowerSearchSource.test.ts — clear.
  • packages/core/src/PowerSearch/PowerSearch.test.tsx — clear.

Automated review (maintainer link)

@imdreamrunner
imdreamrunner force-pushed the feat/powersearch-value-only-matches branch from 7a8f794 to a09a7de Compare December 1, 2026 19:54
@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec a09a7de

@imdreamrunner
imdreamrunner force-pushed the feat/typeahead-opening-query branch from 6743a90 to d58d40a Compare December 1, 2026 20:13
@imdreamrunner
imdreamrunner force-pushed the feat/powersearch-value-only-matches branch from a09a7de to e6c5795 Compare December 1, 2026 20:13
@imdreamrunner
imdreamrunner changed the base branch from feat/typeahead-opening-query to main December 1, 2026 20:13
@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec e6c5795

@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Dec 1, 2026
@imdreamrunner
imdreamrunner force-pushed the feat/powersearch-value-only-matches branch from e6c5795 to cc833fb Compare December 1, 2026 20:30
@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec cc833fb

@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 3544bb1

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
PowerSearch · Storybook 326.7 kB (+142 B) · 27.8 kB CSS (0) 7,906 (+602) ✓ · ✓ · ✓
Tokenizer · Storybook 118.4 kB (+133 B) · 22.4 kB CSS (0) 2,691 (+11) ✓ · ✓ · ✓
BaseTypeahead 88.2 kB (+97 B) · 12.3 kB CSS (0) — ✓ · ✓ · ✓
2 more components
Component Size LoC Visual · A11y · RTL
Typeahead 99.7 kB (+94 B) · 14.8 kB CSS (0) — ✓ · ✓ · ✓
TypeaheadItem 6.7 kB (0) · 3.6 kB CSS (0) — ✓ · ✓ · ✓

Package size: @astryxdesign/core 8.16 MB packed (+17.4 kB); no new dependencies.

API changes: core +3 · ~0 · −0

3 API changes (advisory)
Package Where Signature Usage
+ core . · Types · interface PowerSearchOperatorBase isValueOnlyMatchAllowed?: boolean = false import type {PowerSearchOperatorBase} from '@astryxdesign/core'; const x: PowerSearchOperatorBase = {isValueOnlyMatchAllowed: …}
+ core . · Types · interface PowerSearchOperatorWithI18nKey isValueOnlyMatchAllowed?: boolean = false import type {PowerSearchOperatorWithI18nKey} from '@astryxdesign/core'; const x: PowerSearchOperatorWithI18nKey = {isValueOnlyMatchAllowed: …}
+ core . · Types · interface PowerSearchOperatorWithLabel isValueOnlyMatchAllowed?: boolean = false import type {PowerSearchOperatorWithLabel} from '@astryxdesign/core'; const x: PowerSearchOperatorWithLabel = {isValueOnlyMatchAllowed: …}

Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested.

  • Miss: sourceItemValue in packages/core/src/PowerSearch/valueOnlyMatches.ts:252-271 copies what each value editor stores for a picked item: PowerSearchValueEditor.tsx:182 for string, :269 for string_list, and :929-941 for entity_list, including the photo round-trip. A later change to what an editor stores would silently miss value-only rows, which must commit exactly that value. Please move the per-type conversion into one PowerSearch helper that the three editors and sourceItemValue all call.

The duplicated module loader from the last round is fixed: the value-only module now loads through createModuleLoader. Everything else checks out against the PowerSearch requirements. The 30 new value-only tests and the PowerSearch, Typeahead and Tokenizer suites pass when run locally, while CI's heavy jobs are deferred at this head. The first-load size measured locally is −64 B gzip on a PowerSearch page that does not use the option. This pull request sits on #14159 in its stack, so it lands only after that one is approved as well.

Claims and files checked

Review mode: full; reason: history

Claims checked against the code:

  • A new optional operator flag, off by default, suggests complete filters for a typed value alone, after the field and field-and-operator rows: verified (types.ts:290-299, valueOnlyMatches.ts:144-246; tests "lists a free-text row and enum rows by word start…" and "keeps the field and field-and-operator rows first").
  • A string or string_list operator without a source offers the typed text, an enum or enum_list operator offers values with a word that starts with the text, ignoring case and accents, whole-label matches first, and a source operator offers the source's items: verified (valueOnlyMatches.ts:103-132, 185-214; the ranking, fold, mid-word and search-source tests).
  • A query counts as value-only when it neither equals a field label nor starts with one plus a space: verified (valueOnlyMatches.ts:86-94; test "answers no label-led query, in any case").
  • Each distinct source is asked once per query, after the text rests 150 ms, and its rows append below the others in config order; a rejecting source adds nothing; a superseded query cancels a working source; two operators sharing a source make one call: verified (valueOnlyMatches.ts:416-502; the five search-source tests and "asks a source once for a word typed within 150 ms…").
  • At most three rows per field from two characters, or the field's minimum, then a "More" row: verified (valueOnlyMatches.ts:159-167, 335-352; tests "needs two characters…" and "shows at most three rows per field…").
  • The "More" row opens the field's editor: a text field holds the text as its value, an editor that searches opens on it, and an enum Selector opens on its full list: verified (PowerSearch.tsx:1051-1068; the three "More" row tests, plus a local check of a text field's "More" row).
  • The opening query reaches only the editor of the field and operator the "More" row opened, and never a custom Editor override: verified (PowerSearchEditPopover.tsx:739-746, PowerSearch.tsx:1410-1423).
  • Value-only rows do not count toward maxSearchResults: verified (usePowerSearchSource.ts:237; test "does not count value-only rows toward maxSearchResults").
  • The content field's default operator adds no row while the content-search row shows: verified (valueOnlyMatches.ts:154-158, 174-179; test "keeps the content-search row first…").
  • Highlight, row ids, busy state and one count announcement are kept: verified (test "lists the rows that need no source at once, then the source field…").
  • Choosing a value row commits its filter like a field-prefixed row: verified (PowerSearch.tsx:1040-1047; test "commits a chosen value row as one filter…").
  • A field that turns value matches off gets no value-only rows and asks no source, and an opt-in under it warns once in development, naming the field and operator: verified (valueOnlyMatches.ts:161-167, PowerSearch.tsx:639-652; both tests).
  • Row text comes from three catalog messages a locale can reorder: verified (en.json; test "reads each row as one catalog message a locale can reorder").
  • The value-only code loads through the shared module loader on focus or a typed query. A query typed meanwhile lists its other rows at once. A config with no opt-in never loads it: verified (valueOnlyMatchLoader.ts:16-44, usePowerSearchSource.ts:237-279; the four "before the module loads" tests).
  • A config with no opt-in lists and announces exactly as before: verified (usePowerSearchSource.ts:237-240 returns the unchanged rows).
  • The sheet presentation's content search does not list value-only rows: verified (PowerSearch.tsx:673-687 gives the sheet's source no value-only options, and only PowerSearch's own two modules import the value-only code).
  • The only public change is the optional flag on the operator base type: verified (API surface generator run locally: the flag on the base type and the two operator types that extend it, nothing else).
  • The record changes only the three status cells: verified (cell-by-cell compare with the main branch).
  • The release note is a feature patch: verified against the PowerSearch record's release class for this option.
  • First-load size table, −102 B gzip on the PowerSearch page: reported; measured locally at −64 B gzip, under the 0.3 KB limit.
  • The new tests fail on the base without the source changes: reported.
  • Typecheck, lint, formatting, i18n, knowledge and changeset checks: reported; CI's lint and typecheck pass at this head.

Files visited in this pull request's own increment (13):

  • packages/core/src/PowerSearch/valueOnlyMatches.ts: the finding above.
  • packages/core/src/PowerSearch/valueOnlyMatchLoader.ts: clear; the earlier loader finding is fixed.
  • packages/core/src/PowerSearch/usePowerSearchSource.ts: clear.
  • packages/core/src/PowerSearch/PowerSearch.tsx: clear.
  • packages/core/src/PowerSearch/PowerSearchEditPopover.tsx: clear.
  • packages/core/src/PowerSearch/types.ts: clear.
  • packages/core/src/PowerSearch/PowerSearch.test.tsx: clear.
  • packages/core/src/PowerSearch/usePowerSearchSource.test.ts: clear.
  • packages/core/src/PowerSearch/PowerSearch.doc.mjs: clear.
  • apps/storybook/stories/PowerSearch.stories.tsx: clear.
  • packages/core/locales/en.json: clear.
  • .changeset/powersearch-value-only-matches.md: clear.
  • docs/specs/components/PowerSearch/PowerSearch.spec.md: clear; three status cells, no requirement text changed.

Automated review (maintainer link)

@imdreamrunner
imdreamrunner force-pushed the feat/powersearch-value-only-matches branch from 111a645 to 113fc7d Compare December 1, 2026 23:31
@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec 113fc7d

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: the heavy checks (test-node, test-ui, test-build, typecheck, docsite-build, build-storybook) are still running on this head, with no failure so far, so this is not ready to merge yet. No blocking findings remain — the copied item-to-value conversion from the last review is fixed, now that the string, string_list and entity_list editors and the value-only rows all commit through searchItemValues.ts. As part of a stack, this pull request lands only once #14159 below it is approved too.

  • Non-blocking: DEFAULT_MAX_OPERATOR_MENU_ITEMS = 10 (PowerSearch.tsx:138) and VALUE_ONLY_SOURCE_DELAY_MS = 150 (valueOnlyMatches.ts:54) restate the value editors' own maxMenuItems and debounceMs, which FR28 ties together; one shared constant per pair would keep them in step if an editor's bound or delay changes.
  • Non-blocking: the first-load table in the description reports −102 B gzip for the PowerSearch page; measured here on this head with pnpm size:pages it is −34 B (+2,619 B minified), the same pass against the 0.3 KB limit, so the numbers in the table are worth refreshing.
Claims and files checked

Review mode: full; reason: history

Claims (title, description, changesets):

  • Title: an operator opts into value-only matches in the typeahead — verified; the sheet presentation gets the source without the option (PowerSearch.tsx:675-684).
  • The option is off by default, per operator — verified; the planner acts only on === true (valueOnlyMatches.ts:176), and types.ts:299 makes it optional.
  • A value-only query is one that neither equals a visible field label nor starts with one plus a space — verified by isValueOnlyQuery (valueOnlyMatches.ts:91-99) and the "answers no label-led query, in any case" test.
  • isValueMatchAllowed: false and the two-character or typeaheadMinQueryLength minimum gate each field — verified by valueOnlyMatches.ts:167-174 and two tests.
  • string and string_list without a source add a free-text row, and string_list with isArbitraryStringAllowed as well — verified (valueOnlyMatches.ts:190-200) and asserted in the search-source case.
  • enum and enum_list values match by word start under the shared fold, whole label first — verified by matchEnumValues (:108-139) over foldForTypeahead, with the accents, stroked-letter and Turkish dotted-i test.
  • While the content-search row shows, the content field's default operator adds none — verified by :179-184 and its test.
  • Source operators add source rows — verified by the five "search sources" cases.
  • Rows append after the capped typed rows and never count toward maxSearchResults — verified; the cap is applied first (usePowerSearchSource.ts:237), and the three-field test with a cap of two lists every value-only row.
  • At most three rows per field, then a "More {field} matching '{text}'" row — verified (valueOnlyMatches.ts:338-353) and asserted with its operator and text.
  • Each distinct source is asked once, 150 ms after the text rests; shared sources are one call — verified with fake timers (one call at 150 ms, none at 149 ms).
  • A search-source field's rows append once its sources and every earlier one settle, in config order — verified by the out-of-order answer test.
  • A rejecting source adds nothing and removes nothing shown — verified.
  • Cancel drops the hold and cancels a working source — verified; only sources still working are cancelled (valueOnlyMatches.ts:488-499).
  • The highlight, its id, the busy state and one count announcement survive appended rows — verified by the first PowerSearch.test.tsx case, which keeps the active option's id and announces "6 results" once.
  • Choosing a value row commits one filter, clears the text and closes the list — verified.
  • A "More" row opens the first hidden row's operator: a text field holds the text as its value, a searching editor as its query, an enum Selector on its full list — verified by three tests plus a probe run here for the text field.
  • An opt-in under isValueMatchAllowed: false adds nothing, asks no source and warns once in development, naming the field and the operator — verified.
  • Three new catalog messages let a locale reorder the parts — verified by the reordering-override test and the catalog checks.
  • The value-only code loads through Core's shared module loader on first intent, and a page that opts no operator in never loads it — verified by valueOnlyMatchLoader.ts:28-44 and the four "before the module loads" cases.
  • The sheet presentation's content search is unchanged and FR30 follows later — verified; the record's FR30 gap note is untouched.
  • Only one public member is added, with no other prop, type, default or export change — verified by the API generator run here: three rows, all the same new member on the operator base and its two variants.
  • The changeset's sentence that an editor which searches opens on the typed text, with an enum field's editor on its full list — verified; it matches the tests.
  • Record touched: FR27–FR29 status cells only — verified by a cell-by-cell comparison with the current record; the requirement and authority cells are identical.
  • First-load size table — reported; measured here as −34 B gzip rather than −102 B, with the same pass.
  • The new tests fail on the base without the source changes — reported; not re-run on the base here.
  • The listed test, lint, typecheck and knowledge commands — reported; the PowerSearch, Typeahead, Tokenizer and i18n suites (1,354 tests), the changeset check and both i18n checks were run here and pass.

Files (this pull request's own increment, 16 of 16 read):

  • packages/core/src/PowerSearch/valueOnlyMatches.ts — clear.
  • packages/core/src/PowerSearch/valueOnlyMatchLoader.ts — clear.
  • packages/core/src/PowerSearch/searchItemValues.ts — clear; it is what fixes the earlier finding.
  • packages/core/src/PowerSearch/usePowerSearchSource.ts — clear.
  • packages/core/src/PowerSearch/PowerSearch.tsx — non-blocking note on the restated menu-item default.
  • packages/core/src/PowerSearch/PowerSearchEditPopover.tsx — clear.
  • packages/core/src/PowerSearch/PowerSearchValueEditor.tsx — clear.
  • packages/core/src/PowerSearch/types.ts — clear.
  • packages/core/src/PowerSearch/PowerSearch.test.tsx — clear.
  • packages/core/src/PowerSearch/usePowerSearchSource.test.ts — clear.
  • packages/core/src/PowerSearch/PowerSearch.doc.mjs — clear; the earlier wording findings are fixed.
  • apps/storybook/stories/PowerSearch.stories.tsx — clear; the story's values do produce the rows its comment names.
  • packages/core/locales/en.json — clear.
  • .changeset/powersearch-value-only-matches.md — clear.
  • docs/specs/components/PowerSearch/PowerSearch.spec.md — clear; status cells only, approved on this head.
  • internal/eslint-plugin-astryx/no-comment-provenance.baseline.json — clear; the removed entry follows the editor comment that moved.

Automated review (maintainer link)

@imdreamrunner
imdreamrunner force-pushed the feat/powersearch-value-only-matches branch from 113fc7d to 2a1d5e1 Compare December 2, 2026 00:11
@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec 2a1d5e1

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request is reviewed as part of its stack; see the review on #14170.

Automated review (maintainer link)

@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec 62a1687

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request is reviewed as part of its stack; see the review on #14170.

Automated review (maintainer link)

@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec e9badf2

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request is reviewed as part of its stack; see the review on #14170.

Automated review (maintainer link)

@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec 3544bb1

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request is reviewed as part of its stack; see the review on #14170.

Automated review (maintainer link)

@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec 3544bb1

@imdreamrunner
imdreamrunner force-pushed the feat/powersearch-value-only-matches branch from 3544bb1 to 5b6d962 Compare December 2, 2026 19:57
@imdreamrunner

Copy link
Copy Markdown
Contributor Author

/approve-spec 5b6d962

@github-actions github-actions Bot removed the needs:design-review Affects visuals — Design should review label Dec 2, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request is reviewed as part of its stack; see the review on #14170.

Automated review (maintainer link)

@imdreamrunner
imdreamrunner merged commit 9064cbb into main Dec 2, 2026
150 of 153 checks passed
@github-actions
github-actions Bot deleted the feat/powersearch-value-only-matches branch December 3, 2026 06:09

This branch was successfully deployed

1 active deployment
Preview — 5b6d962e Deployed Dec 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant