Skip to content

vscode: replace popup dialogs (modals + action toasts) with keyboard-first QuickPicks for accessibility #797

Open

Description

@amrmelsayed

Problem

Codev's popup prompts use VS Code's native notification API, which is fundamentally mouse-only for anything beyond Enter/Esc. The clearest example: when a builder hits plan-approval, the popup offers Approve Gate and View Plan buttons — neither is reachable via Tab, arrow keys, or any keyboard navigation. The user must take their hand off the keyboard, find the mouse, and click. This affects keyboard-driven workflows, accessibility, and anyone running VS Code without a pointing device.

This isn't unique to plan-approval — the same pattern recurs in every Codev popup that carries action buttons: the swap-dev confirmation, builder-spawned "Open Terminal" toast, gate-blocked notifications, and others.

Root cause

vscode.window.showInformationMessage(msg, { modal: true }, ...buttons) (and the non-modal variants) explicitly only bind:

  • Enter → first/primary button
  • Esc → cancel / dismiss

Additional buttons are rendered but have no keyboard binding. This is a VS Code platform limitation we can't override by configuration — the only fix is to stop using the API for action prompts.

Current state

Audit results from 2026-05-21 identified these popup sites with action buttons that need replacing:

File:line Trigger Buttons today
commands/approve.ts:127 Plan/spec/dev approval prompt (modal) Approve + optional View Plan
commands/dev-shared.ts:110–113 Swap dev target confirmation (modal) Yes / No
builder-spawn-handler.ts:63 Builder spawned (non-modal toast) Open Terminal
notifications/gate-toast.ts:131 Gate blocked passive toast (non-modal) [action-label], Approve

Proposed behavior

Replace every popup that carries action buttons with vscode.window.showQuickPick(actions):

  • Arrow keys to move between actions, type to filter, Enter to select, Esc to cancel.
  • The most common action (e.g. Approve Gate for approval prompts, Open Terminal for spawn-completion) is the first row so Enter is the fast-path.
  • A Cancel row is added explicitly (and Esc remains a synonym) so cancel is always one keystroke.
  • The QuickPick title carries the same context the modal used to (Approve plan-approval for #773?).

Apply to all popups with any buttons — not just modals. Non-modal toasts with action buttons (spawn-completion, gate-blocked) also get the QuickPick treatment so the keyboard path is uniform across the extension.

Plain notifications without buttons (success status, info-only toasts) stay as setStatusBarMessage / showInformationMessage — there's nothing to navigate.

Adopt a shared helper (e.g. actionPick(title: string, actions: { label, detail?, run }[])) so each call site is a one-liner and the keyboard-first semantics stay consistent.

Acceptance criteria

  • Shared actionPick(...) helper exists in packages/vscode/src/notifications/ (or similar) returning the selected action's run or undefined on cancel.
  • commands/approve.ts:127 uses actionPick — Tab/arrow keys navigate; Enter approves; Esc cancels; View Plan is selectable via keyboard.
  • commands/dev-shared.ts:110–113 uses actionPick — same keyboard guarantees.
  • builder-spawn-handler.ts:63 uses actionPick — the spawn-completion toast becomes a QuickPick when the user has focus available, or its Open Terminal action becomes accessible through some keyboard surface.
  • notifications/gate-toast.ts:131 uses actionPick for its action buttons.
  • Every replaced popup has explicit Cancel in the row list, and Esc is honored as cancel.
  • No regression: prompts that the user accepts with Enter still complete in one keystroke.
  • Plain info / success / status-bar messages with no buttons are untouched.

Out of scope

  • Adding global keybindings to skip popups entirely (separate improvement; can be a follow-up).
  • Webview-based dialogs (intentionally rejected — QuickPick is the right tool here).
  • Restructuring how confirmations are decided (only the prompt UI changes; the decision-to-prompt logic stays).
  • Internationalization / localization of the QuickPick text.

Related

Activity

  1. self-assigned this
    on May 21, 2026
  2. added
    type:feature
    area/vscode
    project
    and removed
    type:feature
    on May 21, 2026
  3. amrmelsayed commented on Aug 14, 2026

    @amrmelsayed
    CollaboratorAuthor

    The Stream Deck workflow raises this from an accessibility improvement to a blocking usability defect, and it is worth restating the priority in those terms.

    Reported by the owner: pressing the deck's Approve Gate key surfaces this modal, and completing the approval then requires reaching for a mouse — which defeats the entire point of a hardware controller. The deck exists so review and approval happen without leaving the keyboard or the device; a mouse trip in the middle of that flow is not a rough edge, it is the workflow breaking.

    Two mechanics make it worse than the issue text above suggests:

    1. On the two gates that matter most, Enter does not approve. approve.ts:125 builds the button array as [sideAction.label, 'Approve'], and plan-approval / dev-approval both have side actions (View Plan, Run Dev). Since the platform binds Enter to the first button only, Enter fires the side action, and Approve is reachable by mouse alone. Gates without a side action (spec-approval, pr) do approve on Enter. So the keyboard path is worst on exactly the gates a reviewer hits most.

    2. The deck cannot bypass the modal, by design. command-relay.ts:95-101 deliberately truncates the argument list for this one verb:

      // SECURITY: `approve-gate` surfaces the human-confirmation modal; its command
      // ALSO accepts an `{ skipConfirmation }` options arg ... A controller must never
      // reach that path, so forward ONLY the builder id (first arg).
      const callArgs = req.verb === 'approve-gate' ? args.slice(0, 1) : args;

      That is correct and should stay: the wire cannot attest that a verb came from a human finger rather than from a local process holding the key, and "only a human approves a gate" is a core invariant. The modal is the step that proves a human is present.

    So the fix is not to let the deck skip confirmation — it is to make the confirmation completable from the keyboard, which is exactly what this issue proposes. With actionPick, the flow becomes: press the deck key, a QuickPick appears focused in the trusted UI, press Enter. No mouse, security model untouched, and View Plan / Run Dev become reachable rather than accidentally-primary.

    Honest limit of that fix: it makes the flow keyboard-only, not device-only. The reviewer's hand still moves to the keyboard for one keystroke. Going fully hands-free would mean confirming on the deck itself (press once to arm, press again to approve), which moves the human-confirmation step onto the wire — precisely what the security comment above forbids, and not something a distinct verb can rescue, since any client able to send one verb can send the other. That trade is a policy decision for the gate owner, not an implementation detail, and it should be settled deliberately rather than arrived at by accident. This issue should proceed on the keyboard-first design regardless; it is strictly better than today under either policy.

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

Metadata

Metadata

Assignees

Labels

area/vscodeproject

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions