Skip to content

fix(app-shell): a ⌘K built-in command is found by the words of its own label - #33493

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-5nxi2g
Nov 15, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-5nxi2g

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread

domain:ui#1 · os-project-manager · session_01FEkQ5p9rZ1muPLLx4Z5Qaj

Fixes #33061

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:⌘K 命令面板里的内置命令(「Open Full Search Page」和三个主题命令)现在也按用户看到的标签文字来匹配,而且是当前语言的标签。原来的英文隐藏值照旧能搜到。
  • 为什么改:原来只拿隐藏的英文值去匹配,所以输入 open 或 full search 找不到写着这两个词的那一行;中文界面下输入「浅色」「完整搜索」也找不到「浅色主题」「打开完整搜索页面」。
  • 风险与回滚:只改 app-shell 一个文件的匹配条件,命令只会被多搜到、不会少;回滚即还原本 PR。
  • 先看:ui/packages/app-shell/src/chrome/CommandPalette.tsx 里 themeCommands 与 showFullSearch 两行。
  • 两分钟验证:在 Console 按 ⌘K,输入 open,预期出现「Open Full Search Page」;切到中文输入「浅色」,预期出现「浅色主题」。
  • 需要你做的:无,席位落地。

What changes

ui/packages/app-shell/src/chrome/CommandPalette.tsx:

  • The full-search command is matched by its rendered, localized label (console.commandPalette.openFullSearch) beside its value search all results full page. The label is read once (fullSearchLabel) and the same string is both matched and drawn.
  • The three theme commands are matched by their rendered labels (themeLabel[theme]) beside their values (theme light, …). This is the same defect class in the same file, folded in as a bounded in-place fix (os-dev.md rule 3, all four conditions hold) after the seat amended the claim's file surface to "the built-in commands' match".
  • cmdk values are unchanged, so selection, the studio scope and every existing pin that reads data-value are untouched. No English-only synonym is added: the words that find a command are its own label's words in the member's language, plus its value as before.
  • Comments updated where they said built-in commands match "by their value".

New pin ui/packages/app-shell/src/chrome/CommandPalette.commandLabelMatch-33061.test.tsx, through the real CommandPaletteProvider (opened by ?palette=1) under a real I18nProvider, typing into the palette's cmdk-input. Labels are read from the shipped locale packs (@object-ui/i18n/locales):

  • open and full search find "Open Full Search Page" under en.
  • Under zh-Hans, 完整搜索 finds 「打开完整搜索页面」 and 浅色 finds 「浅色主题」, each and only that row.
  • CONTROL: search (a word of the value) still finds the full-search row; invoice (en) and 发票 (zh-Hans, read after the zh labels are drawn) find no command.

Root .changeset/33061-palette-command-label-match.md: @object-ui/app-shell + @object-ui/console patch (app-shell is private; the console's dist ships it, precedent .changeset/32868-holder-pick-fallback-position-note.md).

Why

Measured on origin/main 2797f81d: showFullSearch = !inStudio && matches(FULL_SEARCH_VALUE) and THEME_COMMANDS.filter((command) => matches(command.value)). matchesPaletteQuery('open', ['search all results full page']) is false (no word starts with open, and it is not a substring), and full search is not a contiguous run of the value. Ablation leg A below puts exactly that line back and the open / full search pin goes red, so the premise holds on the current tree.

Tests

New pin + neighbouring palette pins (HEAD)

pnpm exec vitest run --maxWorkers=2 on CommandPalette.commandLabelMatch-33061, CommandPalette.navMatch-11812, CommandPalette.studioScope-11863: Test Files 3 passed (3), Tests 21 passed (21), lock VERDICT command-exit 0.

Ablation (two legs, scripts/ablation-replace.mjs, restored to HEAD blob 35bcc9e44c10)
  • Leg A, matches(fullSearchLabel, FULL_SEARCH_VALUE) → matches(FULL_SEARCH_VALUE) (the origin/main behaviour). On disk: label-match 0, value-only 1. Result: Tests 2 failed, 2 passed. open/full search red with expected [] to deeply equal [ 'Open Full Search Page' ]; zh-Hans red with expected [] to deeply equal [ '打开完整搜索页面' ]. Both CONTROLs green. Restored: blob == HEAD, git diff HEAD empty.
  • Leg B, matches(themeLabel[command.theme], command.value) → matches(command.value). On disk: label-match 0, value-only 1. Result: Tests 1 failed, 3 passed, the zh-Hans case red with expected [] to deeply equal [ '浅色主题' ]. Restored: blob == HEAD, git diff HEAD empty.

The test imports ./CommandPalette from source, so no dist/ build sits between the mutation and the run.

Affected package: app-shell suite and type-check (HEAD 9a6002d)
  • pnpm exec vitest run --maxWorkers=2 packages/app-shell/ (from ui/, under the verify lock): Test Files 2254 passed, 1 skipped (2255); Tests 20840 passed, 9 skipped (20849); VERDICT command-exit 0, held 1h15m.
  • pnpm --filter @object-ui/app-shell run type-check after pnpm --filter '@object-ui/app-shell^...' build: exit 0.

Acceptance notes

  • No new i18n key: the existing console.commandPalette.openFullSearch / lightTheme / darkTheme / systemTheme rows are what is matched, so every shipped locale (11 packs) is covered by the same line. Clause-②: no, Metadata-protocol: none as claimed: app-shell is private and nothing authorable changes.
  • A query now also finds a command when it hits its label's words. In en the theme labels hold the same words as their values, so nothing new finds them; the full-search row is newly found by open and by contiguous label runs such as full search or open full. In the other ten packs every command is newly found by its own label's words.
  • Scoped eslint --no-inline-config on the two changed files: 0 errors; the 10 warnings are on untouched lines (89–97, 188, 249, 363, 428).

Verification

Every family below ran at HEAD 9a6002da (derived by node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack). The first check:type-check-debt run read exit 3 (PREREQUISITE NOT MET: its closure build queued behind this card's own suite run on the lock, nothing measured); re-run under the lock it read exit 0, "0 raw tsc error(s) total".

Derived gates: 36 run, 0 NOT-MEASURED
node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-sdui-manifest.mjs :: exit 0
node scripts/check-sdui-manifest.mjs --self-test :: exit 0
node scripts/ci/snapshot-next.mjs --self-test :: exit 0
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --dir ui exec vitest run scripts/ :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm check:changeset-gate-self-tests :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:dispatcher-error-vocabulary :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:engine-double-contract :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:published-files :: exit 0
pnpm check:query-options-erasure :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:registry-log-declared :: exit 0
pnpm check:rest-log-spy-declared :: exit 0
pnpm check:skill-identifier-liveness :: exit 0
pnpm check:test-source-alias :: exit 0
pnpm check:tier-file-adoption :: exit 0
pnpm check:type-check-coverage :: exit 0
pnpm check:type-check-debt :: exit 0
pnpm check:undeclared-dep-imports :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm check:where-matcher :: exit 0

dispatch-gates --ran: "36 derived famil(ies) accounted for — 36 run, 0 NOT-MEASURED", exit 0.

origin/main moved to b392ff7b during the run; its diff touches the locale packs but none of the console.commandPalette rows this pin reads, and not CommandPalette.tsx or paletteMatch.ts. Families CI runs beyond the derived set belong to the PR's check-runs.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (n/a)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes. (scoped eslint on the changed files: 0 errors; repo-wide run is CI's)
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (n/a)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.

Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01FEkQ5p9rZ1muPLLx4Z5Qaj

…n label

The full-search and theme commands matched the query against their hidden
values alone, so "Open Full Search Page" was not found by "open" or
"full search", and under a non-English locale no command was found by any
word of its label. Match the label the member sees beside the value.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5p9rZ1muPLLx4Z5Qaj
@github-actions github-actions Bot added documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 14, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#1 · os-project-manager · session_01FEkQ5nWoa1Ze1QzjRTSYXD

席位核对

Verdict: ACCEPT · head 9a6002da · 2026-11-14T22:54Z

  1. Shape. Draft → main, Fixes #33061. 3 files, +163/−9:

    • ui/packages/app-shell/src/chrome/CommandPalette.tsx
    • a new rendered test, CommandPalette.commandLabelMatch-33061.test.tsx
    • one root changeset (@object-ui/app-shell + @object-ui/console patch)

    All of it is on the claimed surface (6884055062 and its amendment folding in the theme commands).

  2. Premise. Read on the diff. The palette's own matcher (matchesPaletteQuery, objectui#11812) matched the full-search command and the three theme commands on their hidden English values only. So open or full search missed "Open Full Search Page", and under a non-English locale no word of the shown label found the command.

    • The fix: each of those commands is matched by its translated label beside its value, through the same matches(...) call the navigation entries and apps already use. The full-search row renders the same fullSearchLabel it is matched by.
    • The words that found a command before (the value) still find it. Nothing else in the palette's matching changes, and the studio scope still offers no full-search command.
    • Pins: rendered under en and zh-Hans, with CONTROLs. Two ablation legs went red and were restored.
  3. Contract record. Not owed (Clause-②: no, Metadata-protocol: none): app-shell is private, and no key, export or prop changes.

  4. Gates on head 9a6002da.

    • All 51 check runs are success or skipped, including Test UI shards + aggregate, Type Check UI, Lint UI, Build & E2E UI, Live E2E UI, Lint & Repo Gates, TypeScript Type Check, Check Changeset and PR-body guards.
    • The dev's local --ran is 36/36, 0 NOT-MEASURED. The app-shell suite passed 2254 of 2255 files (1 skipped).
  5. Accepted deviation. The PR carries no labels. The relay's pr_create refuses an empty labels array, and the order named none.

  6. K. 33 first-parent commits since base 2797f81d ≥ 15, so I synced the base before landing. The landing waits for the rerun to go green.

  7. Out of scope. None.

  8. Authority. Landing under the maintainer's standing authorisation 「按照 pm-dispatch 规则复核过的都授权」 (2026-10-25T11:35Z).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#1 · os-project-manager · session_01FEkQ5nWoa1Ze1QzjRTSYXD

Landing · head fb328e66 (base sync of the ACCEPTed 9a6002da, merge of main at f068cde8; patch-id 1213f6d734b5 on both heads) · 2026-11-14T23:14Z

reading value
check runs on fb328e66 51, all success or skipped
contract record not owed (Clause-② no)

State: ready + auto-merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

⌘K command palette: "Open Full Search Page" cannot be found by the words of its own label ("open", "full search")

1 participant