Skip to content

[codex] Add v2 workspace delete hotkey support#4673

Merged
Kitenite merged 5 commits into
mainfrom
delete-workspace-hotkey-d
May 17, 2026
Merged

[codex] Add v2 workspace delete hotkey support#4673
Kitenite merged 5 commits into
mainfrom
delete-workspace-hotkey-d

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented May 17, 2026

Summary

Adds v2 support for the existing current-workspace delete hotkey. The dashboard-level CLOSE_WORKSPACE binding now resolves the active v2 workspace and opens the v2 workspace destroy dialog for non-main workspaces, while preserving the existing v1 dialog path.

The v2 delete confirmation flow now accepts plain Enter to confirm in both the normal delete confirmation pane and the teardown-failed "Delete anyway" pane. A shared predicate keeps modifier/composition handling consistent and covered by a focused test.

Impact

Users can delete the current v2 workspace with the same keyboard shortcut already shown in the sidebar, then confirm from the keyboard without reaching for the mouse.

Root Cause

The hotkey was registered globally as CLOSE_WORKSPACE, but the dashboard layout only had v1 workspace data available when deciding what dialog to open. The v2 destroy dialog also only confirmed through click handlers.

Validation

  • bun test apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarDeleteDialog/utils/shouldConfirmDeleteDialogKey.test.ts
  • bun run lint
  • bun run --cwd apps/desktop typecheck

Open in Stage

Summary by cubic

Adds v2 support for the delete-current-workspace hotkey and keeps Enter-to-confirm in the v2 delete dialog. Pressing the CLOSE_WORKSPACE shortcut on a non‑main v2 workspace opens the v2 delete dialog; the v1 flow is unchanged.

  • New Features

    • CLOSE_WORKSPACE opens the v2 delete dialog when on a v2 (non‑main) workspace; v1 flow unchanged.
    • Plain Enter confirms in both the confirmation and teardown‑failed panes; modifiers and IME composition are ignored via shouldConfirmDeleteDialogKey (with tests).
    • Deleted v2 workspaces are removed from the sidebar after completion.
    • Context menus show the CLOSE_WORKSPACE shortcut on the active workspace in both the dashboard and workspace sidebars when assigned.
  • Refactors

    • Simplified v2 delete dialog open state management in the dashboard layout.

Written for commit 5786e9b. Summary will update on new commits. Review in cubic

Summary by CodeRabbit

  • New Features

    • Enter key now confirms workspace deletion and can trigger force-delete in failure dialogs
    • Dashboard supports deletion for v2 workspaces in addition to v1
    • Context menus and workspace items optionally display the configured "Close Workspace" hotkey when active and assigned
  • Tests

    • Added tests validating keyboard handling for delete confirmation dialogs

Review Change Stack

@capy-ai
Copy link
Copy Markdown

capy-ai Bot commented May 17, 2026

Capy auto-review is paused for this organization because the monthly auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 17, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3bd27bce-47a2-4dc5-9078-5d3b2b6c8358

📥 Commits

Reviewing files that changed from the base of the PR and between 892fe81 and 5786e9b.

📒 Files selected for processing (1)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/layout.tsx

📝 Walkthrough

Walkthrough

Adds a helper to detect plain Enter key presses, wires window keydown listeners into delete dialog panes to trigger confirm/force-delete, extends dashboard layout to support v2 workspace deletion via a DeleteTarget and live query, and shows the close-workspace hotkey in workspace menus when active.

Changes

V2 workspace deletion with keyboard confirmation

Layer / File(s) Summary
Keyboard confirmation utility
apps/desktop/src/renderer/.../DashboardSidebarDeleteDialog/utils/shouldConfirmDeleteDialogKey.ts, ...test.ts
ConfirmDeleteDialogKeyEvent interface and shouldConfirmDeleteDialogKey() validate plain Enter key presses, rejecting modified keys and IME composition events. Tests cover acceptance and rejection cases.
Dialog pane keyboard event listeners
apps/desktop/src/renderer/.../DestroyConfirmPane/DestroyConfirmPane.tsx, apps/desktop/src/renderer/.../TeardownFailedPane/TeardownFailedPane.tsx
useEffect hooks in both panes register window keydown listeners that call onConfirm() or onForceDelete() when shouldConfirmDeleteDialogKey() matches, with proper cleanup.
Dashboard layout v2 deletion state and imports
apps/desktop/src/renderer/.../layout.tsx
New DeleteTarget union type distinguishes v1 vs v2 deletion; imports added for v2 dialog component, useCollections provider, and database query utilities (eq, useLiveQuery).
Dashboard layout v2 workspace querying
apps/desktop/src/renderer/.../layout.tsx
Derive matched v2 workspace ID from route and establish live query over collections.v2Workspaces to fetch and expose currentV2Workspace for deletion operations.
Dashboard hotkey and deletion dialog wiring
apps/desktop/src/renderer/.../layout.tsx
CLOSE_WORKSPACE hotkey handler updated to set deleteTarget for both v1 and v2 (v2 gated by type !== "main"); v1 and v2 deletion dialogs rendered conditionally and wired with sidebar removal and state reset on deletion.
Show delete hotkey in workspace menus and list items
apps/desktop/src/renderer/.../DashboardSidebarWorkspaceContextMenu.tsx, .../WorkspaceContextMenu.tsx, .../CollapsedWorkspaceItem.tsx, .../WorkspaceListItem.tsx, ...WorkspaceItem.tsx
Propagate showDeleteHotkey (bound to isActive) into context menus and list items, add ContextMenuShortcut and useHotkeyDisplay, and conditionally render the close-workspace hotkey label when assigned.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 I press Enter plain, no modifiers to fuss,
V1 and V2 listen when the dialog's open for us,
A shortcut shows when active, gentle and fleet,
One key to confirm, the workflow feels neat. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title '[codex] Add v2 workspace delete hotkey support' clearly and specifically summarizes the main change: adding v2 workspace delete hotkey support to the dashboard.
Description check ✅ Passed The pull request description provides a comprehensive summary, related context, impact, root cause, and validation steps, going well beyond the template requirements.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch delete-workspace-hotkey-d

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@stage-review
Copy link
Copy Markdown

stage-review Bot commented May 17, 2026

Ready to review this PR? Stage has broken it down into 4 individual chapters for you:

Title
1 Define keyboard validation for delete confirmation
2 Enable Enter-to-confirm in v2 delete dialogs
3 Wire v2 workspace deletion to dashboard hotkey
4 Display delete hotkey in context menus
Open in Stage

Chapters generated by Stage for commit 5786e9b on May 17, 2026 6:19pm UTC.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 17, 2026

Greptile Summary

This PR wires the existing CLOSE_WORKSPACE hotkey to v2 workspaces: DashboardLayout now queries the active v2 workspace via useLiveQuery, opens DashboardSidebarDeleteDialog on the hotkey, and dispatches through a new DeleteTarget union type that keeps v1 and v2 dialogs on separate branches. Both DestroyConfirmPane and TeardownFailedPane gain a window keydown listener so plain Enter confirms the dialog without reaching for the mouse.

  • layout.tsx — extends DeleteTarget to a v1/v2 union, adds a useLiveQuery for the current v2 workspace, and conditionally renders DashboardSidebarDeleteDialog next to the existing DeleteWorkspaceDialog.
  • DestroyConfirmPane / TeardownFailedPane — each adds a useEffect that attaches a window-level keydown listener (guarded by open) using the new shouldConfirmDeleteDialogKey predicate.
  • shouldConfirmDeleteDialogKey + test — a new shared pure function that accepts only unmodified Enter while rejecting IME composition, all modifier combos, and non-Enter keys.

Confidence Score: 3/5

The hotkey and dialog wiring is correct, but the window-level Enter listener in both confirmation panes does not check the focused element, so a user who tabs to the Cancel button and presses Enter will trigger workspace deletion instead of dismissal.

The core routing and state logic in layout.tsx is sound and the shouldConfirmDeleteDialogKey predicate and its tests are well-written. However, the window.addEventListener keydown approach in DestroyConfirmPane and TeardownFailedPane intercepts Enter unconditionally — including when a Cancel button is focused — calling event.preventDefault() which suppresses the button's native Enter→click, then immediately invoking the destructive action. This is a real, reproducible way for a keyboard user to accidentally delete a workspace when trying to cancel.

DestroyConfirmPane.tsx and TeardownFailedPane.tsx need an event.target instanceof HTMLButtonElement guard before the confirm logic fires.

Important Files Changed

Filename Overview
apps/desktop/src/renderer/routes/_authenticated/_dashboard/layout.tsx Adds v2 workspace delete hotkey support via a new DeleteTarget union type and a useLiveQuery for the active v2 workspace; the v2 dialog dismiss handler keeps the component mounted rather than clearing state to null as v1 does.
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarDeleteDialog/components/DestroyConfirmPane/DestroyConfirmPane.tsx Adds a window-level keydown listener to confirm deletion on Enter; the listener does not filter button targets, so pressing Enter while the Cancel button is focused calls onConfirm() instead of dismissing the dialog.
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarDeleteDialog/components/TeardownFailedPane/TeardownFailedPane.tsx Adds the same window-level Enter keydown listener to trigger force-delete; inherits the same Cancel-button focus issue as DestroyConfirmPane.
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarDeleteDialog/utils/shouldConfirmDeleteDialogKey.ts New pure predicate that correctly guards for unmodified Enter, composition events (isComposing / keyCode 229), and all modifier keys.
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarDeleteDialog/utils/shouldConfirmDeleteDialogKey.test.ts Focused unit tests covering the predicate for plain Enter, all modifier combinations, IME composition, and non-Enter keys — all cases correctly verified.
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarDeleteDialog/components/DestroyConfirmPane/DestroyConfirmPane.tsx:45-56
**Enter on Cancel button triggers accidental deletion**

The `window` keydown listener fires during the bubble phase for every keydown in the document, including when focus is on the Cancel button. Pressing Enter with the Cancel button focused calls `event.preventDefault()` (suppressing the button's native Enter→click activation) and then calls `onConfirm()`, which deletes the workspace. The user intended to cancel but instead confirms a destructive action.

The same pattern applies to `TeardownFailedPane` — pressing Enter on its Cancel button calls `onForceDelete()`.

The fix is to exit early when the event target is any button element, letting normal button click-from-Enter behavior proceed unimpeded: add `if (event.target instanceof HTMLButtonElement) return;` before the `shouldConfirmDeleteDialogKey` call in both components.

### Issue 2 of 2
apps/desktop/src/renderer/routes/_authenticated/_dashboard/layout.tsx:222-227
**V2 dismiss leaks a mounted-but-hidden dialog**

When the user dismisses the v2 delete dialog (Escape or clicking outside), `onOpenChange(false)` sets `deleteTarget.open = false` but leaves `DashboardSidebarDeleteDialog` mounted indefinitely. The v1 path sets `deleteTarget` to `null` on close, which unmounts the component. Because `useDestroyDialogState` already resets both `error` and `inspectState` to their initial values when `open` goes `false`, there is no state worth preserving across a dismiss — setting `deleteTarget` to `null` here, as v1 does, would match that behavior and avoid keeping the component alive unnecessarily.

Reviews (1): Last reviewed commit: "Add v2 workspace delete hotkey support" | Re-trigger Greptile

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
apps/desktop/src/renderer/routes/_authenticated/_dashboard/layout.tsx (1)

218-227: ⚡ Quick win

Clear the v2 delete target when the dialog closes.

Unlike the v1 path, closing the v2 dialog keeps the component mounted with deleteTarget.version === "v2". That is a risky fit with the new document-level Enter listeners added to the v2 delete panes in this PR. Mirror the v1 behavior and reset the state to null when open becomes false.

Suggested change
 			{deleteTarget?.version === "v2" && (
 				<DashboardSidebarDeleteDialog
 					workspaceId={deleteTarget.workspaceId}
 					workspaceName={deleteTarget.workspaceName}
 					open={deleteTarget.open}
 					onOpenChange={(open) => {
-						setDeleteTarget((target) =>
-							target?.version === "v2" ? { ...target, open } : target,
-						);
+						setDeleteTarget((target) => {
+							if (target?.version !== "v2") return target;
+							return open ? { ...target, open: true } : null;
+						});
 					}}
 					onDeleted={() => {
 						removeWorkspaceFromSidebar(deleteTarget.workspaceId);
 						setDeleteTarget(null);
 					}}
 				/>
 			)}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/desktop/src/renderer/routes/_authenticated/_dashboard/layout.tsx` around
lines 218 - 227, The v2 delete dialog handler leaves deleteTarget.version ===
"v2" mounted when closed; update the onOpenChange for
DashboardSidebarDeleteDialog so that when open becomes false you clear the v2
target (call setDeleteTarget(null)) and when open is true preserve/update the
target (e.g., set the { ...target, open } only if target?.version === "v2");
reference: deleteTarget, DashboardSidebarDeleteDialog, setDeleteTarget.
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarDeleteDialog/utils/shouldConfirmDeleteDialogKey.test.ts (1)

17-24: ⚡ Quick win

Consider adding test coverage for ctrlKey and altKey modifiers.

The test verifies rejection of metaKey and shiftKey, but the implementation also rejects ctrlKey and altKey (source lines 19-20). Adding cases for those modifiers would complete the coverage.

🧪 Proposed test additions
 	test("rejects modified Enter", () => {
 		expect(shouldConfirmDeleteDialogKey({ ...plainEnter, metaKey: true })).toBe(
 			false,
 		);
 		expect(
 			shouldConfirmDeleteDialogKey({ ...plainEnter, shiftKey: true }),
 		).toBe(false);
+		expect(
+			shouldConfirmDeleteDialogKey({ ...plainEnter, ctrlKey: true }),
+		).toBe(false);
+		expect(
+			shouldConfirmDeleteDialogKey({ ...plainEnter, altKey: true }),
+		).toBe(false);
 	});
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarDeleteDialog/utils/shouldConfirmDeleteDialogKey.test.ts`
around lines 17 - 24, The test file only checks that
shouldConfirmDeleteDialogKey rejects modified Enter for metaKey and shiftKey but
omits ctrlKey and altKey; add assertions in the "rejects modified Enter" test to
also expect shouldConfirmDeleteDialogKey({ ...plainEnter, ctrlKey: true }) and
shouldConfirmDeleteDialogKey({ ...plainEnter, altKey: true }) to be false so all
modifier branches in shouldConfirmDeleteDialogKey are covered.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarDeleteDialog/utils/shouldConfirmDeleteDialogKey.test.ts`:
- Around line 17-24: The test file only checks that shouldConfirmDeleteDialogKey
rejects modified Enter for metaKey and shiftKey but omits ctrlKey and altKey;
add assertions in the "rejects modified Enter" test to also expect
shouldConfirmDeleteDialogKey({ ...plainEnter, ctrlKey: true }) and
shouldConfirmDeleteDialogKey({ ...plainEnter, altKey: true }) to be false so all
modifier branches in shouldConfirmDeleteDialogKey are covered.

In `@apps/desktop/src/renderer/routes/_authenticated/_dashboard/layout.tsx`:
- Around line 218-227: The v2 delete dialog handler leaves deleteTarget.version
=== "v2" mounted when closed; update the onOpenChange for
DashboardSidebarDeleteDialog so that when open becomes false you clear the v2
target (call setDeleteTarget(null)) and when open is true preserve/update the
target (e.g., set the { ...target, open } only if target?.version === "v2");
reference: deleteTarget, DashboardSidebarDeleteDialog, setDeleteTarget.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 14219042-a1dc-4596-a594-3ed037a8e170

📥 Commits

Reviewing files that changed from the base of the PR and between e790629 and 969d46e.

📒 Files selected for processing (5)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarDeleteDialog/components/DestroyConfirmPane/DestroyConfirmPane.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarDeleteDialog/components/TeardownFailedPane/TeardownFailedPane.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarDeleteDialog/utils/shouldConfirmDeleteDialogKey.test.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarDeleteDialog/utils/shouldConfirmDeleteDialogKey.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/layout.tsx

Comment on lines +45 to +56
useEffect(() => {
if (!open || !canConfirm) return;

const handleKeyDown = (event: KeyboardEvent) => {
if (!shouldConfirmDeleteDialogKey(event)) return;
event.preventDefault();
onConfirm();
};

window.addEventListener("keydown", handleKeyDown);
return () => window.removeEventListener("keydown", handleKeyDown);
}, [canConfirm, onConfirm, 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.

P1 Enter on Cancel button triggers accidental deletion

The window keydown listener fires during the bubble phase for every keydown in the document, including when focus is on the Cancel button. Pressing Enter with the Cancel button focused calls event.preventDefault() (suppressing the button's native Enter→click activation) and then calls onConfirm(), which deletes the workspace. The user intended to cancel but instead confirms a destructive action.

The same pattern applies to TeardownFailedPane — pressing Enter on its Cancel button calls onForceDelete().

The fix is to exit early when the event target is any button element, letting normal button click-from-Enter behavior proceed unimpeded: add if (event.target instanceof HTMLButtonElement) return; before the shouldConfirmDeleteDialogKey call in both components.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarDeleteDialog/components/DestroyConfirmPane/DestroyConfirmPane.tsx
Line: 45-56

Comment:
**Enter on Cancel button triggers accidental deletion**

The `window` keydown listener fires during the bubble phase for every keydown in the document, including when focus is on the Cancel button. Pressing Enter with the Cancel button focused calls `event.preventDefault()` (suppressing the button's native Enter→click activation) and then calls `onConfirm()`, which deletes the workspace. The user intended to cancel but instead confirms a destructive action.

The same pattern applies to `TeardownFailedPane` — pressing Enter on its Cancel button calls `onForceDelete()`.

The fix is to exit early when the event target is any button element, letting normal button click-from-Enter behavior proceed unimpeded: add `if (event.target instanceof HTMLButtonElement) return;` before the `shouldConfirmDeleteDialogKey` call in both components.

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +222 to +227
open={deleteTarget.open}
onOpenChange={(open) => {
setDeleteTarget((target) =>
target?.version === "v2" ? { ...target, open } : target,
);
}}
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 V2 dismiss leaks a mounted-but-hidden dialog

When the user dismisses the v2 delete dialog (Escape or clicking outside), onOpenChange(false) sets deleteTarget.open = false but leaves DashboardSidebarDeleteDialog mounted indefinitely. The v1 path sets deleteTarget to null on close, which unmounts the component. Because useDestroyDialogState already resets both error and inspectState to their initial values when open goes false, there is no state worth preserving across a dismiss — setting deleteTarget to null here, as v1 does, would match that behavior and avoid keeping the component alive unnecessarily.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/renderer/routes/_authenticated/_dashboard/layout.tsx
Line: 222-227

Comment:
**V2 dismiss leaks a mounted-but-hidden dialog**

When the user dismisses the v2 delete dialog (Escape or clicking outside), `onOpenChange(false)` sets `deleteTarget.open = false` but leaves `DashboardSidebarDeleteDialog` mounted indefinitely. The v1 path sets `deleteTarget` to `null` on close, which unmounts the component. Because `useDestroyDialogState` already resets both `error` and `inspectState` to their initial values when `open` goes `false`, there is no state worth preserving across a dismiss — setting `deleteTarget` to `null` here, as v1 does, would match that behavior and avoid keeping the component alive unnecessarily.

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarDeleteDialog/utils/shouldConfirmDeleteDialogKey.test.ts (1)

4-10: ⚡ Quick win

Add explicit type annotation to the mock object.

The plainEnter object lacks a type annotation. Explicitly typing it as ConfirmDeleteDialogKeyEvent (or the expected event type) would improve type safety and make the test more self-documenting. As per coding guidelines, TypeScript code should prioritize type safety.

🔧 Suggested typing improvement
+import type { ConfirmDeleteDialogKeyEvent } from "./shouldConfirmDeleteDialogKey";
+
-const plainEnter = {
+const plainEnter: ConfirmDeleteDialogKeyEvent = {
 	key: "Enter",
 	shiftKey: false,
 	metaKey: false,
 	ctrlKey: false,
 	altKey: false,
 };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarDeleteDialog/utils/shouldConfirmDeleteDialogKey.test.ts`
around lines 4 - 10, Add an explicit type annotation to the mock event object
`plainEnter`: declare it as `ConfirmDeleteDialogKeyEvent` (or the exact event
type used by `shouldConfirmDeleteDialogKey`) so the test gains type safety and
self-documentation; update the `plainEnter` variable declaration to use that
type to satisfy TypeScript checks and align with coding guidelines.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarDeleteDialog/utils/shouldConfirmDeleteDialogKey.test.ts`:
- Around line 4-10: Add an explicit type annotation to the mock event object
`plainEnter`: declare it as `ConfirmDeleteDialogKeyEvent` (or the exact event
type used by `shouldConfirmDeleteDialogKey`) so the test gains type safety and
self-documentation; update the `plainEnter` variable declaration to use that
type to satisfy TypeScript checks and align with coding guidelines.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 79976492-d6af-4c45-aca5-8db3009ab24e

📥 Commits

Reviewing files that changed from the base of the PR and between 2f3f2f9 and 892fe81.

📒 Files selected for processing (2)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarDeleteDialog/utils/shouldConfirmDeleteDialogKey.test.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/layout.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/layout.tsx

@Kitenite Kitenite merged commit 2d38c4f into main May 17, 2026
9 of 10 checks passed
@Kitenite Kitenite deleted the delete-workspace-hotkey-d branch May 17, 2026 18:21
@github-actions
Copy link
Copy Markdown
Contributor

ghost commented May 17, 2026

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch

Thank you for your contribution! 🎉

sazabi Bot pushed a commit that referenced this pull request May 20, 2026
* Add v2 workspace delete hotkey support

* Show workspace delete hotkey in context menus

* Address delete dialog review feedback

* Keep Enter as delete dialog confirm

* Simplify v2 delete dialog state
MocA-Love pushed a commit to MocA-Love/superset that referenced this pull request May 25, 2026
* Add v2 workspace delete hotkey support

* Show workspace delete hotkey in context menus

* Address delete dialog review feedback

* Keep Enter as delete dialog confirm

* Simplify v2 delete dialog state
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