diff --git a/.context/DECISIONS.md b/.context/DECISIONS.md index 318e4cb..cfe8b7d 100644 --- a/.context/DECISIONS.md +++ b/.context/DECISIONS.md @@ -3,6 +3,7 @@ | Date | Decision | |------|--------| +| 2026-02-15 | Click-to-focus uses optimistic local state | | 2026-02-15 | Track pane dimensions in paneSizes Map | | 2026-02-14 | Server-side output buffer in DO for reconnect replay | | 2026-02-14 | Render all tabs simultaneously with CSS visibility:hidden on inactive tabs | @@ -24,6 +25,20 @@ For lightweight decisions, a single statement suffices: For significant decisions: +## [2026-02-15-225807] Click-to-focus uses optimistic local state + +**Status**: Accepted + +**Context**: Protocol only supports directional pane_focus (left/right/up/down), no click-by-path + +**Decision**: Click-to-focus uses optimistic local state + +**Rationale**: Simplest fix without protocol changes; server layout_update can override + +**Consequences**: If we later want server-authoritative click focus, add a pane_focus_path message type to the protocol + +--- + ## [2026-02-15-180300] Track pane dimensions in paneSizes Map **Status**: Accepted diff --git a/.context/LEARNINGS.md b/.context/LEARNINGS.md index 7401c47..ae2100a 100644 --- a/.context/LEARNINGS.md +++ b/.context/LEARNINGS.md @@ -3,6 +3,9 @@ | Date | Learning | |------|--------| +| 2026-02-15 | base-ui Tabs.Root needs flex styles in flex parents | +| 2026-02-15 | ghostty-web canvas ref must have zero CSS transitions | +| 2026-02-15 | react-resizable-panels Panel inner div sizing | | 2026-02-15 | paneSizes must be tracked at every terminal creation site | | 2026-02-14 | DO non-hibernation reconnect needs server-side replay | | 2026-02-14 | useMux() object identity churn breaks terminal lifecycle | @@ -13,6 +16,36 @@ | 2026-02-14 | Zensical explicit nav is full override | +## [2026-02-15-225805] base-ui Tabs.Root needs flex styles in flex parents + +**Context**: ChromeBar tab bar floating outside chrome bar + +**Lesson**: base-ui Tabs.Root renders a plain div wrapper. In a flex parent, it needs className with display:flex and flex:1 to stretch properly. + +**Application**: Always add flex styles to Tabs.Root when embedding in a flex layout. + +--- + +## [2026-02-15-225804] ghostty-web canvas ref must have zero CSS transitions + +**Context**: Wormhole terminal garbled after split + +**Lesson**: CSS transitions on the div that ghostty-web attaches to cause garbled canvas on resize. Separate the animation wrapper from the canvas ref div. + +**Application**: When wrapping ghostty-web, put transitions on a parent wrapper, never on the ref div itself. + +--- + +## [2026-02-15-225803] react-resizable-panels Panel inner div sizing + +**Context**: Wormhole UI pane sizing bug + +**Lesson**: react-resizable-panels Panel inner div is not display:flex. Child elements must use width/height:100% instead of flex:1 to fill the panel. + +**Application**: Any component rendered inside a Panel needs explicit percentage sizing, not flex properties. + +--- + ## [2026-02-15-180258] paneSizes must be tracked at every terminal creation site **Context**: Code review caught that handleSessionCreate and handleTabCreate call createTerminalWs without saving to paneSizes, so reconnect falls back to 80x24 diff --git a/CLAUDE.md b/CLAUDE.md index 24e9c14..a318e38 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -97,4 +97,6 @@ biome check --write --staged # before commit | Local Effect source | `~/.local/share/effect-solutions/effect/` | | Local ghostty-web source | `~/code/github.com/usirin/ghostty-web` | | Local effect-atom source | `~/code/github.com/usirin/effect-atom/` | +| CF Sandbox SDK source | `~/code/github.com/usirin/sandbox-sdk/` | +| base-ui docs (LLM-friendly) | `https://base-ui.com/llms.txt` | diff --git a/apps/kamp-us/index.html b/apps/kamp-us/index.html index 1f9f399..04fa5d5 100644 --- a/apps/kamp-us/index.html +++ b/apps/kamp-us/index.html @@ -5,6 +5,9 @@
~/kampus on umut/stale-sessions via node v22 +$ turbo run typecheck + + Tasks: 3 successful, 3 total + Cached: 2 cached, 3 total + Time: 4.2s + +~/kampus on umut/stale-sessions +$ git log --oneline -5 + +e7fe645 feat(sandbox): Wormhole protocol: mux server over CF Sandbox +491d019 feat(wormhole): Phase 1: Immortal Sessions +89e2008 initialize ctx +5c5b86b feat(wormhole): multiplexed terminal sessions +5d6b86c feat: wormhole: personal multi-device terminal + +~/kampus on umut/stale-sessions +$+
~/kampus on umut/stale-sessions +$ pnpm turbo run dev --filter=@kampus/worker + +@kampus/worker:dev: ready in 1.2s +@kampus/worker:dev: listening on http://localhost:8787 +@kampus/worker:dev: +@kampus/worker:dev: [mf:inf] GET /sandbox/ws 101 Switching Protocols +@kampus/worker:dev: [mf:inf] GET /sandbox/ws 101 Switching Protocols +@kampus/worker:dev: [WormholeServer] client connected, 2 sessions +@kampus/worker:dev: [WormholeServer] terminal WS opened for pty-a1b2 +@kampus/worker:dev: [WormholeServer] terminal WS opened for pty-c3d4 +@kampus/worker:dev: [WormholeServer] terminal WS closed for pty-e5f6 +@kampus/worker:dev: [WormholeServer] reconnecting pty-e5f6... +@kampus/worker:dev: [WormholeServer] reconnected pty-e5f6+
~/sandbox-sdk on main +$ pnpm test + + PASS src/sandbox.test.ts + ✓ creates sandbox instance (12ms) + ✓ opens terminal session (8ms) + ✓ reconnects after sleep (45ms) + ✓ buffers output on disconnect (23ms) + +Tests: 4 passed, 4 total +Time: 0.8s+