Skip to content

feat: Electron desktop app#7

Open
takhir-iota wants to merge 1 commit into
mainfrom
feat/electron
Open

feat: Electron desktop app#7
takhir-iota wants to merge 1 commit into
mainfrom
feat/electron

Conversation

@takhir-iota

@takhir-iota takhir-iota commented Feb 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds Electron desktop app as an alternative to the Bubble Tea TUI
  • New Go WebSocket server (cmd/warroom-server) wraps the existing debate.Runner event loop and exposes state + actions over WebSocket
  • Electron frontend (electron/) renders the same 3-column dashboard (models roster, activity feed, stats) with web technologies
  • Existing CLI is untouched — both TUI and Electron work in parallel

Architecture

Electron main process
  └─ spawns warroom-server binary (auto-assigned port)
      └─ WebSocket server on 127.0.0.1:PORT
          └─ wraps debate.Runner (same engine as TUI)
              └─ same OpenRouter API, session I/O, presets

Electron renderer
  └─ connects to ws://127.0.0.1:PORT/ws
  └─ renders state snapshots as HTML/CSS
  └─ sends user input (topic, API key, ask_user answers) back

New files

File Purpose
cmd/warroom-server/main.go Go WebSocket server wrapping debate.Runner
electron/main.js Electron main process (spawns server, creates window)
electron/preload.js Context bridge for IPC
electron/renderer.html App shell
electron/renderer.css Styles (dark theme matching TUI colors)
electron/renderer.js Frontend logic (WebSocket, rendering, event handling)
electron/package.json Electron dependencies and build config

Usage

just build-server   # Build the Go WebSocket server
just electron       # Run Electron app in dev mode
just electron-build # Build distributable DMG

Test plan

  • Go server compiles cleanly
  • Existing CLI compiles cleanly
  • All existing tests pass
  • Manual test: just electron launches the app
  • Manual test: debate runs end-to-end in Electron

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features

    • Launched Electron desktop application providing a real-time interactive interface for the War Room debate flow.
    • Implemented WebSocket-based backend server enabling live state updates, model status tracking, activity feeds, and interactive user prompts for API configuration and discussion questions.
  • Chores

    • Updated build system to support Electron application bundling and deployment.

Ports the Bubble Tea TUI to a native Electron desktop app while keeping
the existing CLI intact. Architecture: Go WebSocket server
(cmd/warroom-server) exposes the debate Runner's async event loop over
WS, and an Electron frontend (electron/) connects and renders the same
3-column dashboard (models, activity feed, stats) with web technologies.

New files:
- cmd/warroom-server/main.go — WebSocket server wrapping debate.Runner
- electron/ — Electron app (main process, preload, HTML/CSS/JS renderer)
- Justfile recipes: build-server, electron, electron-build

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Feb 14, 2026

Copy link
Copy Markdown

Walkthrough

These changes introduce an Electron-based desktop client for the Warroom application, paired with a new WebSocket-based Go server. The Go server manages debate state, handles LLM interactions, and streams state updates to clients. The Electron app provides a real-time dashboard UI with model roster, activity feed, and statistics. Build infrastructure and dependencies are updated to support the new components.

Changes

Cohort / File(s) Summary
Configuration & Dependencies
.gitignore, go.mod
Updated ignore patterns for Electron artifacts and warroom-server binary; added explicit golang.org/x/net dependency and bumped indirect module versions.
Build Infrastructure
Justfile
Added four new recipes (build-server, electron-deps, electron, electron-build) for compiling and packaging the server and Electron app; extended clean recipe to remove new build artifacts.
Go WebSocket Server
cmd/warroom-server/main.go
Introduces a full WebSocket-based debate runner backend with typed message protocol, state snapshots, discovery/discussion flow helpers, HTTP server setup, and handlers for initialization, action dispatch, LLM execution, and state emission. ~662 lines of server logic.
Electron Desktop App
electron/main.js, electron/preload.js, electron/package.json
Electron bootstrap with app lifecycle management, Go server process spawning and port detection, IPC bridge for server port exposure, and package metadata with build targets and resource bundling.
Electron Renderer UI
electron/renderer.html, electron/renderer.css, electron/renderer.js
HTML template, comprehensive dark-themed stylesheet with 3-column layout (roster/activity/stats), and vanilla JS renderer implementing WebSocket client, state management, multi-view UI (connect/start/key/topic/dashboard screens), and interactive ask-user overlay for discovery questions.

Sequence Diagram(s)

sequenceDiagram
    participant R as Renderer (JS)
    participant EM as Electron Main
    participant GS as Go Server
    participant WS as WebSocket
    
    EM->>GS: Spawn server process
    GS->>EM: stdout: port number
    EM->>EM: Port received, store
    EM->>R: App ready, window created
    R->>EM: getServerPort() via IPC
    EM-->>R: Return port
    R->>WS: WebSocket connect to localhost:port/ws
    WS->>GS: Connection established
    GS->>WS: Send "hello" with models/presets
    WS->>R: Receive hello message
    R->>R: Render start screen
    R->>WS: Send "set_api_key" message
    WS->>GS: Process API key
    GS->>WS: Send state snapshot
    WS->>R: Receive state update
    R->>R: Render dashboard
    R->>WS: Send "set_topic" message
    WS->>GS: Initialize debate runner
    GS->>GS: Execute round logic
    GS->>WS: Send state updates
    WS->>R: Stream activity/model status
    R->>R: Real-time dashboard refresh
Loading

Estimated Code Review Effort

🎯 4 (Complex) | ⏱️ ~50 minutes


🐰 With Electron's gleam and WebSocket's call,
A desktop app for one and all,
Where models debate and state flows free,
Colors dancing, chat in spree,
The warroom's new home comes to be! 🎉


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

diyor28 pushed a commit that referenced this pull request Feb 15, 2026
Core resilience:
- #1: Add React ErrorBoundary wrapping the app — render errors now show
  a styled fallback with reload button instead of a white screen
- #2: Wire onUpdateDownloaded from preload into useDebate state so the
  renderer can display an update-available banner
- #4: Remove dead submitTopic from useDebate hook and DebatePage
- #5: Add backend crash detection — main process forwards Go exit event
  via IPC, preload exposes onBackendExited, useDebate sets connected=false
  and shows error banner when backend dies
- #8: Fix route param changes being silently ignored — remove stale
  connectedRef guard; useEffect now disconnects previous session and
  reconnects on topic/resume change
- #11: Fix O(n²) activity scan per stream tick — walk backwards and
  break on first match instead of .map + .slice().some() per element
- #19: Add beforeunload handler during active debates to prevent
  accidental window close / data loss

Accessibility:
- #6: Add ARIA attributes across all components — role="alert" on
  ErrorBanner, role="status" + aria-label on GlowDot, role="complementary"
  on ModelRoster, role="progressbar" on progress bars, aria-label on
  textarea and dialog, aria-checked on QuestionStep options
- #12: Add focus management to AskUserOverlay — saves previous focus,
  auto-focuses first interactive element on mount, restores focus on
  unmount, implements keyboard focus trap (Tab/Shift+Tab)
- #14: Surface JSON parse errors in AskUserOverlay — shows visible error
  state with dismiss button instead of silently fabricating a question
- #15: Fix partial answer submission — check raw answers array for
  all-empty instead of checking formatted string against "(no answer)"

UX polish:
- #3: Delete dead LoadingState component (zero imports)
- #7: Lower noise-overlay z-index from 50 to 1 to avoid stacking
  conflict with titlebar drag region
- #9: Add "Open Folder" button to SessionListPage using the existing
  but previously unused openSessionsFolder preload API
- #10: Extract renderTranscriptEvent and roleBadge as pure functions
  outside DebateDashboard component to avoid recreation on every render
- #13: Replace hardcoded Tailwind colors in StatusBadge with theme
  tokens (text-success, text-error, text-warning)
- #16: Add window.confirm() before shutdown to prevent accidental
  cancellation of in-progress debates
- #18: Add refresh() to useSessionList hook, wire refresh button and
  visibilitychange auto-refresh to SessionListPage
- #21: Remove defaultOpen from transcript Collapsibles in
  SessionDetailPage — long transcripts now load collapsed

https://claude.ai/code/session_01QPxpz4R7j4MFwGAqLEkwpb
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