chore: polish keycap border & mvoe into ui package#2664
Conversation
Greptile SummaryThis PR moves the command palette and
Confidence Score: 4/5Merge is safe once the TypeScript path alias gap is addressed; Vite builds and runtime behaviour are unaffected. The tsconfig adds @emdash/ui → source but omits the @emdash/ui/* wildcard, so every @emdash/ui/react/primitives import introduced in this PR resolves from dist/ via the exports field rather than from source. On a clean monorepo where @emdash/ui hasn't been built, tsc --noEmit will fail for all the migrated palette files and shortcut.tsx. Vite builds are unaffected because its alias correctly resolves sub-paths from source. Everything else in the PR — the shared primitives, keycap sizing logic, type rename, and optical-alignment changes — looks correct. apps/emdash-desktop/tsconfig.json — needs "@emdash/ui/": ["../../packages/ui/src/"] alongside the existing root alias.
|
| Filename | Overview |
|---|---|
| apps/emdash-desktop/tsconfig.json | Adds @emdash/ui path alias for the root import, but is missing the @emdash/ui/* wildcard needed to resolve sub-path imports (like @emdash/ui/react/primitives) to source files during type-checking. |
| packages/ui/src/react/primitives/command.tsx | New shared command palette primitives wrapping cmdk, with appropriate slot attrs, default styling using design-system tokens, and correct group heading class propagation. |
| packages/ui/src/react/primitives/kbd.tsx | Migrated Kbd/KbdGroup primitives into the shared UI package; KbdGroup correctly changed from a semantic-error container to a . |
| apps/emdash-desktop/src/renderer/lib/ui/shortcut.tsx | Refactored keycap rendering to use shared Kbd/KbdGroup from @emdash/ui; single-char labels get a fixed square keycap, text variant now uses concatenated formatShortcutDisplay, and optical-alignment is retained for the badge variant. |
| apps/emdash-desktop/src/renderer/features/command-palette/command-palette-modal.tsx | Migrated from direct cmdk imports to shared @emdash/ui primitives; GROUP_CLASS correctly reduced to only the color override that differs from the shared component base. |
| packages/ui/src/react/components/chat-composer.tsx | Renamed exported CommandItem type to ComposerCommandItem to avoid collision with the new CommandItem component now re-exported from primitives; index.ts updated in lock-step. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
subgraph emdash-desktop["apps/emdash-desktop"]
CP["command-palette-modal.tsx"]
PCI["palette-*-item.tsx"]
PCG["palette-*-group.tsx"]
SC["shortcut.tsx"]
end
subgraph ui["@emdash/ui / react/primitives"]
CMD["command.tsx\n(Command, CommandInput,\nCommandList, CommandGroup,\nCommandItem, CommandEmpty…)"]
KBD["kbd.tsx\n(Kbd, KbdGroup)"]
end
cmdk["cmdk"]
CP -->|imports| CMD
PCI -->|imports| CMD
PCG -->|imports| CMD
SC -->|imports| KBD
CMD -->|wraps| cmdk
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
subgraph emdash-desktop["apps/emdash-desktop"]
CP["command-palette-modal.tsx"]
PCI["palette-*-item.tsx"]
PCG["palette-*-group.tsx"]
SC["shortcut.tsx"]
end
subgraph ui["@emdash/ui / react/primitives"]
CMD["command.tsx\n(Command, CommandInput,\nCommandList, CommandGroup,\nCommandItem, CommandEmpty…)"]
KBD["kbd.tsx\n(Kbd, KbdGroup)"]
end
cmdk["cmdk"]
CP -->|imports| CMD
PCI -->|imports| CMD
PCG -->|imports| CMD
SC -->|imports| KBD
CMD -->|wraps| cmdk
Reviews (2): Last reviewed commit: "fix(lint): clean warning suppressions" | Re-trigger Greptile
# Conflicts: # packages/ui/package.json # packages/ui/src/components/index.ts # packages/ui/src/react/primitives/command.tsx # packages/ui/src/react/primitives/kbd.tsx
Description
Screenshot/Recording (if applicable)
https://streamable.com/fx0ljr
Checklist
messages and, when possible, the PR title