Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
There was a problem hiding this comment.
Pull request overview
Adds a command palette to the Lite workspace UI (dependent on #13266 “Lite: add commands”), enabling users to discover and run workspace commands via a Cmd/Ctrl+K modal.
Changes:
- Introduces
WorkspaceCommandPaletteUI (Base UI Dialog + Autocomplete) with dedicated styling. - Wires up a global Cmd/Ctrl+K keybinding in the workspace route and temporarily disables normal workspace shortcuts while the palette is open.
- Tightens
WorkspaceCommands.tsexports (makes identity key helper and inputs type internal).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/lite/ui/src/ui.module.css | Removes row-gap from the shared dialog popup styling. |
| apps/lite/ui/src/routes/project/$id/workspace/WorkspaceCommands.ts | Makes some previously-exported helpers/types internal. |
| apps/lite/ui/src/routes/project/$id/workspace/WorkspaceCommandPalette.tsx | Adds the command palette component rendering and command execution behavior. |
| apps/lite/ui/src/routes/project/$id/workspace/WorkspaceCommandPalette.module.css | Adds styling for the palette dialog, list, and footer. |
| apps/lite/ui/src/routes/project/$id/workspace/route.tsx | Adds Cmd/Ctrl+K global toggle and mounts the palette in the workspace route. |
| top: 50%; | ||
| left: 50%; | ||
| row-gap: 12px; | ||
| flex-direction: column; |
There was a problem hiding this comment.
Removing row-gap from .dialogPopup leaves no spacing between dialog children because global.css resets heading/ul margins. This makes dialogs using uiStyles.dialogPopup (e.g. the Absorption dialog) render with elements stuck together. Either restore a gap/row-gap here or add explicit spacing in the dialog content styles so dialogs keep readable separation.
| flex-direction: column; | |
| flex-direction: column; | |
| gap: 16px; |
| useMonitorDraggedOperationSource({ projectId }); | ||
|
|
||
| const handleCommandPaletteKeyDown = useEffectEvent((event: KeyboardEvent) => { | ||
| if (event.defaultPrevented) return; |
There was a problem hiding this comment.
The global Cmd/Ctrl+K key handler doesn't follow the app's existing shortcut behavior in useWorkspaceShortcuts: it should ignore key events coming from typing targets and should also ignore event.repeat to avoid rapidly toggling the palette when the key is held down.
| if (event.defaultPrevented) return; | |
| if (event.defaultPrevented) return; | |
| if (event.repeat) return; | |
| const target = event.target; | |
| if ( | |
| target instanceof HTMLInputElement || | |
| target instanceof HTMLTextAreaElement || | |
| target instanceof HTMLSelectElement || | |
| (target instanceof HTMLElement && target.isContentEditable) | |
| ) { | |
| return; | |
| } |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: df4b3166f0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| event.preventDefault(); | ||
| setIsCommandPaletteOpen((open) => !open); |
There was a problem hiding this comment.
Ignore auto-repeat for the Cmd/Ctrl+K handler
Holding the palette shortcut down fires repeated keydown events with event.repeat === true, and this handler toggles state on every event via setIsCommandPaletteOpen((open) => !open). That means the palette can rapidly open and close based on key-repeat timing, making the shortcut unreliable unless users release K immediately. Add a repeat guard before toggling so only the first keydown is handled.
Useful? React with 👍 / 👎.
Depends on #13266