Skip to content

refactor(app): move command palette to dedicated module - #18365

Closed
anduimagui wants to merge 5 commits into
anomalyco:devfrom
anduimagui:refactor/layout-commands-module
Closed

anduimagui wants to merge 5 commits into
anomalyco:devfrom
anduimagui:refactor/layout-commands-module

Conversation

@anduimagui

@anduimagui anduimagui commented Mar 20, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This starts by moving the layout command registration block out of packages/app/src/pages/layout.tsx into packages/app/src/pages/layout/commands.tsx, then goes further by moving the command-owned action helpers and dialog openers into the same module.

That expanded scope means layout.tsx no longer carries the inline command wrappers for archiving the current session, creating or toggling workspaces, or opening the provider, server, and settings dialogs. The page now mostly passes the layout state and actions into the command module, which keeps command-related churn in one smaller file and reduces the chance of merge conflicts in a high-traffic page.

A good example of why this refactor matters is the new Edit project command added to the palette. Instead of threading command logic through multiple layout files, the new command can now be added and maintained in packages/app/src/pages/layout/commands.tsx, making it much easier to ship targeted palette actions for the current project.

I also added focused coverage in packages/app/src/pages/layout/commands.test.ts so future command changes have a small test seam around registration, workspace toggling, archive behavior, and dialog-triggering commands.

How did you verify your code works?

Ran bun typecheck in packages/app.

Ran bun test --preload ./happydom.ts ./src/pages/layout/commands.test.ts in packages/app.

Push verification also passed the repo pre-push bun turbo typecheck hook.

Screenshots / recordings

Not needed; this is a code organization change with no intended UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@anduimagui anduimagui changed the title refactor(app): move layout commands into dedicated module refactor(app): layout command palette -> dedicated module Mar 20, 2026
@anduimagui anduimagui changed the title refactor(app): layout command palette -> dedicated module refactor(app): move command palette to dedicated module Mar 20, 2026
Users can now open a dedicated command palette with mod+shift+p that shows
only commands, separate from the file search (mod+p). This makes finding
and executing commands faster without file results cluttering the view.

Also adds a new 'Edit Project' command to quickly access project settings
from anywhere via the command palette.
@anduimagui
anduimagui force-pushed the refactor/layout-commands-module branch from 071f7cb to b387634 Compare March 21, 2026 13:37
@rekram1-node

Copy link
Copy Markdown
Collaborator

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants