Skip to content

feat(desktop): multiple windows that share the main window's connections - #2

Open
na0s-fleet-agents[bot] wants to merge 21 commits into
mainfrom
feat/desktop-multi-window
Open

na0s-fleet-agents[bot] wants to merge 21 commits into
mainfrom
feat/desktop-multi-window

Conversation

@na0s-fleet-agents

@na0s-fleet-agents na0s-fleet-agents Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Standalone branch. Based on main and includes the window-hub commits from #4 (New Window and the shared connection), so it can be kept or rebased without #4. If #4 lands first, this diff shrinks to the per-window features.

Use case

In the same vein as my Umbrella Projects PR, I find myself bouncing between vastly different projects when I clock out of paid work and into hobby work. Thread filtering is fine, but it has no quick switching and can't tap into the spatial mapping you get with multiple desktops or macOS Spaces. So here is Multi-Window. To keep things cheap and as consistent as possible, the primary window owns the connections and shared state, and secondary windows only host UI. Each window can have a saved profile that includes its project filter ("workspaces", anyone?), window position, theme and so on. There is also a Mini Main Window mode that collapses the main window to a small panel showing your open windows and usage limits.

Problem

With #4 the desktop app can open more windows, but a window is gone once you close it. Nothing remembers that one window was "client work" and another "hobby": the project filter, position and theme have to be set up again every time, and nothing tells the windows apart at a glance. While other windows are open, the main window is also a full-size window you have to keep somewhere, even when all you want from it is an overview.

Change

  • Saved windows. A window profile keeps its project filter, bounds, maximized state and theme. A new window isn't saved; closing it asks Save this window? (Cancel / Don't Save / Save, with a name). Saved windows reopen from the palette (Open window: name), the Window menu or Settings → General → Windows, and the ones open at quit come back at launch. Window titles include the profile name. The legacy mainWindowBounds keys still hold the main window's placement, so downgrading still works.
  • Multiple windows switch in Settings → General → Windows. Off, New Window, its shortcut and opening saved windows are unavailable; windows already open stay open.
  • Project colour. A window with a project filter keeps the main window's theme; its projects' icon colours mark its entry in Windows settings and its theme dropdown. Projects whose icon is an image or emoji add no colour. A saved window can pick a theme instead. Secondary windows no longer tint any part of their own UI.
  • Windows settings. Saved windows are listed indented under the main window, with names edited in place, a labelled Theme dropdown whose options show their light and dark swatches (Project colour shows the window's project colours), and each row fading its theme's accent in from the right. Add saved window creates one without opening it; its project picker keeps the sidebar's grouping, with members indented under their group.
  • Mini Mode turns the main window into a 320×184 accessory panel, which can be dragged taller (minimum 160px). One top bar holds the tabs on the left (Windows, one card per open window; Pull requests, the list the Pull requests page opens with; Usage; Update) and Search, New Window and Expand as icons on the right. Usage draws each account's limits as small bars with the percent left, two to a line, so Claude and OpenAI show together; it opens on Usage. On Windows and Linux the panel can't be maximised or minimised, so the title bar overlay keeps fewer buttons beside the top bar.

User docs: docs/user/multiple-windows.md.

Scope and approval

This is a feature with no maintainer approval yet. It is filed on my fork and proposed upstream in an Ideas discussion: link added after posting.

Verification

Window and settings captures: Electron desktop dev build (vp run dev:desktop) on a 1600×1000 Xvfb screen, every window 1280×800, light theme, synthetic projects (storefront; northwind/api, holding api and api-v2 grouped by repository; pixel-dungeon; synth-rack; and brand-site, whose icon is an SVG favicon) with replayed threads, isolated home and Electron profile, captured over CDP. Mini Mode captures are noted per row.

Rebase onto main, 76a95e98bc

Rebased onto main at 1368854 with #4 at bfcf1b2. The branch's history up to its last hub merge is one commit; the twelve commits after it are replayed unchanged. A new last commit translates the multi-window UI and reads Mini Mode's usage notices from usageLimitsCopy. The captures and commit links below predate the rebase and were not retaken.

Round before the rebase, 7800f01d05

Secondary windows lose the banner tint; the theme options and list colours in Windows settings stay. Mini Mode opens at 320×184.

Capture Before — 4116885df3 After — 7800f01
Secondary window banner Before: the window's project colours across the sidebar banner After: the banner shows only the normal stage artwork
Windows settings Before: Client work on Project colour and Synth night on Grove, each row fading its colour in After: unchanged; the Theme dropdowns with swatches and the row gradients stay

Previous round: changes since bf9f316

The banner tint shown here was removed in 7800f01.

Capture Before — bf9f3164b4 After — 6c10b48218
Saved window "Storefront", one project Before: the whole window is recoloured green: sidebar, selected card, code block and composer After: only the sidebar banner takes storefront's green and fades out below the Search row; the rest of the window is the normal theme
Saved window "Hobby", two projects Before: a blue-to-purple wash over the whole sidebar After: the blue-to-purple blend sits only on the sidebar banner
Saved window "Brand", image-icon project Before: the window is tinted red from the hidden monogram colour After: no tint; the banner shows the plain artwork
Add saved window, projects picker open Before: a separate Name field; the picker is a flat list After: the name is typed into the row title; the picker lists api and api-v2 indented under northwind/api; the row fades in its project colours
Theme dropdown Before: no label; text-only options After: labelled Theme; each theme shows light and dark swatches, and Project colour shows blue and purple
Window list Before: plain rows with Name fields and unlabelled theme dropdowns After: each row fades its theme colour in from the right: Storefront green, Hobby blue to purple, Northwind Ember; Brand has none

Against main

Capture Before — 7d32075e37 (main) After
Settings → General Before: Confirmations is followed directly by Display 4116885df3: After: a Windows section with the Multiple windows switch, the main window, and two saved windows indented under it, Client work on Project colour and Synth night on Grove
Native close button on an unsaved window Before: the only window closes at once and nothing asks to save 636249f975: After: Save this window? with a name field and Cancel, Don't Save and Save

The close-prompt capture and the recording below are from 636249f. They predate the sidebar-banner tint and the Windows settings changes; the prompt itself is unchanged since. Recordings start after the app has loaded and are shown as GIF previews; click one for the H.264 MP4.

Case Before (main) After (636249f)
Close an unsaved window Before recording, GIF preview After recording, GIF preview

Mini Mode

At d68b216cf4, 320×184. The component captures render the panel with the test's synthetic fixtures in Chromium; the Linux capture is the Electron app on Xvfb, grabbed from the X display so the native buttons show, with an isolated home and no provider credentials.

Tab Light Dark
Usage Usage, light: tabs left and Search, New Window, Expand right in one top bar; Claude · Max with Session 62% and Weekly 41%, and Codex · ChatGPT Pro 100 Subscription with Session 6% and Weekly 78%, each a small bar Usage, dark: the same
Windows Windows, light: window cards under the top bar Windows, dark
Pull requests Pull requests, light Pull requests, dark
Update Update, light Update, dark
Linux, Electron
Electron on Linux at 320x184: the four tabs, then Search, New Window and Expand, then the native Minimise and Close buttons; Usage reads unavailable with no credentials

Earlier rounds, superseded (Settings tab removed, tabs moved to the top). At 320×184 from 7800f01d05:

Windows Settings
Windows tab at 320x184 with tabs at the bottom Settings tab at 320x184

At 320×460:

Capture Before — bf9f3164b4 After
Default view Before: Mini Mode title and Expand button; usage (here unavailable) and the window list share one panel After, light: Usage tab with one heading per account and compact limit rows; figures, bars, reset times and plan labels are covered After, dark: the same panel in dark

The Usage captures are from the Electron app at 4116885. It read real limits from this machine's provider CLIs, so every figure, bar, reset time and plan label was covered in the page before capture. The before shows the unavailable state; the before with readable limits shows plan labels and is left out.

Other tabs, after only:

Windows Settings Pull requests Update
Windows tab: one card per window with its projects, name, open thread and state: Saved, Focused, Unsaved Settings tab: the Multiple windows switch and All settings Pull requests tab: three synthetic PRs with state, number, title, checks, review and repository Update tab: the running version and update status
Components in Chromium with synthetic fixtures, ac5136e6f1 Electron app, 4116885 Components in Chromium with synthetic fixtures, ac5136e Electron app, 4116885

Observed in the running app at 636249f, not rerun on the current head:

  • Close prompt. Save created a "Hobby" profile with its 2-project filter, and Don't Save closed without one.
  • Reopen and restore. Reopening the profile restored its filter. After a graceful quit (double Ctrl+Q) and a relaunch, the Hobby window came back with its filter and its Grove override, while the main window kept the default theme.
  • Reload keeps the filter. Reloading an unsaved window keeps its current filter (fixed in 636249f with a test).

Focused tests on 4116885, all passing:

  • desktop: DesktopWindow, DesktopWindowProfiles, DesktopAppSettings, DesktopApplicationMenu (4 files, 82 tests)
  • web unit: src/multiWindow, including windowsState, windowTint.logic and windowProfiles.logic (4 files, 18 tests)
  • web browser: MiniMainWindow.browser (9 tests)

Not captured: the native Window menu. On Linux the app draws its own title bar and shows no menu bar; its entries are covered by DesktopApplicationMenu.test.ts.

Not verified

  • Full CI on the current head. vp run check:changed and the i18n catalog check passed on 76a95e9.
  • Captures and the running app on the rebased head, including the translated strings in other languages.
  • Save, reopen and relaunch in the running app on the current head. They were last run at 636249f, before the Settings and Mini Mode rounds.
  • Dark theme for the window and settings captures.
  • macOS (Dock menu, Spaces, the panel without native window controls) and Windows. All testing was on Linux under Xvfb. On Windows, whether Electron hides the Minimise and Maximise caption buttons for a window that can't be minimised or maximised is not checked; if both stay (46px each), the top bar is a few pixels short of fitting at 320px.
  • Mini Mode Usage with real accounts in the Electron app; the meters were checked with fixtures only.

The model and harness that did the work: Claude Opus 5.5 in Claude Code (T3 Code).

🤖 Generated with Claude Code

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XXL labels Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

This PR changes the test suite by +58 test cases (browser +4, unit +54, server 0).

New browser test files: apps/web/src/multiWindow/ui/MiniMainWindow.browser.test.tsx.
Each browser test file costs CI seconds of module loading before its first test runs; a unit test costs milliseconds.

Keep tests that would fail for a real reason, and test logic below the UI where it can be. See Testing.

@na0s-fleet-agents
na0s-fleet-agents Bot changed the base branch from main to feat/desktop-multi-window-hub November 20, 2026 04:49
@na0s-fleet-agents
na0s-fleet-agents Bot changed the base branch from feat/desktop-multi-window-hub to main November 21, 2026 22:29
Na0s and others added 21 commits November 23, 2026 10:06
Secondary windows are thin clients: the main window's renderer is a hub that
relays each environment's RPC over a MessagePort and shares its subscription
streams, so a new window opens without its own sockets or auth. The desktop
shell opens them from New Window (command palette, Window menu, and
mod+alt+shift+n), trusts IPC from every app window, scopes preview tabs to
the window that shows them, and keeps the main window hidden rather than
closed while it serves other windows. Windows merge their shared UI state and
composer drafts instead of overwriting each other's saves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…reuses its supervisor

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ir window

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mponent state

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ared hub

Saved window profiles (project filter, bounds, theme), the close prompt,
the Multiple windows switch and Windows settings, project-colour themes,
and Mini Mode, built on the shared-connection window hub.

Replays the branch's history up to da2ba7c as one commit. That history
carried its own copy of the window hub and merged the hub branch three
times, so its commits no longer apply one by one on the rebased hub.
Squashed commits:

- 5fa6d22 feat(desktop): multiple windows that share the main window's connections
- cac0fe8 fix(desktop): shared hub subscriptions keep flow control and retain nothing
- ddbc66c fix(desktop): previews, focus and captures stay with their window
- 636249f fix(desktop): a reloaded secondary window keeps its current filter and profile
- 68836c8 feat(desktop): Mini Mode leads with usage limits in a compact layout
- 6b66dac feat(desktop): secondary windows take on their projects' icon colours
- d0f7871 feat(desktop): multi-window toggle and saved windows in Settings
- bf9f316 fix(desktop): Mini Mode offers no New Window while multiple windows are off
- 6c10b48 feat(desktop): project colours tint the sidebar banner; window settings round
- ac5136e feat(desktop): Mini Mode becomes a tabbed accessory panel
- 7017392 refactor(client-runtime): keep connect in place and reuse canonicalJson for the shared config match
- 8e84740 refactor(desktop): one way to add a window profile, and no stored window context
- edeea98 refactor(web): project icon swatches read Tailwind's colour variables
- d2a438b refactor(desktop): drop focusedMainOrFirst, which IPC senders replaced
- cabc407 refactor(desktop): window context schema lives in contracts
- 8150b1d refactor(web): hub link messages are schemas
- 5168f0e docs: multiple windows guide covers tasks, not every control
- 6b59152 refactor(web): Mini Mode Usage reuses the composer's compact limit rows
- 44f9902 refactor(web): register the window commands at startup
- acd5bab docs: multiple windows guide keeps the hidden main window note
- 1891a8c docs: the hidden main window stays open on macOS

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ntent

The browser test no longer copies the panel's tab switch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… them

Each gradient had one caller, and its tests pinned exact CSS strings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
windowCloseDecision and the theme select-value helpers each had one caller.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…urrentWindowProfile

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…les normalize once

Settings already normalizes a new profile's project filter, so the window service
no longer does it first. Both unsaved-name lookups share one helper.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…profile to write

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ws check

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ondary windows

The project-colour wash across a secondary window's sidebar banner read as noise.
It goes; a saved window's theme options and the colour on its settings entry stay.

Mini Mode opened at 320x460, which made a persistent accessory panel feel like a
second app window. It now opens at 320x184, like a menu-bar panel, and can be
dragged down to 160px or taller for more.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…its two accounts

At 184px tall the panel had room for one tab's content between two bars, and the
Settings tab's switch was hard to use there. Settings goes; the full settings are a
search away.

The tabs (Windows, Pull requests, Usage, Update) move into the top bar on the left;
Search becomes an icon beside New Window and Expand on the right. Windows takes a
layers icon so it doesn't repeat New Window's.

Usage showed one account's rows per screen. It now draws each limit as a small bar
with its percent left, two to a line, so Claude and OpenAI show together. The bar
keeps its tooltip with the reset time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…x window controls

On Windows and Linux the title bar overlay keeps its buttons in the panel's top
right, and at 320px the tabs ran under Search. In Mini Mode the window is no
longer maximizable or minimizable, which drops Maximize on Linux; the tabs take the
top bar's 28px buttons instead of the sidebar footer's 32px ones. The bar now
fits with Minimize and Close beside it, and the sidebar footer item goes back to
how it was.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s from the copy module

The app's UI is now translated. Saved windows, Windows settings, the close
prompt, Mini Mode, the Window menu entries and unsaved window names use gt(),
<T> and msg(), with keys in en and every locale catalog for web and desktop.

Mini Mode's Usage tab takes collectLimitNotices and collectExternalUsageLinks
from usageLimitsCopy, which moved there to translate, and its update and
pull request rows pass the active resolver. The Mini Mode test fixtures are
renamed to mini.test-fixtures.ts so the untranslated-copy rule skips them.
The Window menu test expects Minimize and Zoom too, which now carry
translated labels.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@na0s-fleet-agents
na0s-fleet-agents Bot force-pushed the feat/desktop-multi-window branch from d68b216 to 76a95e9 Compare November 23, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant