Skip to content

Lite: add command palette#13270

Open
OliverJAsh wants to merge 2 commits intocommandsfrom
command-palette
Open

Lite: add command palette#13270
OliverJAsh wants to merge 2 commits intocommandsfrom
command-palette

Conversation

@OliverJAsh
Copy link
Copy Markdown
Contributor

Depends on #13266

Copilot AI review requested due to automatic review settings April 10, 2026 18:19
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
gitbutler-web Skipped Skipped Apr 10, 2026 6:19pm

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 WorkspaceCommandPalette UI (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.ts exports (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;
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
flex-direction: column;
flex-direction: column;
gap: 16px;

Copilot uses AI. Check for mistakes.
useMonitorDraggedOperationSource({ projectId });

const handleCommandPaletteKeyDown = useEffectEvent((event: KeyboardEvent) => {
if (event.defaultPrevented) return;
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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;
}

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +1867 to +1868
event.preventDefault();
setIsCommandPaletteOpen((open) => !open);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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.

2 participants