Commit Graph
1304 Commits
Author SHA1 Message Date
g-butandClaude Sonnet 4.6 b4c98d7bd5 fix(projects): use ui-input-tight for goal-link select in GoalsTab
Replaced inline custom class string (bg-surface-raised, border-border-subtle,
etc.) with the SSOT ui-input-tight class.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 19:41:14 +02:00
g-butandClaude Sonnet 4.6 248892d52e feat(projects): add status filter chips to ProjectGrid
With 15 projects across multiple status values, the status filter chips
let the user quickly narrow to production, early-stage, etc. Chips appear
only when 2+ distinct status values exist; badge updates to show
filtered/total counts; health-issues summary stays anchored to all
projects for full fleet visibility.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 19:35:59 +02:00
g-butandClaude Sonnet 4.6 3bcda707c7 feat(profile): build out public profile page with projects + essays
Public /u/[username] now shows active projects that have a gitUrl (as
linkable cards with stack tags) and the 4 most recent published essays.
Added getPublicProjects() query that filters for active+gitUrl rows.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 19:32:53 +02:00
g-butandClaude Sonnet 4.6 37140cb205 fix(people): resolve conflicting Tailwind class overrides on health filter chips
The chips were mixing ui-chip-filter/active with conflicting rounded-full,
px-3, py-1.5 overrides, producing unpredictable layout. These dot-indicator
pills are a distinct shape from ui-chip-filter (rounded-xl), so they now use
clean custom state classes. Clear button uses ui-chip-filter without overrides.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 19:21:48 +02:00
g-butandClaude Sonnet 4.6 73c9338f66 fix(ui): replace inline search input styles with ui-input in GoalsGrid
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 19:16:23 +02:00
g-butandClaude Sonnet 4.6 fc993542df fix(ui): replace inline filter-chip styles with ui-chip-filter SSOT in EventsGrid + ThoughtsLibrary
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 19:14:32 +02:00
g-butandClaude Sonnet 4.6 f549a69528 refactor(system): extract humanCronSchedule to lib/crons — removes duplicated cron-label map
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 19:10:51 +02:00
g-butandClaude Sonnet 4.6 e439621e0c fix(agent): include DB-only projects when applying agent to open tabs
applyToOpenTabs only read parseProjectsConf(), missing projects managed
via the DB (Settings → Add project). Now merges conf-file and DB sources,
deduplicating by tab name so conf-file projects aren't restarted twice.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 19:04:44 +02:00
g-butandClaude Sonnet 4.6 e7ba88097b fix(clear-context): fall back to DB projects when tab not in conf file
Same bug as inject route — DB-only projects (added via Settings) were
returning 404 on clear-context. Now falls back to user_projects lookup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 19:01:32 +02:00
g-butandClaude Sonnet 4.6 05415bf337 fix(inject): fall back to DB projects when tab not in conf file
Projects added via Settings (user_projects table) were silently 404-ing
on injection because readProjectsMap() only read the conf file. DB-only
projects now resolve correctly; projectPath is sourced from dirPath too.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 19:00:04 +02:00
g-butandClaude Sonnet 4.6 d1df65f30f feat(settings): drag-reorder projects + use DB position as sort tiebreaker
Projects can now be dragged to reorder in Settings. Position is persisted
per-row via PATCH. The control panel's idle section respects this order as
the final tiebreaker (after activity state and git activity).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 18:54:21 +02:00
g-butandClaude Sonnet 4.6 ee7f3a5cec fix(orchestration): remove duplicate session handoff block for Claude/Codex
renderTaskForAdapter was always appending the generic "update the session
handoff" block, even though buildPromptWithSession already appends the
specific file-path version. Both Claude and Codex paths call
buildPromptWithSession, so they received the instructions twice.

Now only OpenClaw gets the generic block (it uses the render output
directly, without buildPromptWithSession wrapping).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 18:45:42 +02:00
g-butandClaude Sonnet 4.6 54e90b3764 refactor(devlog): cap at 50 entries, show time in list, remove dead analytics fn
- appendProjectDevLog: read-modify-write capping at 50 entries so the
  JSONB column can't grow unboundedly with auto-capture enabled
- DevLogList: show HH:MM alongside date — multiple same-day entries from
  auto-capture are now distinguishable at a glance
- Remove getTopIntentFrequencies + IntentFrequency type — never called
  anywhere (YAGNI)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 18:42:08 +02:00
g-butandClaude Sonnet 4.6 4f6ff28e95 feat(devlog): auto-capture agent session changes as dev log entries
Previously dev log entries only appeared when the PyQt beacon popup was
used. Now every time the agent updates session.done (detected on the 30s
control poll), a dev log entry is appended automatically — covering
auto-continue, direct panel injections, and all other flows.

Also extracts appendProjectDevLog to db/queries/user-projects.ts as a
shared function, removing the duplicate DB logic that lived privately in
the beacon route.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 18:37:29 +02:00
g-butandClaude Sonnet 4.6 384b586a90 fix(control): scale recentActivity limit by project count to prevent starvation
With a fixed limit of 30, a busy project could consume all rows and leave
other project cards with zero "Sent today" history entries. Now fetches
max(30, projectCount * 5) rows so every project can get up to 5 items.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 18:32:59 +02:00
g-butandClaude Sonnet 4.6 7c42029e34 feat(control): per-project injection history section in each project card
Adds a collapsible "Sent today" section below SessionSummary in every
project card showing the last 5 injections for that project with
timestamps and truncated prompt text. No extra DB query — groups the
already-fetched recentActivity (24h global) by project key in the
control API route. Falls back to empty / hidden when no injections exist.

Closes the injection history tracking loop: data written in
prompt_history (383c166), now surfaced both globally (ActivityLogPanel)
and per-project (InjectionHistorySection).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 18:16:30 +02:00
g-butandClaude Sonnet 4.6 383c166e79 feat(inject): record injection history for activity log + prompt autocomplete
Every injection now writes to prompt_history (fire-and-forget, same as the
existing orchestration events). This feeds two already-built but data-starved
features:
- ActivityLogPanel on the Control page (recentActivity feed)
- recentCustomPrompts autocomplete in each project card's composer

Stores full customPrompt text, canonical projectKey, projectPath, adapter,
and resolved intent. Uses parseProjectsConf() to resolve the project dir
without an extra map lookup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 17:49:17 +02:00
g-butandClaude Sonnet 4.6 b3d9e5aabc fix(merge): replace broken openclaw fallback with proven agent pattern
Two bugs made AI Merge completely non-functional:
1. Groq path: GROQ_API_KEY not set → silently falls through
2. OpenClaw path: `capability model run` → should be `infer model run`
   (wrong subcommand, always fails with parse error)

Replace the slow infer/Codex fallback (4+ min) with the same
`openclaw agent --agent main` pattern that Ivy uses (Claude, ~20-30s).
Removes the custom spawn() infrastructure in favor of runTool().
Groq fast path unchanged — add GROQ_API_KEY to .env.local to enable it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 17:42:26 +02:00
g-butandClaude Sonnet 4.6 47ccb2f2b1 fix(project-states): attribute writes to session user, drop OR-isNull fallback
All project_state rows now carry the real user_id (from getCurrentUserId,
which falls back to DEFAULT_USER_ID for unauthenticated terminal agents).
Removes the or(isNull) workaround in getProjectStatesByUserId — it was
a SSOT leak that would expose every row to a second user if one were added.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 17:32:45 +02:00
g-butandClaude Sonnet 4.6 f58baed16b fix(inject): restore original tab after injection + surface errors to UI
Zellij has no API for writing to an unfocused pane, so every injection
must switch tabs. Previously the terminal stayed on the target tab after
inject; now it switches back immediately (sub-200ms flash, imperceptible).

Also wraps onInject at the ControlPanel level with error handling so
failed injections (tab not found, zellij unavailable, etc.) surface
as a visible error message rather than silently disappearing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 14:10:55 +02:00
g-butandClaude Sonnet 4.6 48871dcb61 feat(merge): Groq fast path + openclaw fallback + infra Thoughts post
- AI Merge now tries Groq first (sub-3s) when GROQ_API_KEY is set
- Falls back to openclaw local Codex (~4 min) when key absent
- Thoughts post: groq-neon-and-the-next-infra-layer.md — sequencing
  plan for Groq activation, Neon prod wiring, and auth rollout

To activate fast merge: add GROQ_API_KEY to .env.local

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 13:39:52 +02:00
g-butandClaude Sonnet 4.6 ded40ffb5a feat(thoughts): two new posts — image upload + Control vs Projects analysis
- images-as-agent-input.md: case for visual context in agent prompts,
  implementation sketch (temp file bridge), and MVP scope
- control-vs-projects-two-views-one-system.md: SSOT mapping for both
  tabs, what tiles show, improvement opportunities, latent SSOT violation
  (profile file vs user_projects record)

Also fix: control tile health text now uses getHealthShort() — was
showing full verbose string "GOOD — deployed; all tests pass" instead
of compact "GOOD"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 13:36:02 +02:00
g-butandClaude Sonnet 4.6 84362dbd85 fix(control): make AI merge queue feature actually work
Previous implementation called `openclaw agent` (requires gateway session)
which always timed out. Switched to `openclaw capability model run` via a
detached process group spawn so Node can kill the whole process tree on
timeout. Local model inference takes 3-5 min; set ceiling at 6 min.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 13:29:16 +02:00
g-butandClaude Sonnet 4.6 64692abb26 fix(control): sync auto-continue pause state to PyQt beacon popup
Previously the PyQt popup always started with auto-continue ON, ignoring
any pause set in the web control panel (only mattered when Cockpit was
down at popup-open time).

Fix: write/delete /tmp/cockpit-auto-continue-<tab> whenever the web app
toggles or resets auto-continue state (new API route). PyQt reads the
sentinel on init and skips starting the countdown when paused.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 12:43:54 +02:00
g-butandClaude Sonnet 4.6 b1c70e050d chore(control): remove unused Pause/Play imports from project-card-sections
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 12:36:25 +02:00
g-butandClaude Sonnet 4.6 b43e449e62 refactor(control): split god component + progressive disclosure in beacon
- Extract PromptInput and QueueList from project-card-sections.tsx into
  project-composer.tsx (was 855 lines, now ~355)
- Extract IntentButtonPanel into project-intent-panel.tsx
- Beacon popup: collapse 4 disconnected rows into unified composer card
  (textarea + mic in corner + one-row action bar with pause/queue/send)
- Beacon popup: progressive disclosure for prompts — action chips in
  flex-wrap row, more prompts hidden behind "More (N)" toggle chip
- PROMPT_STYLE in control.ts is now SSOT for chip CSS classes across
  both ReadyBanner and beacon popup

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 12:35:02 +02:00
g-butandClaude Sonnet 4.6 bb8e58a68d refactor(beacon): unify composer into a single card surface
Replace the scattered status-line + PromptInput + word-count blocks with
one rounded card that holds the textarea, waveform strip, and action bar as
a single visual unit.

- Textarea: borderless, transparent bg, mic button in the top-right corner
- Waveform strip: appears between textarea and action bar only while recording
- Action bar: one row — pause toggle · status text (flex-1) · queue icon · Send pill
- Send button fills (bg-text-primary) when there is content; ghosts when empty
- Status text adapts: countdown preview → hint shortcuts → recording/transcribing states
- Removed word/char count (noise in a command interface)
- PromptInput import dropped from beacon page; QueueList retained

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 12:08:17 +02:00
g-butandClaude Sonnet 4.6 2f6e8a60a7 fix(control): health dot color always wrong in tile view
ProjectTile passed the full health string (e.g. "GOOD — deployed; all tests pass")
as the HEALTH_COLOR key, which never matched the short lowercase keys, so the dot
always fell back to text-text-muted.

Extract getHealthShort() to control.ts and use it in all three call sites
(ProjectTile, project-card-helpers, project-card-sections) — eliminating the
duplicated split logic while fixing the bug.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 11:57:38 +02:00
g-butandClaude Sonnet 4.6 fe55e7e139 fix(thoughts): resolve Mermaid colors from CSS design tokens at runtime
Replace 4 hardcoded hex values in MermaidDiagram themeVariables with
resolveColorVar() which applies each CSS custom property to a hidden
element and reads the browser-computed rgb() value. This keeps Mermaid
diagrams in sync with the design token SSOT in globals.css rather than
maintaining a parallel set of hex literals.

Fallbacks are neutral dark greys in case the var is missing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 11:47:24 +02:00
g-butandClaude Sonnet 4.6 c7abed75a5 fix(beacon): eliminate double-inject race + queue wipe on reboot
Double-inject (control panel + web beacon firing at same second):
- Add 1s grace period to beacon auto-fire. /api/inject already calls
  cancelActiveBeaconSessions synchronously; the 1s gap + 500ms close-poll
  gives the cancel time to propagate and close the beacon before it fires.
- Reduce beacon close-poll from 2s to 500ms so cancels are detected
  within 500ms rather than up to 2s.

Queue wipe on reboot (/tmp cleared, localStorage persists):
- Queue API GET now returns { queue, exists } so callers can distinguish
  "file not found" (exists=false) from "file is empty array" (exists=true).
- Poll skips overwrite when exists=false, preventing empty file result
  from wiping a non-empty localStorage queue after reboot.
- Mount effect bootstraps the file from localStorage when file is absent,
  so PyQt sees the queue on its next poll cycle after a reboot.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 11:38:25 +02:00
g-butandClaude Sonnet 4.6 09a1f29e57 fix(queue): file-bridge API, casing SSOT, remove() race, mic pause
- Add /api/beacon/queue/[tab] GET/PUT — file bridge for cross-process
  queue sync between PyQt and web app
- stateFile.queue() centralises /tmp/agent-queue-{tab} path
- Normalize tab to lowercase in route + _beacon_popups._queue_file()
  so all three consumers (web beacon, control panel, PyQt) share one file
- remove() now syncs to file immediately from localStorage rather than
  waiting for the React render → effect cycle; fixes queue item
  reappearing on next beacon because page closed before PUT completed
- isComposing includes listening||processing so countdown pauses during
  mic recording and Whisper transcription, not just when text is present
- Auto-fire effect also guards on listening||processing as a safety net
  for edge case where countdown initialises at 0
- Status line shows "Recording — auto-continue paused" / "Transcribing…"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 11:27:50 +02:00
g-butandClaude Sonnet 4.6 a5f429f5af fix(beacon): pause countdown until prompts are loaded
The ticker was running even while the page was still fetching prompts,
so a slow load could consume the entire 12-second window before the UI
was interactive. Now the interval is suspended while prompts.length === 0
— the auto-fire guard was already there, this makes the visible counter
match. The user always sees the full remaining window once the page is ready.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 09:27:25 +02:00
g-butandClaude Sonnet 4.6 eb973be601 fix(beacon): always reset auto-continue to ON when beacon popup opens
When the user had previously paused auto-continue and the control panel was
not open in the browser, the beacon page would open with the stale "off"
state from localStorage — countdown showed "Paused", beacon.py polled 120s
with no response, and nothing was injected.

The beacon is a one-shot popup; each open should default to ON. Users can
still pause during the 12-second window. The control panel remains the
authority for persistent auto-continue state across sessions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 09:22:58 +02:00
g-butandClaude Sonnet 4.6 6f5cde8006 fix(transcribe): pre-convert webm→wav before Whisper; fix stderr swallowed as Buffer
Two bugs in the transcription route:

1. Chrome's MediaRecorder sometimes produces webm without an EBML EndOfFile
   tag (especially short recordings). Whisper's internal ffmpeg subprocess
   exits 254 on this, and the only error surfaced was "Command failed: python3"
   because e.stderr was a Buffer without .trim(). The real traceback was lost.

2. Added execFileAsync encoding:"utf-8" so err.stderr is a string and the
   actual Python/ffmpeg error reaches the browser.

Fix: pre-convert webm→wav with our own ffmpeg invocation (-err_detect ignore_err
for lenient parsing) before handing the file to Whisper. Fails fast with a
human-readable message if the audio is genuinely undecodable, rather than
letting it blow up inside the Python process with an opaque traceback.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 08:39:44 +02:00
g-butandClaude Sonnet 4.6 a80a4ef12d fix(queue): shiftQueue always returned null — read from localStorage synchronously
React state updater closures run during the next render phase, not at setState
call time. The prior shift() captured item = q[0] inside setQueue(fn) and
returned it, but item was always null — the updater hadn't run yet. Every queue
drain silently fell through to next_best.

Fix: read from localStorage (the synchronous SSOT), write the sliced array back,
then call setQueue to sync React state. Atomically returns the correct item.

Also extracts useMicComposer hook (H3 audit) to eliminate the duplicated
pendingMicActionRef + appendTranscript + wrapSend/wrapEnqueue boilerplate
that was copy-pasted between IntentButtonPanel and BeaconBody.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 08:32:50 +02:00
g-butandClaude Sonnet 4.6 cb576d6b42 fix(control): queue-aware next_best, better prompt UI, and auto-continue UX fixes
- sendIntent("next_best") and send() legacy path now drain queue first before
  calling the AI planner — queued items always take priority
- enableAutoContinue() called on each new ready cycle so persisted "off" state
  doesn't leave the countdown permanently paused across sessions
- Beacon auto-fire guarded on prompts.length === 0 (prevents closing before
  prompts load); fires remove(0) when using queue item so it's drained atomically
- PromptInput: items-end outer flex + fixed h-10 buttons so Queue/Send don't
  stretch as the textarea grows; Pause/Play removed from action button row
- Pause/Play relocated to a labeled footer row ("Auto-continue on/off") in both
  running and idle states, consistent with beacon popup pattern
- RunningBanner: custom prompts shown as line-clamp-3 instead of "Custom prompt"
  header + truncated 2-line fallback

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 08:17:41 +02:00
g-butandClaude Sonnet 4.6 f31003062a refactor(sentinels): consolidate dual agent-*/claude-* sentinel names
Bash was writing identical /tmp sentinel files under both naming schemes
simultaneously (agent-ready-{tab} AND claude-ready-{tab}) and TypeScript
was reading with double-fallback (?? stateFile.claudeReady) logic.

Now:
- Bash stop handler writes only agent-* sentinels (new canonical names)
- Dual-delete lines kept so stale claude-* files on disk are still cleaned up
- TypeScript reads only agent-* (no ?? fallback); 4 dead stateFile.claude*
  helpers removed (claudeClosing, claudeSentinel, claudePrompt, claudeLock)
- claudeReady + claudeClosed kept for the cleanup unlinkSync calls in
  inject/orchestration routes
- notification handler simplified: single-name checks, 6 dead lines removed
- agent-config.ts comment updated to "legacy names — cleanup only"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 01:30:33 +02:00
g-butandClaude Sonnet 4.6 47d12b65ca refactor(session): collapse duplicate .md file parsers into parseSessionFile SSOT
control-fast-state.ts had a single-line regex parser; sessions/route.ts had a
more capable multi-line buffering parser that stops at ## sections. Both parsed
the same on-disk handoff format (done/next/tests/todos/health).

Add parseSessionFile(raw) to session-content.ts — the canonical implementation
using the multi-line algorithm. Both callers now import it; the local parse
functions are deleted. control-fast-state.ts shrinks from 17 lines to 5.

The Python beacon's _build_summary keeps its own single-line parse (language
boundary) but now has a cross-reference comment to parseSessionFile.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 01:23:17 +02:00
g-butandClaude Sonnet 4.6 bc01c218b1 fix(control+beacon): unified countdown, drop typingActive pause, beacon fires at T=0
- Remove global keydown typingActive listener — any keypress was pausing the
  countdown, making it appear paused by default; now only pauses when the user
  is actively composing (customFocused / custom.trim())
- Add control:ready-at:{tab} to localStorage when agent enters ready state;
  both ReadyBanner and BeaconBody initialise their seconds from this shared
  origin so both windows always show the same remaining number
- Beacon countdown was display-only and fired nothing at T=0; now submits
  real injection (queue[0] first, then primary prompt) with autoFiredRef guard
- Thread tab prop through ProjectBanners → ReadyBanner for shared timestamp read
- Add readyAtKey() to control-storage.ts (SSOT for the key string)
- Drop DEFAULT_BEACON_COUNTDOWN_S fallback path in favour of readyAt; URL param
  still used when no readyAt exists (manual popup without control panel)
- Improve idle project card headers: show "last 2d ago · good" context line
  instead of floating health badge; git +N tooltip added

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 01:09:32 +02:00
g-butandClaude Sonnet 4.6 c8c39500b4 fix(lint): remove unused eslint-disable directive in AppShell
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 00:36:22 +02:00
g-butandClaude Sonnet 4.6 e389067016 refactor(control+beacon): SSOT fixes, hydration fix, queue UX, x.ai design
- Extract useLocalStorageState generic hook (SSR-safe, ping-pong fix)
- Extract control-storage.ts: localStorage key construction + sync read
- Add CUSTOM_CHOICE_PREFIX constant shared across TS, Python, bash
- Add DEFAULT_BEACON_COUNTDOWN_S constant (was hardcoded 30/12)
- Add splitSessionItems export; parseSessionText uses it (M3)
- Import BeaconSession+AgentPrompt from API routes, drop local defs (H2)
- Fix AppShell hydration mismatch: defer localStorage read to useEffect
- ReadyBanner: pipeline preview line + countdown reset on queue arrival
- QueueList: flat terminal-style dividers; drag-to-reorder; click-to-edit
- "Agent's plan" label replaces "Up Next" across all surfaces (H7)
- x.ai design: reduced border radii, monospace timers, tighter layout
- Add AI queue merge via /api/control/merge-prompts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 00:34:46 +02:00
g-butandClaude Sonnet 4.6 767241b2bb refactor(control): extract useAutoContinue hook + fix SSR wipe
ProjectCard had the same SSR bug as usePromptQueue: the lazy useState
initializer ran on the server (window absent), returned false, and the
first client-side write effect then stored "off" — silently disabling
auto-continue every time the control panel page loaded.

Fix: new useAutoContinue(tab) hook uses the same initialized-flag pattern
as usePromptQueue so the stored setting persists across page loads.

Side effects:
- Eliminates triple duplication of the control:auto-continue:${tab} key
- Removes the 2s polling loop from the beacon popup (storage event is
  sufficient since popup and control panel are separate windows)
- Removes toggleAutoContinue local function from beacon page (hook owns it)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 22:17:39 +02:00
g-butandClaude Sonnet 4.6 bbfdab4757 fix(queue): prevent SSR from clearing localStorage on page load
usePromptQueue started with a lazy useState initializer that called
window.localStorage. On the server (SSR), window is absent so the
catch block returned [], and the first client-side write effect then
persisted [] to localStorage — silently wiping any items queued in
a previous session.

Fix: start with [], hydrate from localStorage in a mount useEffect
(client-only), and gate the write effect behind an `initialized`
flag so the pre-hydration empty state is never persisted.

Also move the beacon window auto-fit effect from BeaconPage into
BeaconBody so queue.length is in scope — the window now re-sizes
when items are loaded from localStorage or added via the + button.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 22:04:26 +02:00
g-butandClaude Sonnet 4.6 2b4cc25315 feat(beacon): add Pause/Play toggle to popup status line
Beacon popup could read autoContinue state but had no way to
change it — user had to switch to the control panel to pause.
Now a Pause/Play icon button sits inline in the status row and
writes directly to the same localStorage key the control panel
reads, so both windows stay in sync instantly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 21:36:21 +02:00
g-butandClaude Sonnet 4.6 6f32bf4185 refactor(beacon): unify popup UI with control panel + add queue ownership
- Extract BeaconBody component so usePromptQueue is called once per project
  (eliminates the previous dual-write pattern where beacon had its own
  localStorage queue helpers that duplicated the hook's operations)
- Replace single-line <input> with multi-line <textarea> + overlaid mic
  button — matches control panel PromptInput exactly
- Replace ArrowRight send icon with Send; add ListPlus "Add to Queue" button
  so users can stage prompts from the popup (Alt+Enter also works)
- Remove inline queue state/helpers (writeQueue, removeFromQueue,
  reorderInQueue, editInQueue) — all queue ops now go through usePromptQueue
- autoContinueEnabled sync stays in BeaconBody (queue sync is handled by hook)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 21:22:48 +02:00
g-butandClaude Sonnet 4.6 9ed6e7cb6e fix(queue): pass onReorder+onEdit to QueueList in idle state
Reorder (↑/↓) and inline edit were only wired up in the running-agent
branch; the idle-agent branch rendered QueueList without those handlers,
silently disabling the features when no agent was running.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 20:52:05 +02:00
g-butandClaude Sonnet 4.6 616c7ed360 feat(queue): reorder (↑/↓) and inline edit in both control panel and beacon popup
usePromptQueue gains reorder() and edit() operations.

QueueList in control panel: up/down chevron buttons to move items;
click item text to edit inline (Enter to save, Escape to cancel).

Beacon popup queue: same reorder/edit pattern — double-click text to
edit, ↑/↓ to reorder, X to remove without sending, click text to
send-and-remove. All writes go directly to localStorage so control
panel reacts via the storage event listener added earlier.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 20:46:08 +02:00
g-butandClaude Sonnet 4.6 34fe0e3e47 fix(queue): cross-window sync + beacon remove button + send-removes-item
usePromptQueue now listens for storage events so the control panel
reacts instantly when the beacon popup modifies the queue.

Beacon popup queue now matches control panel QueueList style (numbered,
first item highlighted, X to remove). Clicking a queue item removes it
from localStorage before submitting — prevents double-fire on next
auto-inject.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 20:34:58 +02:00
g-butandClaude Sonnet 4.6 532e59bd14 fix(settings,beacon): fix BeaconSettings label inversion + sync mic status messages
BeaconSettings "Use web UI beacon" label was backwards — enabling it
skips the popup entirely (control panel only). Renamed to "Control panel
only (skip popup)" with accurate description.

Also syncs mic status messages between beacon popup and control panel:
"No audio detected" → "No audio — speak closer…", "Processing…" → "Transcribing…".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 20:28:50 +02:00
g-butandClaude Sonnet 4.6 5b194a20fa feat(beacon): show queue and paused state synced from control panel
Reads control:auto-continue and control:queue localStorage keys (same
origin, same SSOT as the control panel) — 2s poll + storage event.
Queue items appear above primary buttons; paused state shows ⏸ badge
on slot-1 and updated controls-row text.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 20:18:43 +02:00