Skip to content

Conversation

@melonamin
Copy link
Contributor

Summary

Implements interactive plan creation in the web dashboard, allowing users to create plans through a browser-based workflow instead of CLI-only.

Closes #32

Changes

  • WebInputCollector: Channel-based input collector that blocks on AskQuestion() until web client submits an answer via /api/answer
  • PlanRunner: Orchestrates plan creation sessions - starts Claude with plan prompt, handles Q&A loop, manages session lifecycle
  • Session resume: Detect and resume interrupted plan sessions from progress files
  • Q&A JSON parsing: Handle multi-line output with log prefixes (timestamps split across lines)
  • UI: "New Plan" modal with directory selection (recent dirs from config) and description input
  • SSE events: Real-time question/answer streaming to browser

Architecture

Uses channel-based coordination (option 1 from the issue):

  1. PlanRunner.StartPlan() launches Claude with plan creation prompt
  2. When QUESTION signal detected, WebInputCollector.AskQuestion() blocks on channel
  3. SSE emits question/options to browser
  4. Browser renders modal, user selects answer
  5. POST /api/answer unblocks the runner
  6. Loop continues until PLAN_READY signal

For directory selection (option C): Uses recent directories from config, user can also type custom path.

Test plan

  • Unit tests for WebInputCollector, PlanRunner, resumable detection
  • Server handler tests for new endpoints
  • Test coverage at 88% for web package
  • E2E: Start plan from web UI, answer questions, verify plan file created
  • E2E: Interrupt session, resume from web UI

Enable users to create and run plans directly from the web UI. Key changes:

- Add PlanRunner to handle plan creation workflow from web interface
- Implement InputCollector for capturing user responses to Claude questions
- Add ResumableSession for managing long-running plan creation processes
- Extend SSE events to support plan creation progress streaming
- Update web UI with plan creation form and real-time feedback display
- Add session state tracking (planning, executing, completed, failed)
- Include question/answer UI for interactive plan refinement

The web dashboard now supports the full plan creation flow: users can
describe a feature, answer clarifying questions from Claude, and monitor
the plan being written in real-time.
- Add ResumePlan for continuing interrupted plan sessions from web UI
- Fix Q&A JSON parsing to handle multi-line output with log prefixes
- Remove answer queueing and /api/answer-by-question endpoint
- Add resumable session detection from progress files
- Extract createWebServer/createMultiSessionServer helpers
- Fix race condition in server lifecycle test
- Improve test coverage for web package (88%)
@melonamin melonamin requested a review from umputun as a code owner January 27, 2026 22:41
@melonamin melonamin marked this pull request as draft January 27, 2026 22:44
@melonamin
Copy link
Contributor Author

@umputun please play with the UI, when you have time, and tell me how you feel about it.

@umputun
Copy link
Owner

umputun commented Jan 28, 2026

found these issues on first try:

  1. UX: --serve alone fails - without --watch, errors "no plans found". if someone wants to create their first plan via web UI, they shouldn't need watch dirs. suggest:

    • treat --serve alone as minimal dashboard mode (current dir as default watch)
    • or give helpful error: "use --watch to start dashboard"
  2. UI: empty status badge visible - renders as empty pill when no session active. should hide when empty:

    .status-badge:empty { display: none; }

haven't done deep code review yet - this is just from trying to run it.

@melonamin
Copy link
Contributor Author

Addressed both.

I think that the mental model behind --serve and --serve --watchdir can be a bit confusing.

My main and only use case is that I always run it as --serve --watchdir ~/Developer, basically like a daemon. Then, all ralphex sessions are picked up automatically.

I understand the appeal of having an ad-hoc --serve, but if it were my product, I would probably sacrifice the flexibility for simplicity, both in terms of the mental model and the code.

Your call, obviously.

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.

idea: interactive plan creation in web dashboard

2 participants