Skip to content

fix(pwa): move Project mode to codec_chat.html (correct page)#25

Merged
AVADSA25 merged 1 commit intomainfrom
feat/phase35-step11-fix-correct-page
May 3, 2026
Merged

fix(pwa): move Project mode to codec_chat.html (correct page)#25
AVADSA25 merged 1 commit intomainfrom
feat/phase35-step11-fix-correct-page

Conversation

@AVADSA25
Copy link
Copy Markdown
Owner

@AVADSA25 AVADSA25 commented May 3, 2026

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 #24

  • Remove chip dropdown (Chat | Project)
  • Remove status pills container
  • Remove setChatMode function
  • Remove sendCmd Project branch
  • Remove polling block
  • Dashboard fully back to pre-PR-24 state

codec_chat.html — add Project the right way

Mode button (next to Agents, line 340):

<button class="mode-btn" onclick="setMode('project')" id="modeProjectBtn">
  <svg .../>Project
</button>

Plain text, no emoji — matches the Chat / Think / Agents convention.

setMode('project') handler:

  • Toggles modeProjectBtn active class
  • Hides crewSelect (Project doesn't need a crew dropdown)
  • Sets placeholder: "Drop your project here — describe what you want CODEC to build..."
  • Inserts an on-screen instructions panel above messages with examples (Marbella property bot, EUR/USD vol monitor, launch plan)
  • Removes the panel when switching out

sendMessage() Project branch:

  • POST /api/agents {title, description}
  • Renders Approve plan / Reject / View plan buttons inline in the chat thread
  • approveAgentInChat(id) → POST /approve + posts a confirmation assistant message
  • rejectAgentInChat(id) → prompt for reason → POST /reject
  • viewAgentPlan(id) → GET /api/agents/{id} → render plan + permission manifest as an assistant message so user reviews before approving

Status pills (above input area, polls /api/agents every 5s):

  • Auto-injected if not present in DOM
  • Shows running / paused / blocked / awaiting_approval / draft_pending / crashed_resumed agents
  • Per-status inline action links: approve / pause / resume / abort
  • 401/403 silently hides (no auth = no UI by design)

Test plan

After merge + pm2 restart codec-dashboard:

  1. Navigate to /chat (the main Chat page, NOT the dashboard popup)
  2. See mode buttons: [Chat] [Think] [Agents] [Project] — no emojis
  3. Click Project → mode button activates
  4. Instruction panel appears above messages with examples
  5. Placeholder changes to "Drop your project here…"
  6. Type "Build me a Telegram bot for Marbella property listings under €500k" → Send
  7. Response shows in chat thread with agent_id + 3 buttons: Approve plan / Reject / View plan
  8. Click View plan → another assistant message renders the goals + checkpoints + permission manifest
  9. Click Approve plan → confirm → status pill above input flips to running
  10. Watch ~/.codec/audit.log for agent_started + agent_checkpoint_* events

No Python changes

All backend (Step 8 + 9 + 10 endpoints) shipped in earlier PRs. This is pure HTML/JS layout fix.

🤖 Generated with Claude Code

…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.
@AVADSA25 AVADSA25 merged commit f30c46b into main May 3, 2026
1 check passed
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.

2 participants