Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
98acf8f
feat(desktop): open more windows that share the main window's connection
Na0s Nov 20, 2026
cb56d57
docs: the hidden main window stays open on macOS
Na0s Nov 20, 2026
6546ea3
refactor(client-runtime): socket sessions add the relay, and a lease …
Na0s Nov 20, 2026
e4f1cd7
refactor(desktop): one forwarder routes per-tab preview events to the…
Na0s Nov 20, 2026
6c41553
refactor(web): read the window context directly instead of through co…
Na0s Nov 20, 2026
b1e319d
test(client-runtime): relay tests share the hub setup
Na0s Nov 20, 2026
bfcf1b2
refactor(client-runtime): relay ports drain through an Effect queue
Na0s Nov 20, 2026
6ba9daf
feat(desktop): saved windows, Mini Mode and window settings on the sh…
Na0s Nov 23, 2026
729499a
refactor(web): Mini Mode's panel owns its tab and takes each tab's co…
Na0s Nov 20, 2026
82a444e
refactor(web): window tint gradients live in the components that draw…
Na0s Nov 20, 2026
5cb154f
refactor(web): the close prompt and theme picker build their own values
Na0s Nov 20, 2026
f3b3ef1
refactor(web): Windows settings marks the current window with selectC…
Na0s Nov 20, 2026
179243d
refactor(desktop): one pass names and titles windows, and saved profi…
Na0s Nov 20, 2026
51cf6e7
refactor(desktop): the settings document always has a default window …
Na0s Nov 20, 2026
2dd9fba
test: window state and menu tests share small window fixtures
Na0s Nov 20, 2026
a15f4be
refactor(web): saved windows join New Window under the multiple-windo…
Na0s Nov 20, 2026
dbcd5fe
refactor(web): a saved window's settings row takes whether it is open
Na0s Nov 20, 2026
fe9acd7
feat(desktop): open Mini Mode short, and drop the sidebar tint of sec…
Na0s Nov 23, 2026
e2d756a
feat(web): Mini Mode tabs move to the top bar, Settings goes, Usage f…
Na0s Nov 23, 2026
d91b6f1
fix(desktop,web): fit Mini Mode's top bar beside the Windows and Linu…
Na0s Nov 23, 2026
76a95e9
fix(desktop,web): translate the multi-window UI and read usage notice…
Na0s Nov 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions apps/desktop/src/app/DesktopLifecycle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ function layerElectronWindow(destroyAll: Effect.Effect<void> = Effect.void) {
create: () => Effect.die("unexpected window creation"),
main: Effect.die("unexpected main window read"),
currentMainOrFirst: Effect.die("unexpected current window read"),
focusedMainOrFirst: Effect.die("unexpected focused window read"),
apps: Effect.succeed([]),
focusedApp: Effect.succeedNone,
registerApp: () => Effect.void,
setMain: () => Effect.void,
clearMain: () => Effect.void,
prepareReveal: () => Effect.succeed(false),
Expand All @@ -87,10 +89,10 @@ function layerElectronWindow(destroyAll: Effect.Effect<void> = Effect.void) {
function layerDesktopWindow(
input: {
readonly activate?: Effect.Effect<void>;
readonly flushMainWindowBounds?: Effect.Effect<void>;
readonly flushWindowState?: Effect.Effect<void>;
} = {},
) {
return Layer.succeed(DesktopWindow.DesktopWindow, {
return Layer.mock(DesktopWindow.DesktopWindow)({
createMain: Effect.die("unexpected window creation"),
ensureMain: Effect.die("unexpected window creation"),
revealOrCreateMain: Effect.die("unexpected window creation"),
Expand All @@ -99,11 +101,10 @@ function layerDesktopWindow(
showConnectingSplash: Effect.void,
handleBackendReady: () => Effect.void,
handleBackendNotReady: Effect.void,
flushMainWindowBounds: input.flushMainWindowBounds ?? Effect.void,
flushWindowState: input.flushWindowState ?? Effect.void,
prepareCaptureReveal: Effect.void,
dispatchMenuAction: () => Effect.void,
dispatchSnapShotEvent: () => Effect.void,
zoomMain: () => Effect.void,
runMainContentsCommand: () => Effect.void,
syncAppearance: Effect.void,
});
Expand Down Expand Up @@ -180,7 +181,7 @@ describe("DesktopLifecycle", () => {
const destroyAll = Effect.sync(() => {
events.push("destroy");
});
const flushMainWindowBounds = Effect.sync(() => {
const flushWindowState = Effect.sync(() => {
events.push("flush");
});

Expand All @@ -203,7 +204,7 @@ describe("DesktopLifecycle", () => {
Layer.provideMerge(layerElectronApp(appListeners, quit)),
Layer.provideMerge(layerElectronTheme),
Layer.provideMerge(layerElectronWindow(destroyAll)),
Layer.provideMerge(layerDesktopWindow({ flushMainWindowBounds })),
Layer.provideMerge(layerDesktopWindow({ flushWindowState })),
Layer.provideMerge(layerEnvironment),
Layer.provideMerge(layerDesktopShutdown),
Layer.provideMerge(DesktopState.layer),
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/app/DesktopLifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const requestDesktopShutdownAndWait = Effect.fn("desktop.lifecycle.requestShutdo
): Effect.fn.Return<void, never, DesktopShutdown.DesktopShutdown | DesktopWindow.DesktopWindow> {
const shutdown = yield* DesktopShutdown.DesktopShutdown;
const desktopWindow = yield* DesktopWindow.DesktopWindow;
yield* desktopWindow.flushMainWindowBounds;
yield* desktopWindow.flushWindowState;
yield* afterBoundsFlush;
yield* shutdown.request;
yield* shutdown.awaitComplete;
Expand Down
7 changes: 3 additions & 4 deletions apps/desktop/src/backend/DesktopBackendPool.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ function layerPool(
showErrorBox: () => Effect.void,
} satisfies ElectronDialog.ElectronDialog["Service"]),
ElectronApp.layer,
Layer.succeed(DesktopWindow.DesktopWindow, {
Layer.mock(DesktopWindow.DesktopWindow)({
createMain: Effect.die("unexpected window create"),
ensureMain: Effect.die("unexpected window ensure"),
revealOrCreateMain: Effect.die("unexpected window reveal"),
Expand All @@ -212,15 +212,14 @@ function layerPool(
showConnectingSplash: Effect.void,
handleBackendReady: () => options.onReady ?? Effect.void,
handleBackendNotReady: Effect.void,
flushMainWindowBounds: Effect.void,
flushWindowState: Effect.void,
prepareCaptureReveal: Effect.void,
dispatchMenuAction: () => Effect.die("unexpected menu action"),
dispatchSnapShotEvent: () => Effect.void,
zoomMain: () => Effect.die("unexpected zoom"),
runMainContentsCommand:
options.onMainContentsCommand ?? (() => Effect.die("unexpected main contents command")),
syncAppearance: Effect.void,
} satisfies DesktopWindow.DesktopWindow["Service"]),
}),
),
),
);
Expand Down
41 changes: 32 additions & 9 deletions apps/desktop/src/electron/ElectronWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ export class ElectronWindow extends Context.Service<
) => Effect.Effect<Electron.BrowserWindow, ElectronWindowCreateError>;
readonly main: Effect.Effect<Option.Option<Electron.BrowserWindow>>;
readonly currentMainOrFirst: Effect.Effect<Option.Option<Electron.BrowserWindow>>;
readonly focusedMainOrFirst: Effect.Effect<Option.Option<Electron.BrowserWindow>>;
/** Windows that load the app renderer: the main window first, then secondary windows. */
readonly apps: Effect.Effect<ReadonlyArray<Electron.BrowserWindow>>;
/** The focused app window, else the main window; never a popup or auxiliary window. */
readonly focusedApp: Effect.Effect<Option.Option<Electron.BrowserWindow>>;
readonly registerApp: (window: Electron.BrowserWindow) => Effect.Effect<void>;
readonly setMain: (window: Electron.BrowserWindow) => Effect.Effect<void>;
readonly clearMain: (window: Option.Option<Electron.BrowserWindow>) => Effect.Effect<void>;
readonly prepareReveal: (window: Electron.BrowserWindow) => Effect.Effect<boolean>;
Expand Down Expand Up @@ -148,6 +152,7 @@ export const make = Effect.gen(function* () {
yield* Effect.addFinalizer(() => Effect.sync(() => windowsForegroundFocus?.close()));
const mainWindowRef = yield* Ref.make<Option.Option<Electron.BrowserWindow>>(Option.none());
const auxiliaryWindows = new WeakSet<Electron.BrowserWindow>();
const appWindows = new Set<Electron.BrowserWindow>();
const titleBarOverlayWindows = new WeakSet<Electron.BrowserWindow>();

const listWindows = Effect.try({
Expand Down Expand Up @@ -198,9 +203,22 @@ export const make = Effect.gen(function* () {
return first;
});

const focusedMainOrFirst = Effect.gen(function* () {
const liveApps = Effect.gen(function* () {
const main = yield* liveMain;
const apps: Electron.BrowserWindow[] = Option.isSome(main) ? [main.value] : [];
for (const window of appWindows) {
if (yield* isWindowDestroyed(window)) {
appWindows.delete(window);
} else if (!apps.includes(window)) {
apps.push(window);
}
}
return apps;
});

const focusedApp = Effect.gen(function* () {
const focused = yield* Effect.try({
try: () => Option.fromNullishOr(Electron.BrowserWindow.getFocusedWindow() ?? null),
try: () => Electron.BrowserWindow.getFocusedWindow(),
catch: (cause) =>
new ElectronWindowOperationError({
operation: "get-focused-window",
Expand All @@ -210,10 +228,9 @@ export const make = Effect.gen(function* () {
cause,
}),
}).pipe(Effect.orDie);
if (Option.isSome(focused) && !(yield* isWindowDestroyed(focused.value))) {
return focused;
}
return yield* currentMainOrFirst;
const apps = yield* liveApps;
if (focused !== null && apps.includes(focused)) return Option.some(focused);
return yield* liveMain;
});

return ElectronWindow.of({
Expand Down Expand Up @@ -255,9 +272,15 @@ export const make = Effect.gen(function* () {
}),
main: liveMain,
currentMainOrFirst,
focusedMainOrFirst,
apps: liveApps,
focusedApp,
registerApp: Effect.fn("ElectronWindow.registerApp")(function (window) {
return Effect.sync(() => void appWindows.add(window));
}),
setMain: Effect.fn("ElectronWindow.setMain")(function (window) {
return Ref.set(mainWindowRef, Option.some(window));
return Ref.set(mainWindowRef, Option.some(window)).pipe(
Effect.andThen(Effect.sync(() => void appWindows.add(window))),
);
}),
clearMain: Effect.fn("ElectronWindow.clearMain")(function (window) {
return Ref.update(mainWindowRef, (current) => {
Expand Down
4 changes: 4 additions & 0 deletions apps/desktop/src/i18n/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
"df6ed2014f1737a8": "Verkleinern",
"50fe114d093a5bc7": "Vollbildmodus ein/aus",
"d8c6d6d9845353da": "Fenster",
"c015841b7b2523c6": "Neues Fenster",
"d5203c78d46e1282": "Hauptfenster",
"f8e9094362fa962a": "Mini-Modus",
"f184aa190588625e": "Minimieren",
"c20a9deaed71bd1c": "Zoomen",
"d207ba3a23f94223": "Alle nach vorne bringen",
Expand All @@ -122,6 +125,7 @@
"202e13f15a3dcd30": "Link kopieren",
"8af79268f2349f4c": "E-Mail-Adresse kopieren",
"a9f9254d458e49fe": "Bild kopieren",
"0ec1ce287d61c59a": "Fenster {number}",
"9c1b20fbc881de5d": "Desktop-Konfiguration",
"1b14230874f19eb9": "Bilder"
}
4 changes: 4 additions & 0 deletions apps/desktop/src/i18n/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
"df6ed2014f1737a8": "Zoom Out",
"50fe114d093a5bc7": "Toggle Full Screen",
"d8c6d6d9845353da": "Window",
"c015841b7b2523c6": "New Window",
"d5203c78d46e1282": "Main Window",
"f8e9094362fa962a": "Mini Mode",
"f184aa190588625e": "Minimize",
"c20a9deaed71bd1c": "Zoom",
"d207ba3a23f94223": "Bring All to Front",
Expand All @@ -122,6 +125,7 @@
"202e13f15a3dcd30": "Copy Link",
"8af79268f2349f4c": "Copy Email Address",
"a9f9254d458e49fe": "Copy Image",
"0ec1ce287d61c59a": "Window {number}",
"9c1b20fbc881de5d": "Desktop config",
"1b14230874f19eb9": "Images"
}
4 changes: 4 additions & 0 deletions apps/desktop/src/i18n/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
"df6ed2014f1737a8": "Alejar",
"50fe114d093a5bc7": "Activar/desactivar pantalla completa",
"d8c6d6d9845353da": "Ventana",
"c015841b7b2523c6": "Nueva ventana",
"d5203c78d46e1282": "Ventana principal",
"f8e9094362fa962a": "Modo mini",
"f184aa190588625e": "Minimizar",
"c20a9deaed71bd1c": "Zoom",
"d207ba3a23f94223": "Traer todo al frente",
Expand All @@ -122,6 +125,7 @@
"202e13f15a3dcd30": "Copiar enlace",
"8af79268f2349f4c": "Copiar dirección de correo",
"a9f9254d458e49fe": "Copiar imagen",
"0ec1ce287d61c59a": "Ventana {number}",
"9c1b20fbc881de5d": "Configuración de escritorio",
"1b14230874f19eb9": "Imágenes"
}
4 changes: 4 additions & 0 deletions apps/desktop/src/i18n/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
"df6ed2014f1737a8": "Zoom arrière",
"50fe114d093a5bc7": "Activer/désactiver le plein écran",
"d8c6d6d9845353da": "Fenêtre",
"c015841b7b2523c6": "Nouvelle fenêtre",
"d5203c78d46e1282": "Fenêtre principale",
"f8e9094362fa962a": "Mode mini",
"f184aa190588625e": "Réduire",
"c20a9deaed71bd1c": "Zoom",
"d207ba3a23f94223": "Tout ramener au premier plan",
Expand All @@ -122,6 +125,7 @@
"202e13f15a3dcd30": "Copier le lien",
"8af79268f2349f4c": "Copier l’adresse e-mail",
"a9f9254d458e49fe": "Copier l’image",
"0ec1ce287d61c59a": "Fenêtre {number}",
"9c1b20fbc881de5d": "Configuration du bureau",
"1b14230874f19eb9": "Images"
}
4 changes: 4 additions & 0 deletions apps/desktop/src/i18n/translations/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
"df6ed2014f1737a8": "縮小",
"50fe114d093a5bc7": "フルスクリーンに切り替え",
"d8c6d6d9845353da": "ウインドウ",
"c015841b7b2523c6": "新規ウインドウ",
"d5203c78d46e1282": "メインウインドウ",
"f8e9094362fa962a": "ミニモード",
"f184aa190588625e": "しまう",
"c20a9deaed71bd1c": "拡大/縮小",
"d207ba3a23f94223": "すべてを手前に移動",
Expand All @@ -122,6 +125,7 @@
"202e13f15a3dcd30": "リンクをコピー",
"8af79268f2349f4c": "メールアドレスをコピー",
"a9f9254d458e49fe": "画像をコピー",
"0ec1ce287d61c59a": "ウインドウ {number}",
"9c1b20fbc881de5d": "デスクトップの構成",
"1b14230874f19eb9": "画像"
}
4 changes: 4 additions & 0 deletions apps/desktop/src/i18n/translations/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
"df6ed2014f1737a8": "축소",
"50fe114d093a5bc7": "전체 화면 전환",
"d8c6d6d9845353da": "윈도우",
"c015841b7b2523c6": "새 윈도우",
"d5203c78d46e1282": "메인 윈도우",
"f8e9094362fa962a": "미니 모드",
"f184aa190588625e": "최소화",
"c20a9deaed71bd1c": "확대/축소",
"d207ba3a23f94223": "모두 앞으로 가져오기",
Expand All @@ -122,6 +125,7 @@
"202e13f15a3dcd30": "링크 복사",
"8af79268f2349f4c": "이메일 주소 복사",
"a9f9254d458e49fe": "이미지 복사",
"0ec1ce287d61c59a": "윈도우 {number}",
"9c1b20fbc881de5d": "데스크톱 구성",
"1b14230874f19eb9": "이미지"
}
4 changes: 4 additions & 0 deletions apps/desktop/src/i18n/translations/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
"df6ed2014f1737a8": "Diminuir zoom",
"50fe114d093a5bc7": "Alternar tela cheia",
"d8c6d6d9845353da": "Janela",
"c015841b7b2523c6": "Nova janela",
"d5203c78d46e1282": "Janela principal",
"f8e9094362fa962a": "Modo mini",
"f184aa190588625e": "Minimizar",
"c20a9deaed71bd1c": "Zoom",
"d207ba3a23f94223": "Trazer tudo para a frente",
Expand All @@ -122,6 +125,7 @@
"202e13f15a3dcd30": "Copiar link",
"8af79268f2349f4c": "Copiar endereço de e-mail",
"a9f9254d458e49fe": "Copiar imagem",
"0ec1ce287d61c59a": "Janela {number}",
"9c1b20fbc881de5d": "Configuração do desktop",
"1b14230874f19eb9": "Imagens"
}
4 changes: 4 additions & 0 deletions apps/desktop/src/i18n/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
"df6ed2014f1737a8": "Уменьшить",
"50fe114d093a5bc7": "Полноэкранный режим",
"d8c6d6d9845353da": "Окно",
"c015841b7b2523c6": "Новое окно",
"d5203c78d46e1282": "Главное окно",
"f8e9094362fa962a": "Мини-режим",
"f184aa190588625e": "Свернуть",
"c20a9deaed71bd1c": "Масштаб",
"d207ba3a23f94223": "Все окна на передний план",
Expand All @@ -122,6 +125,7 @@
"202e13f15a3dcd30": "Копировать ссылку",
"8af79268f2349f4c": "Копировать адрес электронной почты",
"a9f9254d458e49fe": "Копировать изображение",
"0ec1ce287d61c59a": "Окно {number}",
"9c1b20fbc881de5d": "Конфигурация десктопа",
"1b14230874f19eb9": "Изображения"
}
4 changes: 4 additions & 0 deletions apps/desktop/src/i18n/translations/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
"df6ed2014f1737a8": "Zooma ut",
"50fe114d093a5bc7": "Växla helskärm",
"d8c6d6d9845353da": "Fönster",
"c015841b7b2523c6": "Nytt fönster",
"d5203c78d46e1282": "Huvudfönster",
"f8e9094362fa962a": "Miniläge",
"f184aa190588625e": "Minimera",
"c20a9deaed71bd1c": "Zooma",
"d207ba3a23f94223": "Lägg alla överst",
Expand All @@ -122,6 +125,7 @@
"202e13f15a3dcd30": "Kopiera länk",
"8af79268f2349f4c": "Kopiera e-postadress",
"a9f9254d458e49fe": "Kopiera bild",
"0ec1ce287d61c59a": "Fönster {number}",
"9c1b20fbc881de5d": "Skrivbordskonfiguration",
"1b14230874f19eb9": "Bilder"
}
4 changes: 4 additions & 0 deletions apps/desktop/src/i18n/translations/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
"df6ed2014f1737a8": "缩小",
"50fe114d093a5bc7": "切换全屏",
"d8c6d6d9845353da": "窗口",
"c015841b7b2523c6": "新建窗口",
"d5203c78d46e1282": "主窗口",
"f8e9094362fa962a": "迷你模式",
"f184aa190588625e": "最小化",
"c20a9deaed71bd1c": "缩放",
"d207ba3a23f94223": "前置全部窗口",
Expand All @@ -122,6 +125,7 @@
"202e13f15a3dcd30": "复制链接",
"8af79268f2349f4c": "复制邮箱地址",
"a9f9254d458e49fe": "复制图片",
"0ec1ce287d61c59a": "窗口 {number}",
"9c1b20fbc881de5d": "桌面配置",
"1b14230874f19eb9": "图片"
}
Loading