Skip to content

idea: interactive plan creation in web dashboard #32

@umputun

Description

@umputun

@melonamin - since you built the web dashboard (#17), wanted to share an idea.

the --plan mode (#22) was designed with web integration in mind. the architecture already supports it:

what we have:

  • InputCollector interface - pluggable input collection (pkg/input/input.go)
  • BroadcastLogger already emits Q&A events to SSE (pkg/web/broadcast_logger.go)
  • progress file stores full Q&A history - enables browser reconnect
  • QUESTION signal with JSON payload containing question + options
  • PLAN_READY signal when Claude finishes the plan

how terminal flow works:

  1. Claude explores codebase, emits <<<RALPHEX:QUESTION>>> with JSON
  2. TerminalCollector.AskQuestion() displays options via fzf
  3. user selects, answer logged to progress file
  4. next Claude iteration sees prior Q&A, asks follow-up or creates plan
  5. PLAN_READY signal → user confirms → full execution begins

web adaptation:

  • create WebInputCollector implementing same interface
  • when QUESTION signal detected, pause execution loop
  • emit SSE event with question/options to browser
  • browser renders form/modal for selection
  • POST /api/sessions/{id}/answer → unblocks runner
  • continue to next iteration

the tricky part is bidirectional coordination - runner blocks on AskQuestion() waiting for web client response. options:

  1. channel-based: runner waits on channel, HTTP handler sends answer
  2. polling: runner checks for answer file/flag periodically
  3. context-based: inject answer via context value

leaning toward (1) - cleaner, no polling overhead.

open question: how does user navigate to project directory? current web dashboard assumes you're already in the right dir when starting ralphex. maybe:

  • A) browser-based file picker (complex)
  • B) predefined project list in config
  • C) just document that user should cd to project first (same as CLI)

thoughts? feel free to take this in a different direction - just wanted to share that the groundwork is there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions