fix(menu): route Cmd+N to new chat session#733
fix(menu): route Cmd+N to new chat session#733kagura-agent wants to merge 2 commits intoValueCell-ai:mainfrom
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fcdfea1892
ℹ️ 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".
| navigate('/'); | ||
| }; | ||
|
|
||
| const unsubscribe = window.electron.ipcRenderer.on('new-chat', handleNewChat); |
There was a problem hiding this comment.
Allowlist new IPC channel before subscribing
Subscribing to window.electron.ipcRenderer.on('new-chat', ...) will throw at runtime because the preload bridge only permits channels listed in electron/preload/index.ts, and 'new-chat' is not in that allowlist (on() throws Invalid IPC channel for unknown values). This means the new effect can fail during app startup and the Cmd/Ctrl+N flow never gets a listener in production builds unless the preload allowlist is updated to include this event.
Useful? React with 👍 / 👎.
Problem
Pressing Cmd+N (File → New Chat) opens a blank window because
menu.tssendsnavigate('/chat'), but no/chatroute exists in React Router.The same issue affects Navigate → Chat (Cmd+2).
Fix
new-chatIPC event instead ofnavigate('/chat'). Renderer listens and callsnewSession()+navigate('/')(matching Sidebar behavior).navigate('/chat')tonavigate('/').Testing
Closes #720