fix(pwa): move Project mode to codec_chat.html (correct page)#25
Merged
fix(pwa): move Project mode to codec_chat.html (correct page)#25
Conversation
…t from dashboard Layout fix per user feedback: PR #24 placed the Project chip on the Flash chat composer in codec_dashboard.html. Wrong page — that's the floating mini-chat. The Chat / Think / Agents mode selector lives on the main Chat page (codec_chat.html) and Project belongs there. Changes: 1. codec_dashboard.html: revert all PR #24 additions (chip dropdown, status pills, sendCmd Project branch, polling). Dashboard back to pre-PR-24 state. 2. codec_chat.html — Project mode added next to Agents: - New Project button in #modeToggle, no emoji, target-icon SVG - setMode('project'): toggles button, hides crewSelect, swaps placeholder to "Drop your project here — describe what you want CODEC to build...", inserts on-screen instructions panel above the messages area with examples - sendMessage() Project branch: POST /api/agents (Step 8 dispatch), renders agent_id + Approve/Reject/View plan buttons inline in the chat thread - approveAgentInChat / rejectAgentInChat / viewAgentPlan handlers for the inline buttons (calls Step 8 endpoints, refreshes pills) - viewAgentPlan inlines the plan + permission manifest as an assistant message so user can review before approving - Status pills above input area: polls /api/agents every 5s, shows running/paused/blocked/awaiting_approval/draft_pending agents with inline approve/pause/resume/abort actions - 401/403 silently hides pills (no auth = no UI by design) No emojis on the new Project chip per user request — text-only "Project" matches the Chat / Think / Agents pattern. Reuses existing escHtml + showToast + scrollBottom + addMessage + chatHist + isProcessing + sendBtn pattern. No new CSS classes, just inline styles matching existing var(--accent) / var(--border) tokens. No Python changes — backend (Step 8 + 9 + 10 endpoints) all shipped.
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
Layout fix for PR #24. Project mode chip was placed on the Flash chat composer (
codec_dashboard.html) — wrong page. The Chat / Think / Agents mode selector lives on the main Chat page (codec_chat.html) and Project belongs there, alongside the existing modes.Per user feedback: no emojis on the Chat or Project chips, on-screen instructions when Project mode is selected.
What changes
codec_dashboard.html— revert PR #24setChatModefunctionsendCmdProject branchcodec_chat.html— add Project the right wayMode button (next to Agents, line 340):
Plain text, no emoji — matches the Chat / Think / Agents convention.
setMode('project')handler:modeProjectBtnactive classcrewSelect(Project doesn't need a crew dropdown)sendMessage()Project branch:/api/agents {title, description}approveAgentInChat(id)→ POST/approve+ posts a confirmation assistant messagerejectAgentInChat(id)→ prompt for reason → POST/rejectviewAgentPlan(id)→ GET/api/agents/{id}→ render plan + permission manifest as an assistant message so user reviews before approvingStatus pills (above input area, polls
/api/agentsevery 5s):Test plan
After merge +
pm2 restart codec-dashboard:/chat(the main Chat page, NOT the dashboard popup)[Chat] [Think] [Agents] [Project]— no emojisagent_id+ 3 buttons: Approve plan / Reject / View plan~/.codec/audit.logforagent_started+agent_checkpoint_*eventsNo Python changes
All backend (Step 8 + 9 + 10 endpoints) shipped in earlier PRs. This is pure HTML/JS layout fix.
🤖 Generated with Claude Code