Skip to content

fix(autoresearch): replace swarm review modal with inline panel#54

Merged
cdarnell merged 4 commits into
mainfrom
qukaizen/arail-inline-swarm-review
May 16, 2026
Merged

fix(autoresearch): replace swarm review modal with inline panel#54
cdarnell merged 4 commits into
mainfrom
qukaizen/arail-inline-swarm-review

Conversation

@cdarnell
Copy link
Copy Markdown
Owner

Summary

  • Removed the swarm review modal and replaced it with an inline panel that renders directly below the Swarm Draft Ready banner. No z-index / hidden-card / scroll-trap edge cases — it's just a normal section in the page flow.
  • Click "Review Draft" → panel reveals and scrolls into view with Approve & Run / Approve Only / Discard / Hide actions.
  • Relaxed fetchGoalPreview to render any non-empty preview the server returns, so half-records still surface for explicit Discard instead of silently no-op'ing.

Test plan

  • Hard-refresh /autoresearch with a pending swarm draft → click Review Draft → inline panel appears with workers, phases, checklist.
  • Approve & Run / Approve Only / Discard / Hide all behave as before.
  • If no real preview exists, the banner just stays hidden (no broken click).

🤖 Generated with Claude Code

cdarnell and others added 4 commits May 16, 2026 15:27
…lab_mode

- Swarm Review modal: add max-height + internal scroll so the body
  is maneuverable on short viewports (footer pinned).
- Goal entry: collapse the inline empty-state form to a single
  "Set Research Goal" button that opens the existing modal — one
  place to enter a goal instead of two.
- Reset Goal: new button on the cockpit wired to POST
  /api/research/reset (clears current + archives).
- Move "Swarm Draft Ready" banner below the cockpit (was redundant
  at the top above the active-goal row).
- Review Draft: re-fetch /api/goal/preview on click so a stale banner
  doesn't silently no-op; hide + refreshAll if the server has no
  pending preview.
- LAB_MODE consistency: route all read sites through _lab_mode()
  (was mixing LAB_MODE / ARAIL_MODE / LAB_NETWORK_MODE) and have
  both toggle endpoints write to BOTH env vars + .env, so every tab
  sees the same airgapped/hybrid state.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…-record

fetchGoalPreview now requires status=='preview' and a swarm object before
treating a /api/goal/preview response as a reviewable draft. Without this,
residual records (e.g. {status:'approved'} left on disk by older code
paths) would render the banner but the Review Draft modal had nothing
valid to open. Tightening the validator hides the banner cleanly when no
real draft is pending.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The modal-based Review Draft surface kept hitting display/CSS edge
cases (z-index, hidden card, scroll trap). Swap it for an inline
panel that lives right under the Swarm Draft Ready banner — same
content, same actions (Approve & Run, Approve Only, Discard, Hide),
no modal layout. Click Review Draft → panel reveals and scrolls into
view. Guaranteed visible because it's a normal section in the page
flow.

Also relaxes fetchGoalPreview to render whatever non-empty preview
the server returns, so half-records still surface for the user to
discard explicitly instead of silently no-op'ing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…-swarm-review

# Conflicts:
#	src/arail/portal/templates/research.html
@cdarnell cdarnell merged commit 4cf7aed into main May 16, 2026
2 checks 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.

1 participant