Skip to content

Drop-workspace confirmation dialog doesn't close on Escape #16

Description

@ovdmar

Context

While reviewing #8 (dialog centering fix) we noticed the drop-workspace confirmation dialog at `apps/web/src/workspace-card.tsx` (`DropWorkspaceDialog`) is the only confirmation dialog in the cockpit that does not dismiss on the `Escape` key. The other two centered dialogs both wire up `Escape`:

  • `Modal` (`apps/web/src/modals.tsx`, used by Add repo / Create workspace) — has a `window` keydown listener.
  • Command palette (`apps/web/src/command-palette.tsx`) — handles `Escape` inside the dialog's own `onKeyDown`.

That inconsistency is UX debt — keyboard users have to click the backdrop to dismiss it.

Fix

Add an `Escape` handler to `DropWorkspaceDialog` matching the pattern used by `Modal` (window-level `keydown` listener that calls `props.onClose()` and is removed on unmount).

Out of scope for #8

#8 is a centering-only fix; behavior changes were intentionally not bundled in. Filing this so it isn't forgotten.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions