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,