You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace abrupt session removal with a canvas-based "Thanos snap" particle
dispersion: edge-biased, omnidirectional, theme-coloured fine dust drifting
outward. Two presets — `card` (long & dramatic, ~260 particles, 1500ms) for
SessionsHub, `tab` (short & snappy, ~90 particles, 700ms) for TabBar +
SidePanel. Particle palette is built live from session.color + the active
theme's --accent and --text CSS vars (exponential weight decay) so the dust
stays coherent with whatever theme is active. New particleDissolve preference
(default true) gates the canvas effect; the host CSS fade still plays so the
row always exits smoothly.
Replace the blank pre-paint state on freshly spawned terminal sessions with
a Braille dots spinner — the same loader idiom used by npm/cargo/yarn/gh —
gated by a 150ms show-delay so fast localhost spawns never flicker. Drives
off the first xterm onWriteParsed event (true first paint) rather than the
WebSocket attach ack, and fades gracefully on first byte.
Coordinated via a shared dissolvingIds Set on useSessionStore + a
useDissolveDelete hook that fires API DELETE in parallel with the visual,
removes the row from local/store state once the host fade completes, and
shields the polling loops in TerminalApp + SessionsHub so the row stays
mounted long enough for the animation to play out. Hero-source rule means
only the surface the user clicked emits canvas particles; mirror surfaces
play the CSS fade only. Concurrency cap at 3 active canvases. Honors
prefers-reduced-motion throughout.
Also fixes two flaky test categories surfaced while developing this:
* macOS dev-machine flake — file-tree.test.js, preview.test.js,
config.test.js, tunnel-token-renewal.test.js all called
createTermBeamServer without isolating configDir, so on developer machines
they would read ~/.termbeam/prefs.json and auto-spawn workspace sessions
whose cwd overrode the test fixture. Each test now creates a per-server
mkdtempSync configDir cleaned up in after().
* Windows CI 180s timeout — node-pty ConPTY threads persist after pty.kill()
and keep the per-file worker alive past the test-timeout. npm test +
npm run test:coverage now pass --test-force-exit, Node's supported flag
for forcing worker exit after all tests complete.
Documentation updates in copilot-instructions.md cover both invariants.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
-**`test/cli/resume.test.js`** — uses `TERMBEAM_CONFIG_DIR` env var pointing to a temp directory for isolation.
36
36
-**WebSocket connections** — close in `finally` blocks or `after()` hooks to prevent connection leaks.
37
37
-**Windows temp directory cleanup** — on Windows, node-pty ConPTY holds directory locks after `pty.kill()`. Use `await safeCleanup(dir)` (async `fs.promises.rm` with `maxRetries`) instead of `fs.rmSync` in `after()` hooks and `finally` blocks when the temp dir was used as a PTY CWD. See the `safeCleanup()` helper in `test/server/routes.test.js`.
38
+
-**`configDir` isolation** — every test that calls `createTermBeamServer({ config })` MUST set `configDir` (or `TERMBEAM_CONFIG_DIR` env var) to a fresh `mkdtempSync` temp directory. Without this, the server reads the developer's real `~/.termbeam/prefs.json` and may auto-spawn workspace sessions with a different `cwd`, silently breaking assertions about the default session. `routes.test.js`'s `startServer()` is the canonical example.
39
+
-**`--test-force-exit`** — `npm test` passes this flag so dangling Windows ConPTY threads can't keep the worker alive past the 180 s per-file timeout. Tests that legitimately need to leak resources for assertions should be flagged in the suite description.
38
40
39
41
**Port isolation:** Integration tests use port `0` (OS-assigned random port) to avoid conflicts. Never hardcode ports in tests.
0 commit comments