Skip to content

feat(ai-studio): the decider is offered every resume action - #213

Open
dawidaksamski wants to merge 6 commits into
feat/WB-682-review-nodefrom
feat/WB-683-review-node-decision-ui
Open

dawidaksamski wants to merge 6 commits into
feat/WB-682-review-nodefrom
feat/WB-683-review-node-decision-ui

Conversation

@dawidaksamski

Copy link
Copy Markdown
Contributor

What

The decider's form offers every resume action of a decision request, not only the first. On a Review node the panel footer reads "Reject…", "Escalate…", "Approve", so Escalate can now be chosen from the UI.

  • offeredActions returns every resume action in the request's order, plus the optional reject. Its other rules are unchanged: a rerun-source action is still left out, a blank label still falls back to the name, and a request with no usable resume action offers nothing.
  • The footer mirrors the request's order. The first resume action is the primary button on the right, further resume actions are secondary buttons, and Reject stays as it is. Human decision renders exactly as before.
  • A further resume action opens a dialog before it is sent, the same flow as Reject. The dialog asks for a required Comment, and "Confirm Escalate" stays disabled until the comment has text. Cancel sends nothing and keeps what was typed.
  • The chosen action is sent under its own name, with the edits and the comment. An emptied required field holds back every resume button, because edits travel with any of them, and never holds back Reject.
  • The comment lives in the decision draft next to the reason, so it survives a visit to another node. A settled decision shows its comment under the values, the way it shows a reason.
  • The reject dialog became one action dialog, action-dialog.tsx, which both flows share. The dialog state is keyed by action name, because the request is read again on every render and names are unique within it.
  • Plumbing: DecisionInput and DecisionDraft gain comment. The submit adapter sends it only when it has text. readDecisionOutcome reads it back, treating a blank comment as none.

The comment is required by the editor only. The contract leaves it optional, so the backend still accepts an escalate without a comment through the API. Enforcing it there is separate work (follow-up: decision-resume-reason-required).

Docs

  • AI Studio README: the Review line drops "until the decider's form offers every resume action, Escalate is chosen through the API". It now describes the mirrored footer, the comment dialog, and that the editor requires the comment although the contract does not.

Not in this PR

  • The backend refusing a resume decision without a comment.
  • The Refund Review template's escalation lane. It is the next PR in the stack, now reachable from the UI thanks to this one.
  • The remaining design points: outcome names on the canvas rows, the human colour in the palette, a read-only "Decider actions" section in Properties, and a "leads nowhere" warning for a dangling Escalated port.

Testing

  • AI Studio: 619 tests in 44 files pass; tsc, eslint and prettier are clean. Each new test failed first for the missing feature. They run in both StrictMode and production mounting, and pin:
    • every resume action offered in request order, whatever the request's order;
    • the footer order "Reject…", "Escalate…", "Approve" on a Review-shaped request, with Human decision's footer unchanged;
    • Escalate opening a dialog, Cancel sending nothing, and Confirm disabled for an empty or blank comment;
    • Confirm sending { action: 'escalate', edits, comment } and closing the dialog;
    • an emptied required field disabling Approve and Escalate but not Reject;
    • the comment surviving a visit to another node;
    • the settled record showing the comment;
    • the adapter sending a comment only when non-blank, and the outcome reader reading it back.
  • Manual, in the browser on the local stack, with a run parked on a Review node:
    • The footer showed "Reject…", "Escalate…", "Approve".
    • "Confirm Escalate" was disabled until a comment was typed.
    • After confirming, the run continued on the escalated port, skipped the approved one and ended completed with no outcome.
    • The recorded decision carries the comment, and the panel shows it.

@dawidaksamski dawidaksamski self-assigned this Oct 9, 2026
@dawidaksamski
dawidaksamski added this pull request to stack #199 October 9, 2026 12:12
@dawidaksamski
dawidaksamski force-pushed the feat/WB-683-review-node-decision-ui branch from a8b757e to a0d3607 Compare October 9, 2026 13:46
@dawidaksamski
dawidaksamski force-pushed the feat/WB-683-review-node-decision-ui branch from a0d3607 to a5d3da6 Compare October 9, 2026 13:56
@dawidaksamski
dawidaksamski force-pushed the feat/WB-683-review-node-decision-ui branch from a5d3da6 to ba25adb Compare October 9, 2026 14:05
@dawidaksamski
dawidaksamski marked this pull request as ready for review October 9, 2026 14:10
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