Skip to content

feat(desktop): open any chat in its own window#43219

Merged
OutThisLife merged 1 commit into
mainfrom
bb/desktop-session-windows
Jun 10, 2026
Merged

feat(desktop): open any chat in its own window#43219
OutThisLife merged 1 commit into
mainfrom
bb/desktop-session-windows

Conversation

@OutThisLife

Copy link
Copy Markdown
Collaborator

Supersedes #39887 (salvage — rebased on main, traffic-light overlap fixed, /-click gesture added, label/icon polished, strings i18n'd). Original work and design by @tim404x, kept as co-author.

What

Pop any session into a standalone, focused window so you can run several chats side by side.

  • A secondary window loads the renderer at the session route with a ?win=secondary flag (ahead of the HashRouter #). It drops the global sidebar + install/onboarding overlays and renders a single chat, sharing the one local gateway over WS — no backend duplication.
  • The main process keys windows by sessionId: re-opening a chat focuses the existing window instead of duplicating, and each window self-cleans from the registry on close.
  • minWidth is already 400 on main, so narrow windows tile cleanly.

Open it via

  • -click (mac) / -click (win/linux) a sidebar session — the universal "open in a new window" gesture. Archive moved to the / right-click menus only, off the easy-to-misfire modifier-click.
  • "New window" in the session and right-click menus (link-external icon, i18n'd across en/ja/zh/zh-hant).

Salvage notes (delta vs #39887)

  • Traffic-light overlap fixed. A standalone window has no left rail, but the PR left sidebarOpen truthy, so AppShell computed a 0 titlebar inset and the chat title slid under the macOS traffic lights. leftEdgePaneOpen now also accounts for isSecondaryWindow(), so the edge reads as uncovered and the existing --titlebar-content-inset clears the lights — chrome handling stays in the shell instead of the bare-chat path.
  • Merged current main (slim-down sidebar work: hoverReveal + forceCollapsed); the sidebar pane keeps that treatment, gated off for secondary windows.
  • /-click gesture to skip the menu, with archive demoted to menu-only.
  • Polish: menu item relabeled Open in New WindowNew window, icon multiple-windowslink-external, string moved into i18n.

Tests

  • src/store/windows.test.ts (vitest jsdom) — 8 passing.
  • electron/session-windows.test.cjs (node --test) — 10 passing.
  • tsc -b + eslint clean.

🤖 Generated with Cursor

Pops a session into a standalone, focused window for side-by-side work.
A secondary window loads the renderer at the session route with a
?win=secondary flag (ahead of the HashRouter '#'); it drops the global
sidebar plus the install/onboarding overlays and renders a single chat,
sharing the one local gateway over WS (no backend duplication). The main
process keys windows by sessionId so re-opening focuses the existing one
and self-cleans on close.

Open it via:
- ⌘-click (mac) / ⌃-click (win/linux) a sidebar session — the universal
  "open in new window" gesture. Archive moves to the ⋯ / right-click menus
  only, off the easy-to-misfire modifier-click.
- "New window" in the session ⋯ and context menus (link-external icon,
  i18n'd across en/ja/zh/zh-hant).

A standalone window has no left rail, so AppShell treats its edge as
uncovered and applies the titlebar inset — the chat title clears the
macOS traffic lights instead of hiding behind them.

Co-authored-by: tim404x <tim404x@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

🔎 Lint report: bb/desktop-session-windows vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 10620 on HEAD, 10620 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 5564 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@jquesnelle jquesnelle left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

@OutThisLife OutThisLife merged commit b96bd48 into main Jun 10, 2026
20 checks passed
@OutThisLife OutThisLife deleted the bb/desktop-session-windows branch June 10, 2026 02:09

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review Summary

Verdict: Approved

Looks Good

  • Clean desktop feature: open any chat in its own window.
  • Well-structured Electron code with session-windows.cjs for window management.
  • TypeScript React components for UI integration (session-actions-menu, session-row, desktop-controller).
  • Good test coverage (session-windows.test.cjs, windows.test.ts).
  • No security concerns - window management is properly scoped.

Reviewed by Hermes Agent

wachoo pushed a commit to wachoo/hermes-agent that referenced this pull request Jun 10, 2026
Pops a session into a standalone, focused window for side-by-side work.
A secondary window loads the renderer at the session route with a
?win=secondary flag (ahead of the HashRouter '#'); it drops the global
sidebar plus the install/onboarding overlays and renders a single chat,
sharing the one local gateway over WS (no backend duplication). The main
process keys windows by sessionId so re-opening focuses the existing one
and self-cleans on close.

Open it via:
- ⌘-click (mac) / ⌃-click (win/linux) a sidebar session — the universal
  "open in new window" gesture. Archive moves to the ⋯ / right-click menus
  only, off the easy-to-misfire modifier-click.
- "New window" in the session ⋯ and context menus (link-external icon,
  i18n'd across en/ja/zh/zh-hant).

A standalone window has no left rail, so AppShell treats its edge as
uncovered and applies the titlebar inset — the chat title clears the
macOS traffic lights instead of hiding behind them.

Co-authored-by: tim404x <tim404x@users.noreply.github.com>
changman pushed a commit to changman/hermes-agent that referenced this pull request Jun 10, 2026
Pops a session into a standalone, focused window for side-by-side work.
A secondary window loads the renderer at the session route with a
?win=secondary flag (ahead of the HashRouter '#'); it drops the global
sidebar plus the install/onboarding overlays and renders a single chat,
sharing the one local gateway over WS (no backend duplication). The main
process keys windows by sessionId so re-opening focuses the existing one
and self-cleans on close.

Open it via:
- ⌘-click (mac) / ⌃-click (win/linux) a sidebar session — the universal
  "open in new window" gesture. Archive moves to the ⋯ / right-click menus
  only, off the easy-to-misfire modifier-click.
- "New window" in the session ⋯ and context menus (link-external icon,
  i18n'd across en/ja/zh/zh-hant).

A standalone window has no left rail, so AppShell treats its edge as
uncovered and applies the titlebar inset — the chat title clears the
macOS traffic lights instead of hiding behind them.

Co-authored-by: tim404x <tim404x@users.noreply.github.com>
alt-glitch pushed a commit that referenced this pull request Jun 14, 2026
Pops a session into a standalone, focused window for side-by-side work.
A secondary window loads the renderer at the session route with a
?win=secondary flag (ahead of the HashRouter '#'); it drops the global
sidebar plus the install/onboarding overlays and renders a single chat,
sharing the one local gateway over WS (no backend duplication). The main
process keys windows by sessionId so re-opening focuses the existing one
and self-cleans on close.

Open it via:
- ⌘-click (mac) / ⌃-click (win/linux) a sidebar session — the universal
  "open in new window" gesture. Archive moves to the ⋯ / right-click menus
  only, off the easy-to-misfire modifier-click.
- "New window" in the session ⋯ and context menus (link-external icon,
  i18n'd across en/ja/zh/zh-hant).

A standalone window has no left rail, so AppShell treats its edge as
uncovered and applies the titlebar inset — the chat title clears the
macOS traffic lights instead of hiding behind them.

Co-authored-by: tim404x <tim404x@users.noreply.github.com>
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.

3 participants