Skip to content

feat(staged): delete project with command shortcut - #832

Merged
matt2e merged 2 commits into
mainfrom
command-delete
Jun 29, 2026
Merged

feat(staged): delete project with command shortcut#832
matt2e merged 2 commits into
mainfrom
command-delete

Conversation

@matt2e

@matt2e matt2e commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a keyboard shortcut and macOS menu item to delete the current project from the project view.

  • Menu item: adds a "Delete Project" entry to the Edit menu (CmdOrCtrl+Backspace), wired through to a menu:delete-project event.
  • Shortcut: registers an app-delete-project shortcut (Cmd+Backspace / Cmd+Delete) that dispatches a cancelable staged:delete-current-project event, but only when no text input is focused and the active route is a project.
  • Project deletion: ProjectHome listens for the event and triggers the existing delete-project flow for the selected project.

Guards

  • The shortcut is ignored while a text input/textarea/select/contenteditable is focused.
  • A deleteShortcutPending flag guards against a held key firing the delete repeatedly while the async safe-to-delete check is in flight, and the handler bails out if a delete/new-project/add-repo modal is already open.

@matt2e
matt2e requested review from baxen and wesbillman as code owners June 29, 2026 06:35

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

Copy link
Copy Markdown

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: 73da4cd092

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +816 to +818
void handleDeleteProjectRequest(selectedProject).finally(() => {
deleteShortcutPending = false;
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Suppress repeated delete shortcut until keyup

When the current project is safe to delete, such as a project with repoCount === 0, handleDeleteProjectRequest can finish before the user releases Cmd+Backspace. This finally then clears the only repeat guard after confirmDeleteProject() has already navigated to the next project, so subsequent auto-repeat keydown events from the same key hold will dispatch again and remove additional projects without another confirmation. Keep the shortcut latched until keyup or ignore KeyboardEvent.repeat for this destructive action.

Useful? React with 👍 / 👎.

matt2e added 2 commits June 29, 2026 16:38
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Holding Cmd+Backspace on a safe-to-delete project could start multiple
deleteProject calls, since none of the shortcut's guard conditions
(selectedProjectDeleting, projectToDelete, etc.) are set until the async
canDeleteProjectWithoutConfirmation check resolves. Repeated keydown
events would each dispatch handleDeleteProjectRequest before any guard
flipped.

Add a synchronous deleteShortcutPending flag set before dispatching and
cleared once the request settles, so a held key only deletes once.

Signed-off-by: Matt Toohey <contact@matttoohey.com>
@matt2e
matt2e merged commit 5e12909 into main Jun 29, 2026
4 checks passed
@matt2e
matt2e deleted the command-delete branch June 29, 2026 07:07
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