Skip to content

fix(menu): route Cmd+N to new chat session#733

Open
kagura-agent wants to merge 2 commits intoValueCell-ai:mainfrom
kagura-agent:fix/cmd-n-blank-window
Open

fix(menu): route Cmd+N to new chat session#733
kagura-agent wants to merge 2 commits intoValueCell-ai:mainfrom
kagura-agent:fix/cmd-n-blank-window

Conversation

@kagura-agent
Copy link
Copy Markdown
Contributor

Problem

Pressing Cmd+N (File → New Chat) opens a blank window because menu.ts sends navigate('/chat'), but no /chat route exists in React Router.

The same issue affects Navigate → Chat (Cmd+2).

Fix

  • File → New Chat (Cmd+N): Send new new-chat IPC event instead of navigate('/chat'). Renderer listens and calls newSession() + navigate('/') (matching Sidebar behavior).
  • Navigate → Chat (Cmd+2): Change navigate('/chat') to navigate('/').

Testing

  • All 346 tests pass
  • Verified menu IPC events route correctly

Closes #720

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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);
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 Badge 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 👍 / 👎.

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.

Bug: Cmd+N opens a blank app window instead of creating a new session

1 participant