From bb416deceac5fce6b2e4ca59317caa46d2c08b7c Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 30 Aug 2026 00:31:39 +0000 Subject: [PATCH] fix(examples,docs): name the command demo for what its fixture renders MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The catalog id `components-form-command/command-palette-with-shortcuts`, its derived title ("Command Palette With Shortcuts") and its docs heading ("### With Shortcuts") all promised shortcuts. Nothing behind those names draws one: `CommandItem` declares only `value` / `label` / `icon` (packages/types/src/form.ts:1378), and renderers/form/command.tsx reads `item.value`, `item.label` and `item.icon` and never a shortcut. objectui#6157 removed the invented `shortcut` key from the three items and the naming stayed behind. Renamed to `components-form-command/file-command-palette` — what the fixture actually shows: one `File` group of three file commands with icons, under its own search placeholder. The title derives from the slug, so it follows without curation. Every reader of the old id follows: - content/docs/components/form/command.mdx heading + SchemaExample id - examples/schema-catalog/src/index.ts REGENERATED, never hand-edited - examples/schema-catalog/test/component-fixture-declared-keys.test.ts schemaOf() id - packages/components/src/renderers/form/command.tsx comment naming the file - packages/components/src/__tests__/command-item-icon.test.tsx test name - scripts/check-lucide-icon-record-names.mjs comment naming the file Command-item shortcuts were deliberately NOT implemented: declaring a new key on `CommandItem` and rendering it is a capability expansion with no measured pull, so it stays a decision rather than a fixture edit. The changeset carries an EMPTY frontmatter: the two `@object-ui/components` files touched are a code comment and a test name, so this releases nothing. --- .changeset/rename-command-palette-shortcuts-demo.md | 10 ++++++++++ content/docs/components/form/command.mdx | 6 ++++-- examples/schema-catalog/src/index.ts | 10 +++++----- ...e-with-shortcuts.json => file-command-palette.json} | 0 .../test/component-fixture-declared-keys.test.ts | 2 +- .../src/__tests__/command-item-icon.test.tsx | 2 +- packages/components/src/renderers/form/command.tsx | 2 +- scripts/check-lucide-icon-record-names.mjs | 2 +- 8 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 .changeset/rename-command-palette-shortcuts-demo.md rename examples/schema-catalog/src/schemas/components-form-command/{command-palette-with-shortcuts.json => file-command-palette.json} (100%) diff --git a/.changeset/rename-command-palette-shortcuts-demo.md b/.changeset/rename-command-palette-shortcuts-demo.md new file mode 100644 index 0000000000..4effb7cfe8 --- /dev/null +++ b/.changeset/rename-command-palette-shortcuts-demo.md @@ -0,0 +1,10 @@ +--- +--- + +Rename the `components-form-command/command-palette-with-shortcuts` catalog demo to +`components-form-command/file-command-palette`, so its id, title and docs heading name what +the fixture actually renders after objectui#6157 removed the invented `shortcut` key. The +docs heading, the generated catalog index and the fixture test follow the rename. + +No published behaviour changes: the two `@object-ui/components` files touched are a code +comment and a test name that spelled the old filename. diff --git a/content/docs/components/form/command.mdx b/content/docs/components/form/command.mdx index abab21a968..818d001722 100644 --- a/content/docs/components/form/command.mdx +++ b/content/docs/components/form/command.mdx @@ -47,6 +47,8 @@ interface CommandSchema { ## Examples -### With Shortcuts +### File Command Palette - +A single-group palette of file commands, with its own search placeholder. + + diff --git a/examples/schema-catalog/src/index.ts b/examples/schema-catalog/src/index.ts index 99c0e276e1..457cc5b65f 100644 --- a/examples/schema-catalog/src/index.ts +++ b/examples/schema-catalog/src/index.ts @@ -196,7 +196,7 @@ import components_form_combobox_disabled from './schemas/components-form-combobo import components_form_combobox_searchable_combobox from './schemas/components-form-combobox/searchable-combobox.json' with { type: 'json' }; import components_form_combobox_with_value from './schemas/components-form-combobox/with-value.json' with { type: 'json' }; import components_form_command_command_menu from './schemas/components-form-command/command-menu.json' with { type: 'json' }; -import components_form_command_command_palette_with_shortcuts from './schemas/components-form-command/command-palette-with-shortcuts.json' with { type: 'json' }; +import components_form_command_file_command_palette from './schemas/components-form-command/file-command-palette.json' with { type: 'json' }; import components_form_date_picker_basic_date_picker from './schemas/components-form-date-picker/basic-date-picker.json' with { type: 'json' }; import components_form_date_picker_date_range_selector from './schemas/components-form-date-picker/date-range-selector.json' with { type: 'json' }; import components_form_date_picker_disabled from './schemas/components-form-date-picker/disabled.json' with { type: 'json' }; @@ -2122,14 +2122,14 @@ const REGISTRY: Record = { }, schema: components_form_command_command_menu, }, - 'components-form-command/command-palette-with-shortcuts': { - id: 'components-form-command/command-palette-with-shortcuts', + 'components-form-command/file-command-palette': { + id: 'components-form-command/file-command-palette', meta: { - title: "Command Palette With Shortcuts", + title: "File Command Palette", description: "", category: 'components-form-command', }, - schema: components_form_command_command_palette_with_shortcuts, + schema: components_form_command_file_command_palette, }, 'components-form-date-picker/basic-date-picker': { id: 'components-form-date-picker/basic-date-picker', diff --git a/examples/schema-catalog/src/schemas/components-form-command/command-palette-with-shortcuts.json b/examples/schema-catalog/src/schemas/components-form-command/file-command-palette.json similarity index 100% rename from examples/schema-catalog/src/schemas/components-form-command/command-palette-with-shortcuts.json rename to examples/schema-catalog/src/schemas/components-form-command/file-command-palette.json diff --git a/examples/schema-catalog/test/component-fixture-declared-keys.test.ts b/examples/schema-catalog/test/component-fixture-declared-keys.test.ts index b4fc45f799..09efaeb86b 100644 --- a/examples/schema-catalog/test/component-fixture-declared-keys.test.ts +++ b/examples/schema-catalog/test/component-fixture-declared-keys.test.ts @@ -169,7 +169,7 @@ describe('command palette fixture: every item key survives a CommandItem parse', * and `.success` stays true. Round-trip equality is what detects it. */ const items = ( - (schemaOf('components-form-command/command-palette-with-shortcuts') + (schemaOf('components-form-command/file-command-palette') .groups as Json[])[0].items as Json[] ); diff --git a/packages/components/src/__tests__/command-item-icon.test.tsx b/packages/components/src/__tests__/command-item-icon.test.tsx index 84ae988294..c97fd8ebd7 100644 --- a/packages/components/src/__tests__/command-item-icon.test.tsx +++ b/packages/components/src/__tests__/command-item-icon.test.tsx @@ -198,7 +198,7 @@ describe('ui:command item icon resolution (objectui#5931)', () => { } }); - it('command-palette-with-shortcuts.json — draws a glyph for all three names it declares', () => { + it('file-command-palette.json — draws a glyph for all three names it declares', () => { renderCommand([ { value: 'new', label: 'New File', icon: 'file-plus' }, { value: 'open', label: 'Open File', icon: 'folder-open' }, diff --git a/packages/components/src/renderers/form/command.tsx b/packages/components/src/renderers/form/command.tsx index 6f5cbb8126..61c51cec01 100644 --- a/packages/components/src/renderers/form/command.tsx +++ b/packages/components/src/renderers/form/command.tsx @@ -10,7 +10,7 @@ import { ComponentRegistry } from '@object-ui/core'; import type { CommandSchema } from '@object-ui/types'; import { Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem } from '../../ui/command'; // `CommandItem.icon` is an authored lucide NAME that this renderer never read — -// `command-menu.json` and `command-palette-with-shortcuts.json` declare nine of +// `command-menu.json` and `file-command-palette.json` declare nine of // them between them and drew none (objectui#5931). // // Routed through the RECORD surface (`icons` from 'lucide-react', reached via diff --git a/scripts/check-lucide-icon-record-names.mjs b/scripts/check-lucide-icon-record-names.mjs index bd9b70f3b6..0f645ae55c 100644 --- a/scripts/check-lucide-icon-record-names.mjs +++ b/scripts/check-lucide-icon-record-names.mjs @@ -276,7 +276,7 @@ export const RECORD_READING_TYPES = { // extract nothing, report no violations and read exactly like a clean tree. // Descent reaches them because an untyped node passes descent through to its // own children. `min` is the measured count: six names in `command-menu.json` - // plus three in `command-palette-with-shortcuts.json`. + // plus three in `file-command-palette.json`. 'command': { paths: [], descendants: true,