diff --git a/README.md b/README.md index c91c02c..c8e9b81 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ A Windows desktop app for running and arranging many WSL terminals at once. Buil - Tiling layout — recursive splits, draggable dividers, preset layouts (single / 2-col / 3-col / 2-row / 2×2) - Per-pane distro + cwd + label, persisted across restarts -- Broadcast input to a group of panes +- Broadcast input to a group of panes (per-pane 📡 chip, or global toggle in the titlebar) - Idle-detection toasts when a pane goes quiet - Ctrl+K palette to fuzzy-jump between panes @@ -25,7 +25,7 @@ A Windows desktop app for running and arranging many WSL terminals at once. Buil - **Close pane** — `×`. The sibling expands to fill. - **Rename pane** — click the label in the toolbar, type, Enter (Esc to cancel). - **Change distro** — click the small `Ubuntu ▾` chip; pick a distro from the popover. The pane respawns (old shell is killed). -- **Broadcast** — toggle `📡` on two or more panes (orange border). Typing in any of them mirrors to all. +- **Broadcast** — toggle `📡` on two or more panes (orange border). Typing in any of them mirrors to all. The titlebar `📡 all off` / `📡 all on` / `📡 N/M` button flips the whole group at once. - **Preset layouts** — titlebar buttons: `1` / `2H` / `3H` / `2V` / `2×2`. Confirms before replacing a multi-pane layout. - **Active pane** — click any pane → blue border + keyboard focus. - **Jump to pane** — `Ctrl+K` opens a fuzzy picker over label / distro / cwd. ↑/↓ to navigate, Enter to focus, Esc to close. @@ -36,7 +36,7 @@ Layout + per-pane settings auto-save to `%APPDATA%\com.megaproxy.tiletopia\works ## Stack - **Tauri 2** (Rust backend, WebView2 frontend) — small bundle, native NSIS installer. -- **Svelte 5** + TypeScript + Vite + pnpm. +- **React 18** + TypeScript + Vite + pnpm. (The v0.1.0 release was Svelte 5; v0.2.0+ is React after a ground-up rewrite of the frontend. Same data model, same backend, more reliable reactivity through the recursive Pane chain. The Svelte version is preserved on the `svelte-archive` branch.) - **xterm.js** + `@xterm/addon-fit` for terminal rendering. - **`portable-pty`** (Rust) spawning `wsl.exe -d ` PTYs. @@ -59,7 +59,8 @@ pnpm tauri build # NSIS installer at src-tauri\target\release\bundle\nsis ```sh pnpm test # vitest, 43 cases on the layout tree pnpm test:watch -pnpm check # svelte-check +pnpm check # tsc --noEmit (strict TypeScript pass) +pnpm build # tsc -b && vite build — full production frontend bundle ``` The test suite covers the pure helpers in `src/lib/layout/tree.ts`. UI behavior, broadcast routing, and Tauri integration are manually tested. @@ -67,8 +68,8 @@ The test suite covers the pure helpers in `src/lib/layout/tree.ts`. UI behavior, ## Architecture - **Backend** (`src-tauri/src/pty.rs`): `PtyManager` holding `Mutex>` of `portable-pty` children. Each spawned pane gets a background reader thread that emits `pane://{id}/data` events (base64 byte chunks). Counterparts: `write_to_pane` / `resize_pane` / `kill_pane`. Workspace persistence via `save_workspace` / `load_workspace` writes to `app.path().app_config_dir()` with atomic tmp + rename. -- **Layout** (`src/lib/layout/tree.ts`): binary tree of splits. `HSplit | VSplit` internal nodes with a ratio, `Leaf` at the bottom — same model as i3 / tmux / Zellij. Adaptive resize falls out of mutating one parent ratio. Pure helpers (`splitLeaf`, `closeLeaf`, `changeDistro`, etc.) live in `tree.ts`; the rendering chain (`Pane.svelte` → `SplitNode.svelte` / `LeafPane.svelte`) is thin. -- **Orchestration** — broadcast routing, idle detection, palette, active-pane focus all live in `App.svelte` and reach the panes via a `PaneOps` bundle (`src/lib/layout/ops.ts`) drilled through the Pane chain. +- **Layout** (`src/lib/layout/tree.ts`): binary tree of splits. `HSplit | VSplit` internal nodes with a ratio, `Leaf` at the bottom — same model as i3 / tmux / Zellij. Adaptive resize falls out of mutating one parent ratio. Pure helpers (`splitLeaf`, `closeLeaf`, `changeDistro`, `setAllBroadcast`, etc.) live in `tree.ts` with 43 vitest cases; the rendering chain (`Pane.tsx` → `SplitNode.tsx` / `LeafPane.tsx`) is thin. +- **Orchestration** — broadcast routing, idle detection, palette, active-pane focus all live in `App.tsx`. Shared state and operations reach descendants through a React Context (`src/lib/layout/orchestration.tsx`), so each LeafPane reads `activeLeafId`, `distros`, and the tree-mutation methods directly via `useOrchestration()` — no prop drilling through the recursive Pane chain. ## License