Skip to content

fix(app): make Cmd/Ctrl+N start a new session from the composer - #6470

Merged
benjaminshafii merged 1 commit into
devfrom
fix/cmd-n-new-session
Oct 24, 2026
Merged

benjaminshafii merged 1 commit into
devfrom
fix/cmd-n-new-session

Conversation

@benjaminshafii

@benjaminshafii benjaminshafii commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

What is this about?

Cmd+N (Ctrl+N on Windows/Linux) in the desktop app now always starts a new session, just like Cmd+K → "New session".

What problem does it solve?

Pressing Cmd+N usually did nothing, so people fell back to the command palette or the sidebar button.

What was the situation before?

With the cursor in the chat composer (nearly always), Cmd+N was silently ignored. It also did nothing when the selected model was unavailable or the workspace was still loading, even though the palette's "New session" worked.

How is this implemented?

  • shell/new-session-shortcut.ts: pure isNewSessionShortcut (Mod+N, OS-aware, no Shift/Alt/AltGr).
  • shell/use-shell-shortcuts.ts: handled in a capture-phase keydown listener (like Cmd+1–9), no longer skipped in text fields; an open modal dialog keeps the key; key repeat opens one draft.
  • shell/session-route.tsx: Cmd+N and the palette share createNewSessionInSelectedWorkspace; the hook takes onCreateNewSession instead of canCreateTask/workspaceId/onCreateTask.

What else changed?

  • Settings → Keyboard shortcuts row "New chat" renamed to "New session" to match the product.

Release note

Cmd+N (Ctrl+N) now starts a new session even while you're typing in the chat box.

Evidence

No E2E spec changed. apps/app/tests/new-session-shortcut.test.tsx covers the predicate, focused composer/input, an editor that stops propagation, key repeat, and an open dialog. Also checked by hand in dev-app-web over CDP: from an existing session with the composer focused, Cmd+N opens the new-session draft and the composer stays focused. With the palette open, Cmd+N does nothing.

Cmd/Ctrl+N was ignored whenever an input, textarea or contenteditable had
focus (`!inEditable` guard). The chat composer is focused almost all the
time, so the shortcut silently did nothing. It was also gated on
`canCreateTask` (client connected, not loading, model available), while the
command palette's "New session" only needs a selected workspace, even though
both now just open the navigation-only new-session draft.

- Add isNewSessionShortcut (Mod+N, no Shift/Alt/AltGr, OS-aware).
- Handle it in a capture-phase keydown listener so editor handlers cannot
  swallow it; an open modal dialog still keeps the key; key repeat does not
  open one draft per repeat.
- Cmd/Ctrl+N and the palette now call the same
  createNewSessionInSelectedWorkspace callback.
- Rename the settings shortcuts row "New chat" to "New session".

No native menu accelerator binds CmdOrCtrl+N, so nothing in the Electron
main process intercepts the key.
@vercel

vercel Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-app Ready Ready Preview Oct 24, 2026 1:33pm UTC
3 Skipped Deployments
Project Deployment Actions Updated
openwork-den Skipped Skipped Oct 24, 2026 1:33pm UTC
openwork-diagnostics Skipped Skipped Oct 24, 2026 1:33pm UTC
openwork-landing Skipped Skipped v0 Oct 24, 2026 1:33pm UTC

Request Review

@benjaminshafii
benjaminshafii deployed to pr-internal-specs October 24, 2026 13:32 — with GitHub Actions Active
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

OpenWork evidence

Status Commit Preview Updated
🟢 Ready · evidence passed 5c7da5d Open preview 2026-10-24 13:40:17 UTC

Run details · Open the preview to inspect evidence and sandbox options.

@diff-warden diff-warden Bot left a comment

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.

Warden clearance. Complete security and confidentiality review of 5c7da5d3731d242c10e717709084a3ce72949433 found no high or medium security findings and no confidentiality findings. Any new push dismisses this approval. Analysis run

@diff-warden

diff-warden Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Warden: approved

No high or medium security findings and no confidentiality findings.

Reviewed 5c7da5d3731d · Warden run · Updates after every Warden run.

@benjaminshafii
benjaminshafii merged commit 05de6a3 into dev Oct 24, 2026
46 checks passed

This branch was successfully deployed

3 active and 3 inactive deployments
Evidence / PR 6470 — 5c7da5d3 Deployed Oct 24, 2026 by github-actions[bot]
Preview – openwork-app — 5c7da5d3 Deployed Oct 24, 2026 by vercel[bot]
Preview – openwork-den — 5c7da5d3 Deployed Oct 24, 2026 by vercel[bot]
Preview – openwork-diagnostics — 5c7da5d3 Deployed Oct 24, 2026 by vercel[bot]
Preview – openwork-landing — 5c7da5d3 Deployed Oct 24, 2026 by vercel[bot]
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