Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

Show Keep approved beside Revert on a stale Cast & sets sheet

Claude67896b3d54a0
diff --git a/client/src/components/musicVideo/CastAndSetsCheckin.jsx b/client/src/components/musicVideo/CastAndSetsCheckin.jsx
index 5d0f33dfc9..78da2b475b 100644
--- a/client/src/components/musicVideo/CastAndSetsCheckin.jsx
+++ b/client/src/components/musicVideo/CastAndSetsCheckin.jsx
@@ -5,6 +5,7 @@ import { staleApprovalText } from '../../lib/musicVideoStages.js';
import CastAndSetsDirectionEditor from './CastAndSetsDirectionEditor.jsx';
import CastAndSetsFeedback from './CastAndSetsFeedback.jsx';
import CastAndSetsReferenceProgress from './CastAndSetsReferenceProgress.jsx';
+import StaleApprovalActions from './StaleApprovalActions.jsx';
const WORKING = new Set(['directing', 'imaging', 'assembling']);
const buttonClass = 'flex items-center gap-1 rounded px-3 py-1.5 text-sm min-h-[44px] sm:min-h-0 disabled:opacity-50';
@@ -36,7 +37,8 @@ function statusLine(stage) {
* and the director's actions (Approve & continue, Regenerate,
* Edit direction on a procedural sheet, Resume, Skip). An approved sheet whose
* concept, style, subjects or song changed since (`stale`, from the server's
- * readiness) says what changed and offers Keep approved beside Rebuild (#10141).
+ * readiness) says what changed and offers Keep approved beside each Revert,
+ * right under that line (#10141).
* A sheet in review (or approved) takes plain-text feedback below the actions.
*/
export default function CastAndSetsCheckin({ id, project, stale = null, busy, onOpenSheet, onOpenPreview, onApprove, onRegenerate, onEditDirection, onApplyFeedback, onRemoveFeedback, onResume, onRebuild, onReconfirm, onRevert, onSkip }) {
@@ -62,15 +64,9 @@ export default function CastAndSetsCheckin({ id, project, stale = null, busy, on
{staleText} Keep the sheet approved as it is, or rebuild it from the current inputs.
</p>
)}
- {staleText && onRevert && stale?.revertible?.length > 0 && (
- <div className="flex flex-wrap gap-2">
- {stale.revertible.map((field) => (
- <button key={field} type="button" disabled={busy} onClick={() => onRevert(field)} title="Put this back to the value you approved"
- className={`${buttonClass} border border-port-border`}>
- <RotateCcw size={14} aria-hidden="true" /> Revert {field}
- </button>
- ))}
- </div>
+ {staleText && (
+ <StaleApprovalActions revertible={stale?.revertible} busy={busy} onKeep={onReconfirm} onRevert={onRevert}
+ keepTitle="Keep this sheet approved on the current concept, style, subjects and song" />
)}
<CastAndSetsReferenceProgress stage={stage} onOpenPreview={onOpenPreview} />
<div className="flex flex-wrap gap-2">
@@ -98,12 +94,6 @@ export default function CastAndSetsCheckin({ id, project, stale = null, busy, on
<Play size={14} aria-hidden="true" /> Resume
</button>
)}
- {staleText && onReconfirm && (
- <button type="button" disabled={busy} onClick={onReconfirm} title="Keep this sheet approved on the current concept, style, subjects and song"
- className={`${buttonClass} border border-port-border`}>
- <CheckCircle2 size={14} aria-hidden="true" /> Keep approved
- </button>
- )}
{onRebuild && ['approved', 'skipped'].includes(stage.status) && (
<button type="button" disabled={busy} onClick={onRebuild} title="Build a new sheet; the earlier one stays in the sheet's version history"
className={`${buttonClass} border border-port-border`}>
diff --git a/client/src/components/musicVideo/CastAndSetsCheckin.test.jsx b/client/src/components/musicVideo/CastAndSetsCheckin.test.jsx
index b875b576c3..836f341ff2 100644
--- a/client/src/components/musicVideo/CastAndSetsCheckin.test.jsx
+++ b/client/src/components/musicVideo/CastAndSetsCheckin.test.jsx
@@ -302,6 +302,8 @@ describe('Cast & Sets tab: undo, regenerate and guide import', () => {
const onRevertApproval = vi.fn();
const stale = { approvedAt: '2026-01-01T00:00:00.000Z', changedFields: ['concept', 'song'], revertible: ['concept'] };
open(withStatus('approved'), { productionReadiness: { castAndSets: { approved: true, stale } }, onRevertApproval });
+ // Keep approved sits in the same row as Revert, right under the stale note.
+ expect(screen.getByRole('button', { name: 'Keep approved' }).parentElement).toBe(screen.getByRole('button', { name: 'Revert concept' }).parentElement);
fireEvent.click(screen.getByRole('button', { name: 'Revert concept' }));
expect(onRevertApproval).toHaveBeenCalledWith('castAndSets', 'concept');
expect(screen.queryByRole('button', { name: 'Revert song' })).toBeNull();
diff --git a/client/src/components/musicVideo/StaleApprovalActions.jsx b/client/src/components/musicVideo/StaleApprovalActions.jsx
new file mode 100644
index 0000000000..72ba93df29
--- /dev/null
+++ b/client/src/components/musicVideo/StaleApprovalActions.jsx
@@ -0,0 +1,28 @@
+import { CheckCircle2, RotateCcw } from 'lucide-react';
+
+const buttonClass = 'flex items-center gap-1 rounded border border-port-border px-3 py-1.5 text-sm min-h-[44px] sm:min-h-0 disabled:opacity-50';
+
+/**
+ * The two ways out of a stale approval, side by side: Keep approved (`onKeep`,
+ * the approval stands on the current inputs) and a Revert per changed input
+ * whose approved value was kept (`revertible` → `onRevert(field)`). Renders
+ * nothing when neither applies.
+ */
+export default function StaleApprovalActions({ revertible = [], busy = false, onKeep, onRevert, keepTitle = 'Keep this approved on the current inputs' }) {
+ const reverts = onRevert ? revertible : [];
+ if (!onKeep && !reverts.length) return null;
+ return (
+ <div className="flex flex-wrap gap-2">
+ {onKeep && (
+ <button type="button" disabled={busy} onClick={onKeep} title={keepTitle} className={`${buttonClass} text-port-accent`}>
+ <CheckCircle2 size={14} aria-hidden="true" /> Keep approved
+ </button>
+ )}
+ {reverts.map((field) => (
+ <button key={field} type="button" disabled={busy} onClick={() => onRevert(field)} title="Put this back to the value you approved" className={buttonClass}>
+ <RotateCcw size={14} aria-hidden="true" /> Revert {field}
+ </button>
+ ))}
+ </div>
+ );
+}