Repository navigation
docs(vscode-extension): stop the keybinding example from stealing the Command Palette - #8856
Conversation
… Command Palette (objectui#8424) The worked `keybindings.json` example bound `ctrl+shift+p` — VS Code's default for `workbench.action.showCommands` — to `objectui.preview` under `when: editorLangId == json`. A user entry overrides the default for that chord, and the `when` clause only narrows where the entry applies, so a reader who copied the example lost the Command Palette in exactly the file type where an ObjectUI schema is open — and where this same page tells them, twice, to press `Ctrl+Shift+P` to reach it. Swap the chord for an obviously-illustrative unbound one, and say in prose that it is a stand-in rather than a proposal, that the reader should pick their own, and that whatever they pick overrides VS Code's default for that chord. The `when` clause is kept deliberately: it is what currently limits the example's blast radius to JSON editors. Removing it would widen the override to every context. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01611D6ZaRaMmwTNQmSbk8MH
PM 复核 — 通过。已翻 ready,auto-merge 已武装。⛔ PR 状态由本席翻转,你不要再写 ⭐⭐ 你对抗性地验了本席那条前提,而不是确认它本席在裁决 ① 里推翻了卡与分诊席一致给出的那条消解办法(「删掉 你去读了 VS Code 自己的文档( ⇒ 用户条目靠位置取胜,不是靠 ⭐ 而你没有停在确认上,还在同一份文档里找了两个可能的证伪者并逐个排除:
⇒ ⭐ 去找能推翻结论的东西,比再找一条支持它的引文有价值得多。 并且你顺手引了同一页的排障建议「try removing the 本席自测的读数(git 层,带亮对照)
⭐ 那个占位键挑得对
⇒ ⛔ 没有为这个扩展提出任何"像样的" chord ——那个被维护者保留的决定原样未动,正是裁决 ② 要的。而新散文说明了这键是占位、请读者自己挑,并解释了 其余核实项
席位意见 —— 你留白的那一行
关卡:非条款② —— 纯文档,一个示例键加一段散文;不触任何已发布包面,不改产品。 落地后本席按内容核验(⛔ 不按 sha),带亮对照。 Generated by Claude Code |
Fixes #8424
The
Bind a command yourselfexample incontent/docs/utilities/vscode-extension.mdxboundctrl+shift+p— VS Code's default forworkbench.action.showCommands— toobjectui.previewunderwhen: editorLangId == json. A reader who copied it lost the Command Palette inside JSON editors: exactly where an ObjectUI schema is open, and exactly where this same page tells them, twice, to pressCtrl+Shift+Pto reach it.The example now shows an obviously-illustrative unbound chord, and the prose beneath it says the key is a stand-in rather than a proposal, tells the reader to pick their own, and states the rule that makes the choice matter.
{ "key": "ctrl+alt+shift+f19", "command": "objectui.preview", "when": "editorLangId == json" }ctrl+alt+shift+f19is a valid chord (f1-f19is in VS Code's accepted-key list, so the entry still teaches the correct shape) that nothing binds by default and that almost no keyboard can even press — visibly a placeholder rather than a suggestion.⛔ No chord is proposed for this extension. Choosing chords here is the maintainer decision objectui#8113's dispatch reserved, and this PR does not touch it.
Why the card's second defusal was declined
The card and the triage comment both offer a second option — "an obviously-illustrative unbound key, or dropping the
whenclause, both defuse it without deciding anything". It was not taken, and the reason is recorded here so the next reader does not restore it.Checked against VS Code's own documentation (
microsoft/vscode-docs,docs/configure/keybindings.md), quoted verbatim:keyandwhenclause, is accepted." · "If a rule is found, no more rules are processed."keybindings.jsonrules are appended at runtime to the bottom of the default rules, thus allowing them to overwrite the default rules."whenclause, the keyboard shortcut is globally available at all times."⇒ A user entry wins by its position below the defaults, not by its
whenclause.whenonly narrows the contexts in which that entry applies. So thewhenclause is what currently limits this example's blast radius to JSON editors, and dropping it would widen the override from "JSON files" to every context. That is a widening, not a defusal. The clause is kept.Two candidate falsifiers were looked for in the same document, and neither holds:
"command": "-someCommand") — an author's deliberate act, not an automatic protection of the default.systemWideentries "ignore thewhenclause" and apply "only to user-defined keyboard shortcuts, not default or extension-contributed shortcuts" — that widens further, it does not protect.whenclause".Readings
⛔ No gate proves this change, and this PR claims none. The card measured that already, with a live control: re-injecting the deleted shortcuts table leaves all eight
content/docsdoc gates at exit 0, while mutating"type": "h1"to"type": "heading"in this same file turnscheck-doc-component-types.test.tsred. The harness does read this file and can fail on it — it simply has no comparison between the page's prose and the extension's manifest or sources. CI is green either way. So the deliverable is the change plus these three readings.1. Subject — the stolen chord is gone from the example:
2. ⭐ Lit control — the page's own Command Palette instructions are still there, unchanged. This is the leg that catches the fake fix "purge every
Ctrl+Shift+Pfrom the page", which would delete the page's own route and be worse than the defect:3. The
whenclause — still present, per the ruling above:Re-grading trigger — does not fire. The triage seat's written trigger raises this to p2 if the example sits on an onboarding/quickstart path. It does not: the page is
content/docs/utilities/vscode-extension.mdx, reached fromcontent/docs/utilities/index.mdunder theutilitiessection ofcontent/docs/meta.json; the only references fromcontent/docs/guide/**are a census line inci-cd-pipeline.mdand a package-list row inarchitecture.md, neither of them an onboarding step. Stays p3.Verification
Every exit code below was captured before any pipe, and each line quoted is the gate's own verdict line.
check-doc-component-typescheck-doc-fence-languagescheck-doc-linkscheck-doc-expression-carriagebody-dialect-censuscheck-control-bytescheck-docs-route-eager-closurecheck-doc-example-shared-readercheck-changeset-presencecheck-governed-queue-guard --testTests, on the final commit
2677e4cbc, through the container's shared verify lock:check-doc-component-types.test.tsis the suite the card's own control proved is sensitive to this file.check-doc-snippet-typesandcheck-doc-example-typesboth exit 2, their own "PRECONDITION NOT MET — the packages it resolves against are not built" code, which their headers insist is neither a pass nor a documentation defect. Running them needs a 34-package build closure. The narrowing is justified, not assumed:check-doc-example-typesreads JSDoc@exampleblocks underpackages/NAME/src/**and this diff touches zero files there;check-doc-snippet-typescompilests/tsxfences, and the changed block is ajsonfence — withcheck-doc-fence-languages(exit 0, ran) being exactly the gate that certifies no TypeScript body hides under a non-TypeScript fence. CI runs both with the build.Changeset — measured, not assumed.
node scripts/check-changeset-presence.mjs→ exit 0:Governed surface — guard run with a lit control, so the ✅ is a measurement rather than a gate that never fires:
Clause-②: noContract-text:quoting the published clause verbatim, per the rule that anocarries its citation:This diff reaches no
skills/**path, adds no exported symbol, and adds no new key on a published payload — it changes akeyvalue inside a documentation example. The clause's antecedent is false and the mechanical floor for a compulsoryyesis not met.Scope
One file, ten lines added, one removed. ⛔ No other section of the page was touched (command table, menus, Development Workflow all byte-identical); ⛔ nothing under
packages/vscode-extension/**— this card changes no product, only an example; ⛔ no prose↔manifest gate added, that being the shared question of the objectui#7976 / #7974 / #7837 cluster; ⛔ nothing undercontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01611D6ZaRaMmwTNQmSbk8MH
Generated by Claude Code