open-swe/ui/src/lib
seahaven-openswe[bot] a53a96d37b
feat: editable plan mode — owner hand-edits the plan before approval (#1610, #80) (#130)
* feat: editable plan mode — owner hand-edits the plan before approval (#1610, #80)

Adds a PUT /dashboard/api/plan/{thread_id} endpoint and PlanReview UI edit
mode so the thread owner can refine the published plan markdown by hand. The
edited markdown is re-published as "ready" (preserving reviewer comments),
mirrored into the sandbox plan.md, and handed to the agent as the source of
truth on approve.

Approve now reads the published plan content strictly (raise_on_error=True)
so a transient store failure aborts instead of silently dropping an edited
plan, matching the comment-read contract.

The banner-overlap fix (collapsed git-panel clearing the "Review plan" link)
was already ported in #128; this picks up the remaining edit-mode pieces.

Refs #80

* fix(plan): make approve_plan idempotent, dispatch before persisting, fix comment count

SH-128-03: approve_plan set status APPROVED before dispatching the follow-up
run and had no already-approved guard, so a failed dispatch left the plan stuck
approved-but-undispatched and a double-submit double-dispatched + double-posted
the Slack notice. And the Slack notice counted len(comments) including empty
comments _format_comments filters out.

- Return 409 when the plan is already approved (idempotent double-click/retry).
- Dispatch the implementation run BEFORE persisting APPROVED so a dispatch
  failure leaves the plan re-approvable. _dispatch_followup passes plan_mode
  explicitly, so the run is unaffected by the reorder.
- Count only non-empty comments in the Slack approval notice.

Fixed here (not on #128) because #128's approve_plan is rewritten on this
branch; #129 inherits it. Adds tests for the 409, the filtered count, and the
dispatch-before-status ordering.

---------

Co-authored-by: seahaven-openswe[bot] <296972425+seahaven-openswe[bot]@users.noreply.github.com>
Co-authored-by: Adam Moussa <adam@seahavenind.com>
2026-07-08 18:44:56 -04:00
..
agents fix(ui): clear eslint errors from dep bumps + track .env.example (#111) 2026-07-02 17:31:07 -04:00
api.ts chore: cherry-pick clean upstream fixes + cherry-pick runbook (#117) 2026-07-03 11:48:40 -04:00
auth-redirect-core.ts chore: cherry-pick clean upstream fixes + cherry-pick runbook (#117) 2026-07-03 11:48:40 -04:00
auth-redirect.test.ts chore: cherry-pick clean upstream fixes + cherry-pick runbook (#117) 2026-07-03 11:48:40 -04:00
auth-redirect.tsx chore: cherry-pick clean upstream fixes + cherry-pick runbook (#117) 2026-07-03 11:48:40 -04:00
hotkeys.ts fix(ui): resolve eslint errors in dashboard components (#1538) 2026-06-15 17:29:38 -07:00
notifications.ts feat: add browser notifications for agent run completion (#1558) 2026-06-17 09:24:44 -07:00
plan.ts feat: editable plan mode — owner hand-edits the plan before approval (#1610, #80) (#130) 2026-07-08 18:44:56 -04:00
profile.ts feat: Configure subagent model defaults (#1342) 2026-05-27 12:34:52 -07:00
query.ts feat: open-swe dashboard for per-user profile config (#1302) 2026-05-15 11:23:53 -07:00
repo.test.ts feat: tune reviewer for precision — web/wiki tools + recalibrated prompt (#1312) 2026-05-20 18:35:00 +00:00
repo.ts feat: tune reviewer for precision — web/wiki tools + recalibrated prompt (#1312) 2026-05-20 18:35:00 +00:00
reviewImage.test.ts fix: render GitHub-hosted images in PR descriptions on reviews page (#1589) 2026-06-22 14:01:06 -07:00
session.ts feat: open-swe dashboard for per-user profile config (#1302) 2026-05-15 11:23:53 -07:00
theme.ts fix: theme-aware syntax highlighting in chat code blocks (#1479) 2026-06-10 09:58:20 -07:00
useIsMobile.ts fix: make git panel a full-screen overlay on mobile widths (#1559) 2026-06-17 09:24:28 -07:00
utils.ts feat: collapse finished agent work into a Worked for X dropdown (#1509) 2026-06-12 10:08:12 -07:00