feat(phase35-step11): Project mode UI (chat composer + status pills)#24
Merged
Conversation
…s pills)
Adds 3 things to the existing chat composer in codec_dashboard.html:
1. Mode toggle chips above input — [💬 Chat | 🎯 Project]. Default: chat.
Selecting Project changes the placeholder to "Drop your project here..."
and routes sendCmd() to POST /api/agents instead of /api/command.
2. Agent status pills above input — polls /api/agents every 5s and renders
one pill per agent in (running, paused, blocked_*, awaiting_approval,
draft_pending, crashed_resumed) state. Inline action links per status:
running → [pause] [abort]
paused → [resume] [abort]
awaiting_approval → [approve] [abort]
blocked_* → [abort] (grant requires kind+value, deferred)
draft_pending → [abort]
401/403 silently hides pills (no auth = no UI, by design).
3. sendCmd() dispatch branch: when window._chatMode === 'project', POSTs
the user text to /api/agents (Step 8 endpoint) and shows agent_id +
instructions in the result panel. Falls through to existing chat
path when mode === 'chat' (default).
Reuses existing escHtml + showToast + var(--accent)/var(--border) CSS
tokens. No new CSS classes, no new dependencies. Pure HTML/JS additions
to codec_dashboard.html.
No Python changes — backend (POST /api/agents, GET /api/agents,
abort/pause/resume/approve endpoints) all shipped in Phase 3 Steps 8+9.
This PR is the user-facing affordance that makes those endpoints usable
without curl.
Test plan: load dashboard, verify mode chips render, click Project →
verify placeholder updates, type "Build me a property bot" + send →
verify drafts appear in /api/agents response and pill renders. Approve
via [approve] inline link → verify codec-agent-runner picks up.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 3.5 Step 11 — Project mode UI for the existing chat composer. Closes the gap from Phase 3 Step 10 (which deferred PWA HTML to Phase 3.5).
You can now drop a project from the chat composer without curl. Status pills above input poll
/api/agentsevery 5s and render running/blocked/paused/awaiting agents with inline action links.What changes
HTML (single file:
codec_dashboard.html):[💬 Chat | 🎯 Project]setChatMode(),refreshAgentStatusPills(),abortAgent()/pauseAgent()/resumeAgent()/approveAgent()sendCmd()dispatch branch: Project mode →POST /api/agents(Step 8 endpoint)No Python changes. All backend support (POST /api/agents, GET /api/agents, abort/pause/resume/approve/grant endpoints) shipped in Phase 3 Step 8 + Step 9.
Pill states + actions
runningpausedawaiting_approvaldraft_pendingblocked_on_permission/blocked_on_destructivecrashed_resumedPolls
/api/agentsevery 5 s; refreshes immediately after any action click. Silent on 401/403 (pills hide; no auth = no UI).Test plan
codec_dashboard.html; no Python tests impactedescHtmlandshowToastreused (verified at lines 778, 1919)pm2 restart codec-dashboard(HTML is served by FastAPI; restart picks up the new template)agent_id=agent_xxx+ instructionsagent_xxxinawaiting_approvalstaterunning~/.codec/audit.logforagent_started+agent_checkpoint_*eventsPhase 3.5 next steps
After this:
docs/PHASE35-ANCHOR-EXAMPLE-RUN.md)🤖 Generated with Claude Code