Repository navigation
fix(app-shell): a ⌘K built-in command is found by the words of its own label - #33493
Conversation
…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
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5p9rZ1muPLLx4Z5Qaj
|
domain:ui#1 · os-project-manager · session_01FEkQ5nWoa1Ze1QzjRTSYXD 席位核对Verdict: ACCEPT · head
|
|
domain:ui#1 · os-project-manager · session_01FEkQ5nWoa1Ze1QzjRTSYXD Landing · head
State: ready + auto-merge. |
Requested by Leehom · project thread
domain:ui#1 · os-project-manager · session_01FEkQ5p9rZ1muPLLx4Z5Qaj
Fixes #33061
Clause-②: no
Metadata-protocol: none
维护者速读
open或full search找不到写着这两个词的那一行;中文界面下输入「浅色」「完整搜索」也找不到「浅色主题」「打开完整搜索页面」。ui/packages/app-shell/src/chrome/CommandPalette.tsx里themeCommands与showFullSearch两行。open,预期出现「Open Full Search Page」;切到中文输入「浅色」,预期出现「浅色主题」。What changes
ui/packages/app-shell/src/chrome/CommandPalette.tsx:console.commandPalette.openFullSearch) beside its valuesearch all results full page. The label is read once (fullSearchLabel) and the same string is both matched and drawn.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".values are unchanged, so selection, the studio scope and every existing pin that readsdata-valueare 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.New pin
ui/packages/app-shell/src/chrome/CommandPalette.commandLabelMatch-33061.test.tsx, through the realCommandPaletteProvider(opened by?palette=1) under a realI18nProvider, typing into the palette'scmdk-input. Labels are read from the shipped locale packs (@object-ui/i18n/locales):openandfull searchfind "Open Full Search Page" underen.zh-Hans,完整搜索finds 「打开完整搜索页面」 and浅色finds 「浅色主题」, each and only that row.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/consolepatch (app-shell is private; the console's dist ships it, precedent.changeset/32868-holder-pick-fallback-position-note.md).Why
Measured on
origin/main2797f81d:showFullSearch = !inStudio && matches(FULL_SEARCH_VALUE)andTHEME_COMMANDS.filter((command) => matches(command.value)).matchesPaletteQuery('open', ['search all results full page'])is false (no word starts withopen, and it is not a substring), andfull searchis not a contiguous run of the value. Ablation leg A below puts exactly that line back and theopen/full searchpin goes red, so the premise holds on the current tree.Tests
New pin + neighbouring palette pins (HEAD)
pnpm exec vitest run --maxWorkers=2onCommandPalette.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)
matches(fullSearchLabel, FULL_SEARCH_VALUE)→matches(FULL_SEARCH_VALUE)(theorigin/mainbehaviour). On disk: label-match 0, value-only 1. Result: Tests 2 failed, 2 passed.open/full searchred withexpected [] to deeply equal [ 'Open Full Search Page' ]; zh-Hans red withexpected [] to deeply equal [ '打开完整搜索页面' ]. Both CONTROLs green. Restored: blob == HEAD,git diff HEADempty.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 withexpected [] to deeply equal [ '浅色主题' ]. Restored: blob == HEAD,git diff HEADempty.The test imports
./CommandPalettefrom source, so nodist/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/(fromui/, 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-checkafterpnpm --filter '@object-ui/app-shell^...' build: exit 0.Acceptance notes
console.commandPalette.openFullSearch/lightTheme/darkTheme/systemThemerows are what is matched, so every shipped locale (11 packs) is covered by the same line.Clause-②: no,Metadata-protocol: noneas claimed: app-shell is private and nothing authorable changes.enthe theme labels hold the same words as their values, so nothing new finds them; the full-search row is newly found byopenand by contiguous label runs such asfull searchoropen full. In the other ten packs every command is newly found by its own label's words.eslint --no-inline-configon 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 bynode scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack). The firstcheck:type-check-debtrun 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
dispatch-gates --ran: "36 derived famil(ies) accounted for — 36 run, 0 NOT-MEASURED", exit 0.origin/mainmoved tob392ff7bduring the run; its diff touches the locale packs but none of theconsole.commandPaletterows this pin reads, and notCommandPalette.tsxorpaletteMatch.ts. Families CI runs beyond the derived set belong to the PR's check-runs.Human Minimum
packages/specholds no runtime logic. (n/a)pnpm lintpasses. (scoped eslint on the changed files: 0 errors; repo-wide run is CI's)main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (n/a)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01FEkQ5p9rZ1muPLLx4Z5Qaj