Skip to content

feat(Typeahead): show local matches at once and append server results (spec:AST-092) - #7962

Merged
cixzhang merged 18 commits into
mainfrom
feat/typeahead-incremental-results
Nov 1, 2026
Merged

cixzhang merged 18 commits into
mainfrom
feat/typeahead-incremental-results

Conversation

@cixzhang

@cixzhang cixzhang commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Implements spec:AST-092 (incremental search results).

User need

People picking from a typeahead backed by a server wait for the debounce plus the round trip before they see anything, even when the page already holds most of the matches. A source can now show what it already has the moment they type and add the server's answer below it, without rows moving under the pointer or the highlight.

Problem and solution fit

  • SearchSource.search(query, context?): a source calls context.update(items) to show a list before it settles; the return value stays the final list.
  • BaseTypeahead shows the latest list for the current query, keeps the highlighted item and its option id across later lists, keeps the popup on its side of the field (holds its height above, grows only within the room below), stays busy until the query settles, and announces the count once. Highlight indexes now follow displayed (grouped) order, so Enter picks the row that is highlighted.
  • One reflow per keystroke: after the first list for a query, a list that moves, removes, or inserts above shown rows is shown as given with a development warning (the source owns merging).
  • Tokenizer forwards partial lists with committed values removed, and shows its create row only once a searched query settles.

Current specification

spec:AST-092 FR1–FR10, DEC-1–DEC-3.

Consistency edit: layer-runtime INV11

spec:AST-092 FR6 and architecture:layer-runtime INV11 are both current. FR6 is the later and more specific owner-approved decision, so it governs. INV11 gains one clause after "no size is capped to the span beside the trigger": a later list for the same query keeps an open Typeahead popup on its side and grows it only within the room there (spec:AST-092 FR6), while the first list for a query places it normally. Its verification row names the evidence and the failure signal for that exception.

Public delta and caller burden

  • New optional second parameter on SearchSource.search, new exported type SearchContext. No new props.
  • Option ids now follow the item id within a query instead of the row index (FR7).
  • A source that shows local matches first pairs with debounceMs={0} and delays its own server request; cancel() still runs before every new search.
const people: SearchSource<Person> = {
  bootstrap: () => directory.recent(),
  cancel: () => server.abort(),
  async search(query, context) {
    const local = directory.match(query);
    context?.update(local);
    const found = await server.search(query, {afterMs: 150});
    return appendNew(local, found);
  },
};

Design and alternatives

As decided in the spec: the source merges (DEC-1); partial lists arrive through a per-call context so every caller that awaits an array keeps working (DEC-2); later lists only append (DEC-3).

Evidence

  • BaseTypeahead.incremental.test.tsx: partial then final, highlight and option id kept, Enter on the kept item, one announcement, stale lists dropped, update after settle ignored, empty update, failure after non-empty and after only empty updates, dev warning (list and displayed/grouped order), first-list replacement without a warning, fresher data in place, popup above the field holds its height, popup below grows only within the room below, rejection after the popup closes announces nothing and keeps only this query's rows, held height released when the query ends.
  • Tokenizer.test.tsx: committed values removed from partial lists; create row only after settle.
  • Stories with plays (real Chromium in CI): Incremental results (local rows at once while busy, server rows appended, highlight kept, Enter selects) and Incremental results above the field (popup opens above; shown rows keep their screen position as server rows append).
  • Three more stories with plays, added to the CI story play guard: Incremental results in a scrolled list (the scroll offset and shown rows stay put while server rows append), Incremental results below the field, outgrowing the room (the popup stays below, inside the viewport, with the first row in place), and Incremental results under a resting pointer (rows that arrive under a still pointer don't take the highlight, and Enter picks the highlighted row). All five Typeahead plays pass in Chrome.
  • Rebased on main (a merge commit): option hover now uses onMouseMove, so a resting pointer no longer takes the highlight; the busy announcement (spec:AST-086 FR8) and the replaced-source ArrowDown path (spec:AST-092 FR4) are kept, and three existing assertions now expect the search context argument.
  • Existing Typeahead, Tokenizer, PowerSearch, CommandPalette and Chat suites pass unchanged except three assertions that now see the context argument.

Writing rubric results

This branch carries the spec:AST-092 record from its spec pull request until that merges; the record's results are reported there and repeated here.

  • R1 narration: none remaining; comparative phrases were rewritten in the present tense.
  • R2 research in the record: none.
  • R3 evidence naming a change: none; verification names test layers and states.
  • R4 rejected alternatives over one line or outside a decision: three, one line each, inside DEC-1, DEC-2 and DEC-3.
  • R5 pull request or issue references remaining: none.
  • R6 ruled open questions still listing options: none; no open questions.

Scope

  • 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.
  • Public text and artifacts contain no internal Meta context.

Testing

pnpm vitest run packages/core/src/Typeahead packages/core/src/Tokenizer packages/core/src/PowerSearch packages/core/src/CommandPalette packages/core/src/Chat; story play runs in CI.

@vercel

vercel Bot commented Oct 23, 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 Oct 31, 2026 11:16pm UTC

Request Review

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

astracat-bot Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 1, 2026, 2:18 AM UTC

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Oct 23, 2026
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 4b95367

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC
Typeahead 65.6 kB (+1.1 kB) · 11.6 kB CSS (+17 B) —
PowerSearch 172.9 kB (+1.1 kB) · 20.3 kB CSS (0) —
Tokenizer · Storybook 72.7 kB (+1.1 kB) · 16.9 kB CSS (0) 1,963 (+10)
6 more components
Component Size LoC
lab/MobilePowerSearch 159.2 kB (+1.0 kB) · 1.2 kB CSS (0) —
BaseTypeahead 57.9 kB (+1017 B) · 10.2 kB CSS (+17 B) —
TypeaheadItem 6.3 kB (0) · 3.6 kB CSS (0) —
lab/CommentComposer 97.2 kB (0) · 1.9 kB CSS (0) —
lab/Comments 224.8 kB (0) · 2.5 kB CSS (0) —
lab/CommentThread 220.2 kB (0) · 2.4 kB CSS (0) —

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

Not run on this PR: add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.


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.

This pull request is on hold until an engineering owner approves spec:AST-092 for the current head: the spec-owner-approval check is still pending, and the record's own approved_by field is not that approval, so the owner needs to settle FR1–FR10 and DEC-1–DEC-3, including item-keyed option ids (FR7) and keeping partial results when the server fails (FR9). Whatever that decision, these need fixing before merge:

  • The popup height held for a later list is cleared only by the next query's first list (BaseTypeahead.tsx:849), so after a selection or a cleared field the bootstrap list opens at the old height with two of eight rows visible; reset it wherever a query ends.
  • The description needs the ## Writing rubric results section that a pull request adding a knowledge record reports.
  • The incremental stories' cancel() clears the timer without settling the promise, so pressing Escape leaves the field busy; reject or resolve the pending search there.

[Automated review]

: displayOrder(shownRows)[0]?.id;
holdPopupInPlace();
} else {
setHeldHeight(null);

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 is the only place heldHeight is cleared, so a hold set for one query survives a selection, a cleared field and the bootstrap list. With hasEntriesOnFocus, clearing the field after a held query opens the eight-row bootstrap list in a 72 px popup. Consider resetting it wherever a query stops being current (handleSelect, the short-query branch of handleQueryChange, applyBootstrapResults, handleLayerHide), with a test that clears the field after a held list.

let pendingDirectoryRequest: ReturnType<typeof setTimeout> | null = null;
const incrementalPeopleSource: SearchSource = {
bootstrap: () => localPeople,
cancel() {

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.

cancel() clears the timer, so the promise search returned never settles. Pressing Escape over the local rows calls cancel(), and the field stays busy until the next keystroke. Rejecting the pending promise here (or resolving it with local) lets the query settle the way FR9 expects.

@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 on hold until an engineering owner approves spec:AST-092 for the current head: the spec-owner-approval check is still pending, and the owner also needs to settle whether FR6's rule that a popup below the field grows only within the room below it amends the layer runtime's rule that no layer size is capped to the space beside its trigger, or whether FR6 changes. Whatever that decision, two fixes are needed before merge:

  • Every later list re-runs the highlighted-row scroll (useHighlightedOptionScroll, fed by BaseTypeahead.tsx:1314-1335), so a partial list someone has scrolled jumps back to its first row when the server rows arrive; skip that scroll when the highlighted item is unchanged and add a browser check that scrolls a partial list.
  • Unmounting while a partial list shows lets the cancelled search announce "2 results" after the field is gone; end the search generation in the unmount cleanup before calling cancel().

[Automated review]

(index: number) => `${listboxId}-option-${index}`,
[listboxId],
(index: number) => optionIds[index] ?? `${listboxId}-option-${index}`,
[optionIds, listboxId],

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.

getItemId changes identity with every list, and useHighlightedOptionScroll re-runs scrollIntoView({block: 'nearest'}) when getOptionId or itemCount changes. So each later list for the same query scrolls the popup back to the highlighted row: in Chromium a partial list scrolled to 200 px jumped to 4 px when two server rows appended, which moves the rows under a touch or scrollbar user. Consider skipping the scroll when the highlighted item is unchanged (for example keying it on the highlighted option id, which FR7 keeps stable), with a browser check that scrolls a partial list before the final list lands.

} else if (shownRows != null) {
// A failed server answer keeps the last non-empty list the source
// showed for this query, which settles it.
announceCount(showList(shownRows, true).length);

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.

The unmount cleanup (prevSearchSourceRef.current.cancel?.(), around line 1347) cancels without bumping searchGenRef, and the popup-close marker is not set on unmount. A source whose cancel() rejects then lands here and announces "2 results" after the field is gone; Chromium shows it in the polite region. Bumping the generation in the unmount cleanup before cancel() would drop it, as FR4 describes for unmount.

Comment on lines +596 to +610
// Below the field, grow only within the room below, so the layer runtime
// never flips the popup above the field.
const layer = dropdown.closest<HTMLElement>('[popover]') ?? dropdown;
const layerBox = layer.getBoundingClientRect();
const gutter = parseFloat(getComputedStyle(layer).marginBlockEnd) || 0;
const viewportHeight = window.visualViewport?.height ?? window.innerHeight;
const room =
viewportHeight -
box.top -
Math.max(0, layerBox.bottom - box.bottom) -
gutter;
setHeldHeight(
current =>
current ?? Math.min(DROPDOWN_MAX_HEIGHT, Math.max(box.height, room)),
);

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 caps the listbox to the room below the field, measured here from the viewport, the listbox top and the layer gutter. architecture:layer-runtime INV11 says "no consumer defines its own, no size is capped to the span beside the trigger", and AST-092 does not amend it, so either the layer runtime record changes for this hold or FR6's below-field clause and this branch do.

…ter, scroll keyed to the list, mounted flag; slow-bootstrap, unmount and StrictMode tests

@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 on hold until an engineering owner approves spec:AST-092 for the current head: the spec-owner-approval check is still pending, and the owner also needs to settle whether FR6's rule that a popup below the field grows only within the room below it amends the layer runtime's rule that no layer size is capped to the space beside its trigger, or whether FR6 changes. Whatever that decision, these need fixing before merge:

  • In a grouped Tokenizer with hasCreate, the create row is appended in source order but displayed above the groups, so the rows a partial list showed move down a row when the query settles (BaseTypeahead.tsx:835-837); displaying query entries after the groups, with a test for that state, would fix it.
  • The lint check fails on BaseTypeahead.incremental.test.tsx:517 (promise-function-async, cleared by declaring that bootstrap arrow async), and the two new stories are not listed in the CI story play guard, so their play assertions never run.

[Automated review]

Comment on lines +835 to +837
const shown = isFinal
? [...fetched, ...(__queryEntries?.(searchQuery, fetched) ?? [])]
: fetched;

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.

The create row is appended in source order here, but the popup displays ungrouped rows first (displayOrder), so with grouped results it renders above the group and every row a partial list showed moves down a row when the query settles; in Chromium, Benita Ruiz moves from 144 to 176 px. The append check at :819-821 compares only the source rows, so no development warning fires either. Displaying query entries after every group would keep FR1's create row after the rows; a test that settles a grouped list with hasCreate after a partial list would cover it.

Comment on lines +600 to +614
// Below the field, grow only within the room below, so the layer runtime
// never flips the popup above the field.
const layer = dropdown.closest<HTMLElement>('[popover]') ?? dropdown;
const layerBox = layer.getBoundingClientRect();
const gutter = parseFloat(getComputedStyle(layer).marginBlockEnd) || 0;
const viewportHeight = window.visualViewport?.height ?? window.innerHeight;
const room =
viewportHeight -
box.top -
Math.max(0, layerBox.bottom - box.bottom) -
gutter;
setHeldHeight(
current =>
current ?? Math.min(DROPDOWN_MAX_HEIGHT, Math.max(box.height, room)),
);

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 caps the listbox to the room below the field (viewport height, listbox top, layer padding and the layer's gutter): in Chromium an eight-row final list stays below at max-height: 138px, where the layer runtime flips it above at its full height. architecture:layer-runtime INV11 says "no size is capped to the span beside the trigger", and AST-092 neither cites nor amends it, so either that record changes for this hold or FR6's below-field clause and this branch go.

const {source, latest} = createPendingSource({
ben: [benOrtiz, benitaRuiz],
});
source.bootstrap = () =>

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.

CI's lint job fails here with @typescript-eslint/promise-function-async ("Functions that return promises must be async"); declaring this arrow async clears it.

@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 on hold until an engineering owner approves spec:AST-092 for the current head: the spec-owner-approval check is still pending, and the owner also needs to settle whether FR6's rule that a popup below the field grows only within the room below it amends the layer runtime's rule that no layer size is capped to the space beside its trigger, or whether FR6 changes. Whatever that decision, these need fixing before merge:

  • Unless that layer-runtime rule is amended, the below-field cap in holdPopupInPlace (BaseTypeahead.tsx:620-634) has to go: it holds a seven-row list to the 158 px below a low field where the layer runtime would show it above at full height.
  • The Changeset says existing sources are unchanged; it should name the two changes every source sees, item-keyed option ids and a grouped Tokenizer's create row moving after the groups.

The grouped create-row reflow, the lint error and the missing story play guard entries from the previous review are fixed, and the three failing CI checks come from MobilePowerSearch on main, not from this change.

[Automated review]

Comment on lines +620 to +634
// Below the field, grow only within the room below, so the layer runtime
// never flips the popup above the field.
const layer = dropdown.closest<HTMLElement>('[popover]') ?? dropdown;
const layerBox = layer.getBoundingClientRect();
const gutter = parseFloat(getComputedStyle(layer).marginBlockEnd) || 0;
const viewportHeight = window.visualViewport?.height ?? window.innerHeight;
const room =
viewportHeight -
box.top -
Math.max(0, layerBox.bottom - box.bottom) -
gutter;
setHeldHeight(
current =>
current ?? Math.min(DROPDOWN_MAX_HEIGHT, Math.max(box.height, room)),
);

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 caps the listbox to the room below the field (viewport height minus the listbox top, the layer padding and its gutter), so a final list that does not fit stays below and scrolls: in Chromium a seven-row list under a low field is held at max-height: 158px, where the layer runtime places it above the field at its full 232 px. architecture:layer-runtime INV11 says "no size is capped to the span beside the trigger", and AST-092 neither cites nor amends it, so either that record changes for this hold or FR6's below-field clause and this branch go.

'@astryxdesign/core': patch
---

[feat] A `SearchSource` can show results before its search settles. `search(query, context)` may call `context.update(items)` (new exported type `SearchContext`) to show matches it already has, such as people the page loaded earlier, and then return the server's answer. `BaseTypeahead`, `Typeahead` and `Tokenizer` show each list for the current query, change the list at most once per keystroke, and add later rows only after the ones already shown, so the highlighted row never moves; the field stays busy and the result count is announced once, when the search settles. A later list that moves or removes shown rows is shown as given with a development warning. Existing sources are unchanged. To show local matches at once, pass `debounceMs={0}` and delay the server request inside the source (`spec:AST-092`).

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.

"Existing sources are unchanged" reads as no change for current callers, but two changes reach every source here: option ids follow the item id instead of the row index, and a grouped Tokenizer with hasCreate shows its create row after the groups instead of first. Naming both keeps the Changeset an accurate compatibility note.

@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 change can't be approved yet: spec:AST-092 is now current on main, but its FR6 rule that a popup below the field grows only within the room below it conflicts with the layer runtime's current INV11 (no layer size is capped to the space beside its trigger), so an engineering owner needs to amend one of those two records before the below-field cap can stand or go. Whatever that decision, two things need fixing:

  • A row appended under a resting mouse pointer takes the highlight, so Enter can select a person the user never aimed at (FR6); rebasing onto main, which uses onMouseMove for option hover, fixes it, and the branch needs that rebase anyway because it conflicts with main.
  • AST-092's verification asks for real-browser checks of a scrolled partial list and of a list below the field that outgrows the room below, so please add story plays for those and for the resting-pointer case.

[Automated review]

Comment on lines +620 to +634
// Below the field, grow only within the room below, so the layer runtime
// never flips the popup above the field.
const layer = dropdown.closest<HTMLElement>('[popover]') ?? dropdown;
const layerBox = layer.getBoundingClientRect();
const gutter = parseFloat(getComputedStyle(layer).marginBlockEnd) || 0;
const viewportHeight = window.visualViewport?.height ?? window.innerHeight;
const room =
viewportHeight -
box.top -
Math.max(0, layerBox.bottom - box.bottom) -
gutter;
setHeldHeight(
current =>
current ?? Math.min(DROPDOWN_MAX_HEIGHT, Math.max(box.height, room)),
);

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 caps the listbox to the room below the field, which current AST-092 FR6 asks for and current layer-runtime INV11 rules out (“no consumer defines its own, no size is capped to the span beside the trigger”). In Chromium a seven-row list under a low field stays below at max-height: 198px where the layer runtime would flip it above at 232 px. One of the two records needs an engineering owner's amendment before this branch can stay or go.

(index: number) => highlightedOptionId ?? `${listboxId}-option-${index}`,
[highlightedOptionId, listboxId],
);
const highlightOnHover = useHighlightedOptionScroll({

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.

highlightOnHover is still wired to each option's onMouseEnter (line 1512), so a row appended under a resting pointer takes the highlight: in Chromium, Ben Ortiz is highlighted while pending, Bento Silva takes it when the server rows land, and Enter selects Bento Silva (FR6). main switched this handler to onMouseMove; keeping that when resolving the conflict with main fixes it.

…en Typeahead popup; story plays for a scrolled list, a below-field overflow and a resting pointer

@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 can't be approved yet: the head adds an exception to current architecture:layer-runtime INV11 so a Typeahead's later list can stay below the field, and an engineering owner needs to record that decision by commenting /approve-spec <full head SHA> on the corrected head (the author can do this if they are an engineering owner), or ask for spec:AST-092 FR6's below-field clause to change instead. Two fixes are needed either way:

  • The merge with main reverted #9182, #9183 and #9198 in .github/REVIEW_GATE.md, docs/architecture/interaction-modality.md, docs/architecture/knowledge-contracts.md, docs/architecture/public-component-api.md and docs/specs/AST-030/spec.md (it deletes public-component-api INV23); please restore main's versions, since an approval binds the head's whole spec content.
  • The FR9 failure path (BaseTypeahead.tsx:970-973) announces the count without dropping a pending busy start, so a source that fails a few milliseconds after a partial list leaves the live region reading “2 results Loading”; calling settleBusyAnnouncement() there, as the settle path does, with a test, fixes it.

[Automated review]

`useTouchTrigger`, `useTableRowExpansion`, and `useTableColumnResize`. A hook
whose current signature cannot delegate gains a ref-taking signature beside
it; the old signature is deprecated under INV9.
- **INV23 — Each private data attribute has one owner module.** A

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.

The merge with main dropped #9182 here: this deletes current INV23 with its verification row and gap list. The same merge reverts #9183 in interaction-modality.md and #9198 in AST-030/spec.md, knowledge-contracts.md and REVIEW_GATE.md. Restoring main's versions of those five files keeps the diff to the Typeahead work.

} else if (shownRows != null) {
// A failed server answer keeps the last non-empty list the source
// showed for this query, which settles it.
announceCount(showList(shownRows, true).length);

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 announces the count without settleBusyAnnouncement(), which the settle path calls at line 951. A source that shows a partial list and fails about 5 ms after the busy start leaves the polite region reading “2 results Loading”, against spec:AST-086 FR8. Calling settleBusyAnnouncement() first (when searchQuery.length > 0), with a test for a fast rejection, fixes it.

Comment on lines +469 to +472
beside the trigger, except that a later list for the same query keeps an open
Typeahead popup on its side and grows it only within the room there
(`spec:AST-092` FR6); the first list for a query places it normally, and a
consumer minimum is clamped by the runtime's cap.

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 adds a new exception to current INV11. It needs an engineering owner's /approve-spec on the head once the merge reversions are restored, or AST-092 FR6's below-field clause changes instead.

@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 can't be approved yet: the head adds an exception to the current architecture:layer-runtime INV11 rule so that a Typeahead's later list stays below the field and grows only within the room there (spec:AST-092 FR6), and that new clause needs an engineering owner's decision. An engineering owner records it by commenting /approve-spec <full head SHA> on this pull request (the author can do this as an engineering owner), or asks for FR6's below-field clause to change instead. The earlier record reversions and the failure-path busy announcement are fixed, and nothing else needs to change.

[Automated review]

Comment on lines +469 to +472
beside the trigger, except that a later list for the same query keeps an open
Typeahead popup on its side and grows it only within the room there
(`spec:AST-092` FR6); the first list for a query places it normally, and a
consumer minimum is clamped by the runtime's cap.

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 adds a new exception to current INV11, which licenses the below-field cap in BaseTypeahead.tsx (holdPopupInPlace). It needs an engineering owner's /approve-spec <full head SHA> on this head, or AST-092 FR6's below-field clause changes instead.

@cixzhang

cixzhang commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 4b95367

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 1, 2026
@cixzhang
cixzhang marked this pull request as ready for review November 1, 2026 00:34

@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 is ready to approve: it implements spec:AST-092, the architecture:layer-runtime INV11 exception has an engineering owner's approval on this head, and the Typeahead, Tokenizer, PowerSearch, CommandPalette and Chat suites and the five new story plays pass. Optional follow-up: add regression tests for a new query's first list releasing a held popup height and for maxMenuItems capping a partial list, two states the INV11 and AST-092 verification rows name that no committed test covers yet.

[Automated review]

const previous = shownState;
const previousEntryCount = shownEntryCount;
if (previous == null) {
setHeldHeight(null);

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.

Optional: nothing in BaseTypeahead.incremental.test.tsx fails if this release is removed (all 22 tests stay green), although INV11's new verification row names a first list that stays capped as a failure signal. A test that holds the height for one query (as the above-field test does) and then types a second query with its own first list would pin it.

@cixzhang
cixzhang merged commit a03bffd into main Nov 1, 2026
94 checks passed
@github-actions
github-actions Bot deleted the feat/typeahead-incremental-results branch November 1, 2026 06:05

This branch was successfully deployed

1 active deployment
Preview — 4b95367d Deployed Oct 31, 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