Skip to content

fix(app-shell): the command palette matches navigation entries on word prefixes and substrings (objectui#11812) - #11883

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-11812-palette-nav-match
Oct 8, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-11812-palette-nav-match

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #11812

Clause-②: no

What changes

The ⌘K palette's navigation groups (Objects, Dashboards, Pages, Reports, Switch App) and its theme and full-search commands were matched by cmdk's default subsequence scorer: CommandDialog mounts cmdk's Command with no filter, so every item goes through commandScore. The palette now matches those entries itself and renders only the matches.

  • One module-private matcher, matchesPaletteQuery in packages/app-shell/src/chrome/paletteMatch.ts (not re-exported). An entry matches when the query, ignoring case, starts a word of its label or machine name (field finds "Field Zoo", zoo finds showcase_field_zoo), or, from three characters on, is a contiguous substring of one of them (view finds "Task Overview"). A hyphen and a space read alike, which is cmdk's own normalisation. No typo tolerance.
  • Han, Hiragana and Katakana are written without spaces, so each of their characters starts a word: 大屏 and 屏 both find "Command Center (大屏)" (Zone 2 item 4, pinned).
  • CommandPalette filters each navigation group, the app list, the three theme commands and the full-search command through it, and renders a group, with its separator, only when something in it matched.
  • No cmdk value changes. Each rendered entry carries its label and name in its value, so the trimmed query is a contiguous run of that value and cmdk's scorer, which still ranks what is rendered and decides when CommandEmpty shows, accepts every entry the palette rendered. "No results" now shows exactly when no entry matched and the record search found nothing.
  • Record hits are untouched: the same item, value (the query embedded), group and order.

The mechanism, measured (Zone 2 item 1: confirmed)

cmdk 1.1.1's commandScore, run on the showcase entries' values:

query value score
zzzz object Field Zoo showcase_field_zoo 9.900e-3
zzzz page New Project (Wizard) showcase_new_project_wizard 9.900e-3
ingest object In-Progress Tasks showcase_task 2.305e-2
ingest object Cascading Select showcase_cascade 2.853e-3
ingest page Page Authoring showcase_start_here 2.271e-2
ingest page Styling (ADR-0065) showcase_styling_gallery 2.246e-2
wayne page Styling (ADR-0065) showcase_styling_gallery 1.386e-4

These are exactly the false hits the card's QA pass read, so the scorer alone explains them. zzzz scores above zero because the scorer may skip a query letter that repeats the next one (a 0.1 factor each time), so the two zs of "Field Zoo ... zoo" absorb four.

Route taken (Zone 2 item 2)

  • Taken: the palette matches, and renders only the matches, inside CommandPalette.tsx. Neither forceMount nor a query carried in the value was needed, because every entry the matcher accepts already scores above zero in cmdk. forceMount was read in cmdk 1.1.1's source and set aside: a force-mounted item that cmdk scores 0 is rendered but not counted in filtered.count, so "No results" could show beside it.
  • Not taken: composing Dialog and Command from @object-ui/components with a filter. Both are exported, but that copies CommandDialog's composition (the visually-hidden title and description of ADR-0054 C4, the cmdk class string) out of the Shadcn-synced ui/command.tsx into app-shell, and a filter sees only a value string, so record hits would need a kind marker in their value to stay exempt. A filter passthrough on CommandDialog would be a new prop on a published component (a Clause-② stop) in ui/** (AGENTS.md rule 7). CommandDialog is not edited; the overlay:command-palette test id and the accessible name are untouched (pinned by the empty-query control).

Theme and full-search commands (Zone 2 item 3: they follow the rule)

They are matched by the same rule over the words they were already matched by (theme light, theme dark, theme system, search all results full page). Under the old scorer scattered letters reached them too: hsy scored 1.515e-1 on theme system, tht 1.686e-1 on theme light.

Behaviour changes a reviewer should know

  • Initials no longer match. fz found "Field Zoo" and sap found the full-search command (8.003e-1) through scattered word starts; neither is a word prefix or a substring, so neither matches now. This is the card's Expected.
  • The group's type word no longer matches. object, page, dashboard, report and app stay at the head of each cmdk value but are not a matching term: page now finds "Page Authoring" and "Page Variables", not every page. Matching is on what the entry is called, its label and machine name, per the triage direction.

Real-browser reading (Chromium 141, 1440×900)

The console's Vite dev server served a temporary probe page, deleted afterwards and never committed, that mounts the real CommandPaletteProvider (opened by ?palette=1) and the real CommandPalette under I18nProvider in en, over the showcase app's whole navigation (its 50 leaf entries, read from objectstack examples/app-showcase, ShowcaseApp.navigation), with a searchAll stub holding three records (Ingest pipeline, Wayne Enterprises, 华宁科技). Queries were typed key by key. Before is CommandPalette.tsx at this branch's base 5d69133; after is a76ebb5.

query before after
zzzz Objects: Field Zoo · Pages: New Project (Wizard) "No results found."
ingest Task: Ingest pipeline · Objects: In-Progress Tasks, Cascading Select · Pages: Page Authoring, Styling (ADR-0065) Task: Ingest pipeline
wayne Account: Wayne Enterprises · Pages: Styling (ADR-0065) Account: Wayne Enterprises
field Objects: Field Zoo Objects: Field Zoo
大屏 Pages: Command Center (大屏) Pages: Command Center (大屏)

No page errors in either run. The showcase backend was not booted: the sister objectstack checkout is not built in this container, so the record hits come from the stub.

Tests (at a76ebb5)

  • paletteMatch.test.ts (new, 13 cases): the seven scattered pairs from the card do not match; word prefixes of the label and of the machine name match at any length; a mid-word substring matches from three characters on and not before; phrases, hyphen and space, case; Han and kana substrings; blank query and missing terms.
  • CommandPalette.navMatch-11812.test.tsx (new, 7 cases), through the real CommandPaletteProvider and cmdk: zzzz shows no entry and "No results found." once the record search settles; ingest shows its record hit and only the entry whose machine name contains it; wayne shows Wayne Enterprises and no page; field, view, 大屏 and 屏 each show their entry; apps, theme and full-search commands follow the rule. Controls: the record hit's item is the one the palette always rendered (record wayne Wayne Enterprises Account showcase_account a1), and an empty query shows every entry, app and command.
  • The existing palette suites (CommandPalette.navLabelInherits-9868, CommandPalette.searchLabelFls-10500) pass unchanged: no cmdk value moved.

Ablation (direction: red, as expected)

node scripts/ablation-replace.mjs (objectstack's tool, run from this worktree) replaced the matches helper with one that accepts every entry (anchor 1 → 0, blob 77b858975656 → 0168da5f2e1f), so cmdk's default scorer decides again, and ran the DOM suite: 5 failed, 2 passed. The five pins went red with the card's own readings (zzzz: ['Field Zoo', 'New Project (Wizard)']; ingest: In-Progress Tasks, Cascading Select, Page Authoring and Styling (ADR-0065) beside Replay Queue; wayne: Styling (ADR-0065)); the two controls stayed green. Restore: blob back to 77b858975656 = HEAD, git diff HEAD empty, marker count 0. The suite imports ./CommandPalette from source, so no dist sat between the mutation and the run.

Gates (all at a76ebb5)

command exit verdict line
pnpm exec vitest run packages/app-shell/ 0 Test Files 1097 passed, 1 skipped (1098) · Tests 10803 passed, 9 skipped
pnpm --filter @object-ui/app-shell type-check (script name echoed; tsconfig.test.json lists all four touched files) 0 tsc --noEmit && tsc -p tsconfig.test.json
pnpm --filter @object-ui/app-shell build 0 dist completeness: 1 package(s) complete
pnpm exec eslint on the 4 touched files 0 0 errors; 13 warnings, all in CommandPalette.tsx, rule-for-rule the same 13 as on base 5d69133
pnpm check:control-bytes 0 OK
pnpm check:test-path-roots 0 OK
pnpm check:changeset-claims 0 No pending changeset names a file this change touches
pnpm check:pending-changeset-literals 0 No test source names a pending changeset
pnpm check:new-line-citations 0 0 new citation(s)
pnpm check:i18n-keys 0 Every in-scope call-site key resolves against the en pack
pnpm check:vi-mock-specifiers · check:vi-mock-inherit · check:vi-mock-override-shape 0 OK
pnpm check:unreferenced-sources · check:self-import · check:phantom-deps · check:esm-specifiers 0 OK
node scripts/check-changeset-presence.mjs · check-changeset-no-major.mjs 0 1 changeset declared; no major

The eslint run is a narrowing, not the repo-wide pnpm lint (CI's): eslint's own config globs **/*.{ts,tsx} cover all four files; its --format json output lists 4 files, none ignored; and eslint.config.js enables no type-aware linting (no projectService or parserOptions.project), so this diff cannot move the verdict of a file it does not touch. Locale packs and package exports are unchanged, so the i18n pack gates and check:readme-exports do not apply. NOT MEASURED locally: check:node-esm-load (its load leg builds the tree), left to CI.

The public surface is unchanged: the built dist/index.d.ts and dist/chrome/index.d.ts do not reach paletteMatch.d.ts; no export, prop, type member or language-pack key is added. Patch changeset: .changeset/11812-palette-nav-match.md.

main has moved to 04c8f56 since the base; none of those commits touches packages/app-shell/src/chrome/, ui/command.tsx, useRecordSearch or CommandPaletteProvider, and git merge-tree against it is clean, so the branch was not merged.

Acceptance notes

  • The theme commands are matched by their English words in every locale, as before: a zh viewer typing 主题 finds none of them, because their translated labels were never in their values. Unchanged here; noted, not filed. Carrier: none.
  • The record search (useRecordSearch, the server call) and the ?palette=1 deep link are untouched, per the triage ruling.

Session: https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8 (dispatched by the domain:ui seat 3 PM).


Generated by Claude Code

claude added 2 commits October 8, 2026 03:06
…d prefixes and substrings

The navigation groups (objects, dashboards, pages, reports, apps) and the
theme and full-search commands went through cmdk's default subsequence
scorer, so "zzzz" listed Field Zoo and a nonsense query never reached
"No results". The palette now matches them itself with a module-private
matcher (a word prefix, or a contiguous substring from three characters on,
of the label or machine name; every Han or kana character starts a word)
and renders only the matches. Record hits are unchanged.

Claude-Session: https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 333 chunks) 3352.6 KB 3363.9 KB
Main entry chunk (gzip) 71.0 KB 350 KB
Entry file index-BRaHdwz8.js —
Status PASS —

The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it.


📦 Bundle Size Report

Package Size Gzipped
app-shell (consoleActionDispatch.js) 0.20KB 0.19KB
app-shell (index.js) 17.82KB 6.58KB
app-shell (runtime-config.js) 22.59KB 7.89KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 10.11KB 3.87KB
auth (ActiveOrganizationStorage.js) 27.95KB 10.04KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 2.07KB 1.00KB
auth (AuthProvider.js) 40.22KB 10.61KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.15KB 5.40KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.72KB 2.24KB
auth (SocialSignInButtons.js) 9.70KB 3.93KB
auth (UserMenu.js) 3.39KB 1.21KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 40.70KB 10.94KB
auth (createAuthenticatedFetch.js) 8.54KB 3.46KB
auth (index.js) 3.63KB 1.64KB
auth (invitation-status.js) 1.22KB 0.70KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 5.30KB 1.02KB
auth (useWorkspaceAdminStatus.js) 11.08KB 4.58KB
collaboration (CommentThread.js) 27.11KB 7.97KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.28KB 2.60KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.68KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.50KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 584.59KB 140.69KB
core (index.js) 10.00KB 3.96KB
create-plugin (index.js) 27.94KB 9.51KB
data-objectstack (index.js) 238.60KB 66.51KB
fields (index.js) 266.88KB 67.46KB
i18n (LocalizationContext.js) 2.92KB 1.42KB
i18n (builtinAggregateLabels.js) 0.86KB 0.49KB
i18n (currency.js) 2.59KB 1.22KB
i18n (fallbackInterpolation.js) 6.25KB 2.77KB
i18n (i18n.js) 8.87KB 3.64KB
i18n (index.js) 5.52KB 2.39KB
i18n (pickLocalized.js) 9.86KB 3.95KB
i18n (provider.js) 39.35KB 12.88KB
i18n (translateFn.js) 0.20KB 0.18KB
i18n (useDisplayLocale.js) 3.52KB 1.76KB
i18n (useObjectLabel.js) 38.37KB 10.31KB
i18n (useSafeTranslation.js) 7.14KB 2.92KB
layout (index.js) 41.50KB 11.82KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.75KB
mobile (index.js) 1.99KB 0.87KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 6.62KB 2.45KB
mobile (useResponsive.js) 0.72KB 0.42KB
mobile (useSpecGesture.js) 5.52KB 2.10KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 13.86KB 5.00KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 6.52KB 2.26KB
permissions (discardProofCache.js) 1.04KB 0.55KB
permissions (evaluator.js) 8.33KB 3.07KB
permissions (index.js) 0.93KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.53KB
permissions (usePermissions.js) 4.83KB 2.27KB
plugin-ai (index.js) 16.04KB 3.92KB
plugin-calendar (index.js) 53.39KB 15.52KB
plugin-charts (index.js) 84.71KB 23.25KB
plugin-chatbot (index.js) 199.63KB 47.46KB
plugin-dashboard (index.js) 144.82KB 39.17KB
plugin-designer (index.js) 231.46KB 48.87KB
plugin-detail (index.js) 248.57KB 65.47KB
plugin-editor (index.js) 2.23KB 1.05KB
plugin-form (index.js) 176.62KB 45.75KB
plugin-gantt (index.js) 179.17KB 45.07KB
plugin-grid (index.js) 239.75KB 65.92KB
plugin-kanban (index.js) 52.17KB 16.37KB
plugin-list (index.js) 117.42KB 29.32KB
plugin-map (index.js) 25.60KB 8.62KB
plugin-markdown (index.js) 13.88KB 4.80KB
plugin-report (index.js) 44.12KB 12.29KB
plugin-timeline (index.js) 39.10KB 11.81KB
plugin-tree (index.js) 15.07KB 5.33KB
plugin-view (index.js) 91.07KB 22.93KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.81KB 3.58KB
providers (index.js) 0.45KB 0.23KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.62KB 2.34KB
react (LazyPluginLoader.js) 4.47KB 1.63KB
react (SchemaRenderer.js) 120.63KB 39.56KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 4.50KB 2.06KB
react (schema-input.js) 4.31KB 2.07KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (body-dialect.js) 4.50KB 1.99KB
sdui-parser (codegen.js) 9.45KB 3.76KB
sdui-parser (dashboard-widget-options.js) 3.08KB 1.30KB
sdui-parser (index.js) 7.30KB 3.12KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (parse.js) 25.28KB 7.80KB
sdui-parser (provenance.js) 3.84KB 1.90KB
sdui-parser (types.js) 0.28KB 0.23KB
sdui-parser (validate.js) 23.87KB 7.83KB
types (ai.js) 4.39KB 2.17KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 4.12KB 1.61KB
types (authoring-nodes.js) 0.20KB 0.19KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (cloud.js) 0.20KB 0.18KB
types (complex.js) 4.44KB 2.07KB
types (crud.js) 0.20KB 0.18KB
types (dashboard-filter-alias.js) 6.23KB 2.74KB
types (dashboard-widget-layout.js) 2.06KB 0.96KB
types (data-display.js) 3.75KB 1.85KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.85KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (expression.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 1.13KB 0.65KB
types (form.js) 0.20KB 0.18KB
types (http-inflight.js) 8.87KB 3.73KB
types (http-retry.js) 4.32KB 2.02KB
types (icon-key-migration.js) 4.26KB 1.63KB
types (index.js) 5.78KB 2.70KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 5.00KB 2.39KB
types (navigation.js) 0.20KB 0.18KB
types (node-slots.js) 7.18KB 2.34KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 2.52KB 1.31KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (select-option.js) 0.20KB 0.19KB
types (spec-report.js) 4.99KB 1.96KB
types (spec-ui-namespace.js) 0.20KB 0.19KB
types (strict-authoring-face.js) 19.93KB 7.25KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 6.28KB 2.87KB
types (ui-action.js) 8.11KB 3.32KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 8, 2026 04:25
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 8, 2026 04:25
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 8, 2026
Merged via the queue into main with commit 9cb4e29 Oct 8, 2026
45 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-11812-palette-nav-match branch October 8, 2026 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

command palette: navigation entries match on scattered letters, so "zzzz" returns Field Zoo and "ingest" returns Cascading Select

2 participants