Skip to content

feat: session start/shutdown spinners#62

Closed
AThraen wants to merge 10 commits into
mainfrom
feat/session-spinners
Closed

feat: session start/shutdown spinners#62
AThraen wants to merge 10 commits into
mainfrom
feat/session-spinners

Conversation

@AThraen
Copy link
Copy Markdown
Contributor

@AThraen AThraen commented May 17, 2026

Summary

  • Per-session launching spinner inside the xterm host: a CSS rotating arc + phase-specific label (Starting <cmd>… or Connecting to <host>…), visible from the moment the terminal pane mounts and faded out when the first PTY byte arrives.
  • App-exit shutdown overlay on the main window: full-window dim + spinner + Shutting down…, shown at the top of OnClosing with a single dispatcher yield so it paints before the existing synchronous disposal sequence blocks the UI thread.

Design + plan

  • Spec: docs/superpowers/specs/2026-05-16-session-spinners-design.md
  • Plan: docs/superpowers/plans/2026-05-16-session-spinners.md

Implementation notes

  • Spinner lives in Assets/terminal.html and Assets/terminal-transparent.html so it disappears the moment xterm.js sees output — no cross-tier coordination.
  • WebView2 DefaultBackgroundColor is set to #1e1e2e before navigation so the init flicker blends with the spinner.
  • TerminalBridge.PostBootDoneIfNeeded() uses Interlocked.CompareExchange for race-safe one-shot dispatch from OnPtyData + defensive call in Dispose.
  • Shutdown yield uses Dispatcher.InvokeAsync(..., DispatcherPriority.Background) — Background is below Render in WPF's priority order, so the overlay paints before the continuation runs.
  • MainWindow.xaml root was a DockPanel; the overlay was added by wrapping it in a new outer Grid (no layout side effects since a DockPanel inside a single-cell Grid behaves identically).

Test plan

  • dotnet test tests/CodeShellManager.Tests/CodeShellManager.Tests.csproj — 206 unit tests pass on this branch
  • Launch a local session: spinner shows Starting <cmd>… and fades on first prompt byte
  • Launch an SSH session: spinner shows Connecting to <host>…
  • Restore multiple sessions on app launch: each pane shows its own spinner briefly
  • Force a launch failure (typo'd command): spinner appears then wrapper is removed by existing catch path — no orphan
  • Close the app with sessions live: Shutting down… overlay visible during disposal, then window closes
  • Spinner arc color matches each session's accent stripe

🤖 Generated with Claude Code

AThraen and others added 10 commits May 17, 2026 09:36
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nd the overlay

Addresses Copilot review feedback on the parallel PR #63: `bootDone` was only
posted on the first PTY byte, so a child process that writes nothing (or exits
without output) would leave the spinner up indefinitely. NavCompleted now also
schedules a Task.Delay(8000) → PostBootDoneIfNeeded; the existing
Interlocked.CompareExchange guard makes this idempotent if the first byte
beat the timer.
@AThraen
Copy link
Copy Markdown
Contributor Author

AThraen commented May 17, 2026

Closing unmerged. The spinner code in this branch already landed via PR #63 (cf8020c). The only commit unique to this PR is the two design documents (2026-05-16-session-spinners-design.md and 2026-05-16-session-spinners.md); a focused follow-up PR will add those to main so the diff is clean.

@AThraen AThraen closed this May 17, 2026
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.

1 participant