feat(desktop): support opening sessions in multiple windows#40499
Open
izumi0uu wants to merge 1 commit into
Open
feat(desktop): support opening sessions in multiple windows#40499izumi0uu wants to merge 1 commit into
izumi0uu wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds first-pass multi-window support to Hermes Desktop so the app can open the same profile in multiple independent windows.
This keeps the existing shared desktop/backend model and extends the Electron shell to manage multiple
BrowserWindowinstances. It adds the entry points requested in the issue (File > New Window,Cmd/Ctrl+Shift+N, and a session context-menu action), then makes window-targeted IPC and window-scoped UI state work correctly for those extra windows.Because multiple windows can resume the same stored session at different times, this PR also refreshes cached session state from stored messages on resume and when a window regains focus. That keeps a second window from showing a stale transcript after another window has continued the conversation.
Related Issue
Fixes #40394
Type of Change
Changes Made
BrowserWindowinstances inapps/desktop/electron/main.cjsFile > New Window,Window > New Windowon macOS, andCmd/Ctrl+Shift+NOpen in New Windowto the session sidebar actions menuopenWindow()desktop bridge throughpreload.cjsHow to Test
apps/desktop, runnpm run type-check.apps/desktop, runnpx vitest run src/app/chat/sidebar/session-actions-menu.test.tsxandnpx vitest run --environment jsdom src/app/session/hooks/use-session-actions.test.tsx.File > New Windowopens a second desktop windowCmd+Shift+Nopens another windowOpen in New Windowopens that session in a separate windowChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
N/A