Skip to content

chore: polish keycap border & mvoe into ui package#2664

Draft
janburzinski wants to merge 8 commits into
mainfrom
emdash/rm-border-97yv7
Draft

chore: polish keycap border & mvoe into ui package#2664
janburzinski wants to merge 8 commits into
mainfrom
emdash/rm-border-97yv7

Conversation

@janburzinski

Copy link
Copy Markdown
Collaborator

Description

  • moved command palette and Kbd into @emdash/ui
  • migrated command palette to use shared ui compoennts
  • polished shortcut/keycap formatting and styling

Screenshot/Recording (if applicable)

https://streamable.com/fx0ljr

Checklist
  • I kept this PR small and focused
  • I ran a self-review before opening this PR
  • I ran the relevant local checks or explained why not
  • I updated docs when behavior or setup changed
  • I added or updated tests when behavior changed, or explained why not
  • I only added comments where the logic is not obvious
  • I used Conventional Commits for commit
    messages and, when possible, the PR title

@janburzinski janburzinski changed the title Emdash/rm border 97yv7 chore: polish keycap border & mvoe into ui package Jun 24, 2026
@greptile-apps

greptile-apps Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR moves the command palette and Kbd/KbdGroup components into the shared @emdash/ui package, migrates all palette components to consume those shared primitives, and polishes keycap sizing and border styling.

  • Command primitives extracted: command.tsx and kbd.tsx are new in @emdash/ui/react/primitives, wrapping cmdk with design-system tokens; all palette files (command-palette-modal, palette-*-item/group) updated to import from there instead of cmdk directly.
  • Keycap rendering refactored: shortcut.tsx now wraps keycap keys in KbdGroup/Kbd from the shared package; single-char labels (symbols, letters, digits) get a fixed-size square keycap via SHORT_KEYCAP_KBD_CLASS; the text variant consolidates to a single formatShortcutDisplay span.
  • Type hygiene: CommandItem (composer type) renamed to ComposerCommandItem to avoid collision with the new cmdk CommandItem component; as any casts in typography.variants.css.ts replaced with a typed fontWeight() helper.

Confidence Score: 4/5

Merge 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.

Important Files Changed

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
Loading
%%{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
Loading

Reviews (2): Last reviewed commit: "fix(lint): clean warning suppressions" | Re-trigger Greptile

Comment thread apps/emdash-desktop/src/renderer/lib/ui/shortcut-format.test.ts
# 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
@janburzinski

Copy link
Copy Markdown
Collaborator Author

@greptileai

@janburzinski janburzinski marked this pull request as draft June 24, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant