web: run-level actions — human decision, cancel, retry and rename (R11–R14)
Add the run-level operator actions to the browser run detail, matching the Android client's wording and wire frames: - R11 human decision: pure model in src/actions.js (pendingDecision, lastWaitingStep, waitingPrompt/waitingOptions, humanOptions, decisionTargetLabel, DecisionDraft) plus the decision card and sheet; decide_run sends run_id, the chosen option and trimmed feedback. - R12 cancel: a Cancel run action offered only while executing; the Android confirm copy; cancel_run then a silent get_run refresh. - R13 retry: offered only for a loaded, non-executing failed run; resume is the default (no retry_mode, like Android) with a browser-only Restart from start secondary that sends retry_mode:"restart". - R14 rename: an inline set_run_title field; refreshes the run and its list row. - One shared Action failed dialog for all of the above. Add the protocol constants and typed builders, a hand-written dark-palette section for the card/sheet/dialogs, focused unit tests for the helpers and request shapes, and ui-smoke captures for the new states. Update PARITY.md: R11 stays partial (no live waiting run), R12–R14 done with the stated shown-not-executed and Android-divergence notes. Also harden openRunDetail() in the UI smoke: the tabstrip already exists from the previously opened run, so wait for the target run's identity line before asserting on its actions (review finding).
This commit is contained in:
+150
@@ -1028,3 +1028,153 @@ code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-
|
||||
.diff-add { color: var(--ok); }
|
||||
.diff-remove { color: var(--bad); }
|
||||
.diff-context { color: var(--muted); }
|
||||
|
||||
/* ---------------------------------------------------------------------------
|
||||
Run-level operator actions (parity R11–R14): the waiting-for-decision card
|
||||
and sheet, the shared cancel/retry/restart confirm dialogs, the one
|
||||
Action-failed dialog and the inline rename control. Hand-written, the app's
|
||||
dark palette; every string is set with textContent.
|
||||
--------------------------------------------------------------------------- */
|
||||
|
||||
.run-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 4px; }
|
||||
.run-action { padding: 4px 12px; font-size: 12px; }
|
||||
.run-action.cancel-run { border-color: var(--warn); color: var(--warn); }
|
||||
.run-action.retry-run { border-color: var(--accent); color: var(--accent); }
|
||||
|
||||
/* The decision card: a prominent banner above the tabs. */
|
||||
.decision-card {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
align-items: center;
|
||||
padding: 12px 14px;
|
||||
margin-bottom: 12px;
|
||||
border: 1px solid #8edff5;
|
||||
border-radius: 10px;
|
||||
background: #102329;
|
||||
}
|
||||
.decision-card-icon { font-size: 18px; line-height: 1; }
|
||||
.decision-card-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
|
||||
.decision-card-title { font-weight: 600; }
|
||||
.decision-card-meta { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.decision-open { border-color: #8edff5; color: #8edff5; font-weight: 600; }
|
||||
|
||||
/* The decision sheet: a centred modal panel over a dim backdrop. */
|
||||
.decision-sheet {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 35;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 24px;
|
||||
background: rgba(0, 0, 0, 0.55);
|
||||
}
|
||||
.decision-sheet-panel {
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
width: min(520px, 100%);
|
||||
max-height: 100%;
|
||||
overflow-y: auto;
|
||||
padding: 16px;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
.decision-sheet-title { margin: 0; font-size: 16px; }
|
||||
.decision-sheet-meta { font-size: 12px; }
|
||||
.decision-instructions { margin: 0; line-height: 1.5; }
|
||||
.decision-options { display: grid; gap: 6px; }
|
||||
.decision-option {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
padding: 8px 10px;
|
||||
background: var(--surface-2);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
}
|
||||
.decision-option:hover { border-color: var(--accent); }
|
||||
.decision-option.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
|
||||
.decision-radio {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
border-radius: 50%;
|
||||
border: 2px solid var(--muted);
|
||||
flex: none;
|
||||
}
|
||||
.decision-option.selected .decision-radio {
|
||||
border-color: var(--accent);
|
||||
box-shadow: inset 0 0 0 3px var(--surface-2), inset 0 0 0 8px var(--accent);
|
||||
}
|
||||
.decision-option-body { display: grid; gap: 2px; min-width: 0; }
|
||||
.decision-option-key { font-weight: 600; }
|
||||
.decision-option-target { font-size: 12px; }
|
||||
.decision-field { display: grid; gap: 4px; }
|
||||
.decision-field-label { font-size: 12px; color: var(--muted); }
|
||||
.decision-feedback {
|
||||
width: 100%;
|
||||
padding: 6px 8px;
|
||||
background: var(--surface-2);
|
||||
color: var(--text);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
font: inherit;
|
||||
}
|
||||
.decision-feedback:focus { outline: none; border-color: var(--accent); }
|
||||
.decision-error { font-size: 13px; }
|
||||
.decision-sheet-actions { display: flex; gap: 8px; justify-content: flex-end; }
|
||||
.decision-confirm { border-color: var(--accent); color: var(--accent); font-weight: 600; }
|
||||
.decision-confirm:disabled, .decision-cancel:disabled { opacity: 0.5; }
|
||||
|
||||
/* Shared confirm dialog (cancel / retry / restart) and the Action-failed one. */
|
||||
.confirm-dialog,
|
||||
.action-failed {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 40;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 24px;
|
||||
background: rgba(0, 0, 0, 0.55);
|
||||
}
|
||||
.confirm-panel,
|
||||
.action-failed-panel {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
width: min(420px, 100%);
|
||||
padding: 16px;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
.confirm-title,
|
||||
.action-failed-title { margin: 0; font-size: 16px; }
|
||||
.confirm-message,
|
||||
.action-failed-message { margin: 0; line-height: 1.5; }
|
||||
.action-failed-message { color: var(--bad); }
|
||||
.confirm-actions { display: flex; gap: 8px; align-items: center; }
|
||||
.confirm-secondary { margin-right: auto; font-size: 12px; }
|
||||
.confirm-accept { border-color: var(--accent); color: var(--accent); font-weight: 600; }
|
||||
.action-failed-ok { justify-self: end; }
|
||||
|
||||
/* The inline rename control on the Summary title row. */
|
||||
.run-title-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
|
||||
.run-title-row .run-detail-title { margin: 0; }
|
||||
.rename-field { display: flex; gap: 6px; align-items: center; flex: 1; min-width: 0; }
|
||||
.rename-input {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
padding: 6px 8px;
|
||||
background: var(--surface-2);
|
||||
color: var(--text);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
font: inherit;
|
||||
}
|
||||
.rename-input:focus { outline: none; border-color: var(--accent); }
|
||||
.rename-save { border-color: var(--accent); color: var(--accent); font-weight: 600; }
|
||||
|
||||
Reference in New Issue
Block a user