-
-
Notifications
You must be signed in to change notification settings - Fork 144
feat: command bar #470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: command bar #470
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Co-authored-by: Robin <robin.kehl@singular-it.de>
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Implements a Cmd/Ctrl+K “command bar” (quick actions) feature and wires it into the app’s command registration and localization system.
Changes:
- Added a new
CommandBarmodal component with filtering + keyboard navigation. - Introduced a global command registry composable and initial command registrations (search + install/run/create copy actions).
- Added global keybinding (Cmd/Ctrl+K) and new i18n strings for command labels/descriptions.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
lunaria/files/zh-CN.json |
Adds Chinese translations for command bar placeholder and copy actions. |
lunaria/files/en-US.json |
Adds English translations for command bar placeholder and copy actions. |
i18n/locales/zh-CN.json |
Mirrors Chinese command bar/copy-action strings into app locale files. |
i18n/locales/en.json |
Mirrors English command bar/copy-action strings into app locale files. |
app/plugins/commands.ts |
Registers a global “search packages” command for the command bar. |
app/composables/useCommandRegistry.ts |
Adds the command registry API and scoped/global registration helpers. |
app/components/InstallCommandTerminal.vue |
Registers scoped commands for copying install/run/create commands. |
app/components/CommandBar.vue |
New command bar UI (modal) + filtering, selection, triggering, and input/select flows. |
app/app.vue |
Adds global Cmd/Ctrl+K handler and mounts CommandBar. |
closes #81.
API Overview
There are two ways to register commands depending on their lifecycle:
registerGlobalCommand: Registers a command that persists globally. Use this for app-wide actions like "Search Packages", "Toggle Theme", or navigation. Usually registered inplugins/command.ts.registerScopedCommand: Registers a command that only exists while a component is mounted. Use this for context-aware actions like "Copy Install Command" (only relevant when viewing a package). It automatically unregisters when the component unmounts. You can safely use component variables (closures) inside the handler.Interactive UI (
ctx)The
handlerreceives actxobject to interact with the Command Palette UI. Both methods return aPromisethat resolves when the user finishes.ctx.input({ prompt }): Opens a text input.ctx.select({ prompt, items }): Opens a list for selection.Example Usage
Here is a quick snippet showing how to use them: