Skip to content

Hold boot splash until live shells load (no stale "running" flash)#38

Merged
falkoro merged 1 commit into
masterfrom
fix/boot-splash-stale-running
Jun 4, 2026
Merged

Hold boot splash until live shells load (no stale "running" flash)#38
falkoro merged 1 commit into
masterfrom
fix/boot-splash-stale-running

Conversation

@falkoro
Copy link
Copy Markdown
Owner

@falkoro falkoro commented Jun 4, 2026

Problem

On (re)load, the dashboard paints the server-injected initial-model and lifts the boot splash on the next microtask — before the live /api/shells fetch resolves. A session's running flag is a point-in-time server snapshot (running = "tmux session exists"), so the dashboard flashes a stale "running" until the live load lands a moment later. Refreshing showed "running" for things that weren't.

Fix

Gate the splash reveal on the first live loadShells() (.finally), so we only ever reveal client-confirmed state. A 4s setTimeout safety net (plus the page's existing 4s hard fallback) guarantees the splash can't stick if the fetch hangs.

frontend/events.ts (source) + public/events.js (compiled, served).

Verification (real browser, against the running dashboard)

  • Compiled output: booted is now added only via loadShells().finally(liftBootSplash) or the 4s fallback; the eager queueMicrotask(markBooted) is gone.
  • End-state: boots cleanly to 8 live shell cards, splash hidden, 0 stale "running" tabs, 0 console errors.
  • tsc --noEmit clean.

🤖 Generated with Claude Code

On (re)load the dashboard painted the server-injected initial model and lifted the
boot splash on the next microtask — before the live /api/shells fetch resolved. Since
a session's `running` flag is a point-in-time server snapshot ("tmux session exists"),
this flashed a stale "running" until the live load landed a moment later.

Gate the splash reveal on the first live loadShells() (.finally), so we only ever show
client-confirmed state. A 4s setTimeout safety net (plus the page's own 4s hard fallback)
guarantees the splash can never stick if the fetch hangs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 4, 2026 19:07
@falkoro falkoro merged commit cf002c6 into master Jun 4, 2026
@falkoro falkoro deleted the fix/boot-splash-stale-running branch June 4, 2026 19:07
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts the dashboard boot sequence so the boot splash stays visible until the first live shells load completes, preventing a brief flash of stale "running" state from the server-injected initial model during reload/refresh.

Changes:

  • Remove the eager queueMicrotask(markBooted) splash lift after initial render.
  • Lift the boot splash via loadShells().finally(...) (plus a 4s timeout fallback) so the UI reveals after attempting the first live shells fetch.
  • Regenerate the served public/events.js to match the frontend/events.ts source changes.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
frontend/events.ts Gates booted class application on the first live loadShells() completion, with a timeout fallback.
public/events.js Compiled output reflecting the updated boot-splash gating logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/events.ts
Comment on lines +491 to +495
// Hold the boot splash up until the first LIVE shell load confirms session state. The injected
// initial model is a point-in-time server snapshot (running = "tmux session exists"), so revealing
// it immediately flashes a stale "running" before the live fetch lands. Gating the reveal on
// loadShells() means we only ever show client-confirmed state. The timeout is a safety net so the
// splash can never stick if the fetch hangs (the page also keeps its own 4s hard fallback).
Comment thread public/events.js
Comment on lines +538 to +542
// Hold the boot splash up until the first LIVE shell load confirms session state. The injected
// initial model is a point-in-time server snapshot (running = "tmux session exists"), so revealing
// it immediately flashes a stale "running" before the live fetch lands. Gating the reveal on
// loadShells() means we only ever show client-confirmed state. The timeout is a safety net so the
// splash can never stick if the fetch hangs (the page also keeps its own 4s hard fallback).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants