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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
Show shots that aren't locked yet under Needs attention (#11621)
[._.]/cc0915f9fbba
diff --git a/client/src/components/musicVideo/SceneCard.jsx b/client/src/components/musicVideo/SceneCard.jsxindex 1c347f044e..6d5114a4b3 100644--- a/client/src/components/musicVideo/SceneCard.jsx+++ b/client/src/components/musicVideo/SceneCard.jsx@@ -175,7 +175,7 @@ export default function SceneCard({const lockBlocked = !shotLock ? null: shotLock.clip === 'locked' ? 'Video locked. Unlock the video to render it again.': shotLock.still !== 'locked' ? 'Lock the still first' : null;- const attention = sceneAttention(scene, { layered, footageOptional, lipSyncBackend, songDurationSec, clipSec: playedSec, failed: failedScenes || {}, songReview, videoSettings: falVideoSettings, locked });+ const attention = sceneAttention(scene, { layered, footageOptional, lipSyncBackend, songDurationSec, clipSec: playedSec, failed: failedScenes || {}, songReview, videoSettings: falVideoSettings, locked, unlocked: shotLock?.unlocked ?? null });const songChange = songReview?.[scene.sceneId];const generatingLane = generatingFrame && generatingVideo ? 'Frame + clip' : generatingFrame ? 'Frame' : generatingVideo ? 'Clip' : null;// #10154: the server-persisted failure of the last render, shown until adiff --git a/client/src/components/musicVideo/ShotLock.jsx b/client/src/components/musicVideo/ShotLock.jsxindex 1615426ed5..87072a91b1 100644--- a/client/src/components/musicVideo/ShotLock.jsx+++ b/client/src/components/musicVideo/ShotLock.jsx@@ -6,11 +6,18 @@ import { Lock, LockOpen } from 'lucide-react';* lock — `locked`, `changed` (locked, then edited) or `open`; `clips` maps a* video shot to its clip's lock the same way (null for a shot with no video* step: a still, card or code shot locks once). `toggle(sceneId, lock, stage)`- * locks or unlocks one shot's `still` or `video`. Null outside a project, or- * for a document storyboard, which has no per-shot locks.+ * locks or unlocks one shot's `still` or `video`. `unlocked` is `unlockedShots`+ * (the shots the Shots checklist counts as not locked yet). Null outside a+ * project, or for a document storyboard, which has no per-shot locks.*/export const ShotLockContext = createContext(null);+/** `'still'` or `'video'` when the Shots checklist counts this shot's still or video as not locked yet, else null. */+export function shotUnlocked(value, sceneId) {+ if (value?.unlocked?.stills?.includes(sceneId)) return 'still';+ return value?.unlocked?.videos?.includes(sceneId) ? 'video' : null;+}+export const SHOT_LOCK_LABELS = Object.freeze({ locked: 'Locked', still: 'Still locked, video not locked yet', changed: 'Changed since locked', open: 'Not locked' });/**@@ -30,7 +37,7 @@ export function useShotLock(sceneId) {const still = sceneId && value?.locks ? value.locks[sceneId] : null;if (!still) return null;const clip = value.clips?.[sceneId] ?? null;- return { state: overallShotLock(still, clip), still, clip, toggle: (lock, stage = 'still') => value.toggle(sceneId, lock, stage), busy: !!value.busy };+ return { state: overallShotLock(still, clip), still, clip, unlocked: shotUnlocked(value, sceneId), toggle: (lock, stage = 'still') => value.toggle(sceneId, lock, stage), busy: !!value.busy };}const baseCls = 'inline-flex min-h-[44px] shrink-0 items-center justify-center gap-1 rounded border px-2 text-xs disabled:opacity-50 sm:min-h-[28px]';diff --git a/client/src/components/musicVideo/ShotStatusStrip.jsx b/client/src/components/musicVideo/ShotStatusStrip.jsxindex 85e37eab84..d2cdb9eecc 100644--- a/client/src/components/musicVideo/ShotStatusStrip.jsx+++ b/client/src/components/musicVideo/ShotStatusStrip.jsx@@ -1,6 +1,6 @@import { useContext } from 'react';import { Link } from 'react-router';-import { ShotLockContext, overallShotLock } from './ShotLock.jsx';+import { ShotLockContext, overallShotLock, shotUnlocked } from './ShotLock.jsx';import { SCENE_ATTENTION_LABELS, sceneAttention } from '../../lib/musicVideoSceneAttention.js';/**@@ -14,7 +14,7 @@ export default function ShotStatusStrip({ projectId, scenes, ctx }) {if (!scenes?.length) return null;const locked = (scene) => !!lockValue?.locks?.[scene.sceneId]&& overallShotLock(lockValue.locks[scene.sceneId], lockValue.clips?.[scene.sceneId]) === 'locked';- const cells = scenes.map((scene) => ({ scene, codes: sceneAttention(scene, { ...ctx, locked: locked(scene) }) }));+ const cells = scenes.map((scene) => ({ scene, codes: sceneAttention(scene, { ...ctx, locked: locked(scene), unlocked: shotUnlocked(lockValue, scene.sceneId) }) }));return (<ul aria-label="Shot status" className="flex flex-wrap gap-1">{cells.map(({ scene, codes }) => {diff --git a/client/src/components/musicVideo/stages/BoardStage.jsx b/client/src/components/musicVideo/stages/BoardStage.jsxindex 9dcd2014c1..6270a408c9 100644--- a/client/src/components/musicVideo/stages/BoardStage.jsx+++ b/client/src/components/musicVideo/stages/BoardStage.jsx@@ -6,7 +6,7 @@ import SceneCard from '../SceneCard.jsx';import EndingCard, { EndingThumbnail } from '../EndingCard.jsx';import ScenePoster from '../ScenePoster.jsx';import ShotEffectsCard, { SceneEffectBadges } from '../ShotEffectsCard.jsx';-import { ShotLockContext, SHOT_LOCK_LABELS, overallShotLock } from '../ShotLock.jsx';+import { ShotLockContext, SHOT_LOCK_LABELS, overallShotLock, shotUnlocked } from '../ShotLock.jsx';import { shotNumbers } from '../ShotStepper.jsx';import { previousShot, shotHandoffSource } from '../../../../../server/lib/musicVideoHandoffFrame.js';import { isLayeredComposition } from '../../../lib/musicVideoLayers.js';@@ -92,8 +92,10 @@ export default function BoardStage({ board }) {songReview: project.songRevision?.sceneReview || null,videoSettings: videoSettings.settings,};- // A locked shot is settled: its other takes are no longer something to review.- const codesById = new Map(scenes.map((scene) => [scene.sceneId, sceneAttention(scene, { ...attentionCtx, locked: shotLocks[scene.sceneId] === 'locked' })]));+ // A locked shot is settled: its other takes are no longer something to review. A still or+ // video the checklist counts as not locked yet needs attention too.+ const codesById = new Map(scenes.map((scene) => [scene.sceneId, sceneAttention(scene, { ...attentionCtx,+ locked: shotLocks[scene.sceneId] === 'locked', unlocked: shotUnlocked(lockValue, scene.sceneId) })]));const numbers = shotNumbers(scenes);const shotName = (scene) => [numbers.has(scene.sceneId) ? `Shot ${numbers.get(scene.sceneId)}` : null,scene.sectionLabel || scene.label].filter(Boolean).join(' · ') || `Scene ${scene.order + 1}`;diff --git a/client/src/components/musicVideo/stages/BoardStage.test.jsx b/client/src/components/musicVideo/stages/BoardStage.test.jsxindex eee0c0a083..92925aa1b5 100644--- a/client/src/components/musicVideo/stages/BoardStage.test.jsx+++ b/client/src/components/musicVideo/stages/BoardStage.test.jsx@@ -108,6 +108,20 @@ describe('BoardStage effects', () => {});});+// Uniquely catches the Needs attention filter leaving out a shot the checklist counts as not locked yet.+describe('BoardStage Needs attention and locks', () => {+ it('lists shots whose video or still the checklist counts as not locked yet', () => {+ const scenes = [scene(1), scene(2), scene(3)];+ render(<MemoryRouter initialEntries={['/?scenes=attention']}><ShotLockContext.Provider value={{ locks: { s1: 'locked', s2: 'locked', s3: 'open' },+ clips: { s1: 'locked', s2: 'changed', s3: 'open' }, unlocked: { stills: ['s3'], videos: ['s2'] }, toggle: vi.fn() }}>+ <BoardStage board={board(scenes)} /></ShotLockContext.Provider></MemoryRouter>);+ expect(screen.getByRole('button', { name: 'Needs attention (2)' })).toBeTruthy();+ expect(screen.queryByText('Shot 1 · Part 1')).toBeNull();+ expect(screen.getByRole('button', { name: 'Open Shot 2 · Part 2' }).textContent).toContain('Video not locked');+ expect(screen.getByRole('button', { name: 'Open Shot 3 · Part 3' }).textContent).toContain('Still not locked');+ });+});+describe('BoardStage thumbnail lock marks', () => {it('marks locked, still-only and changed shots, and leaves open ones bare', () => {const scenes = [scene(1), scene(2), scene(3), scene(4)];diff --git a/client/src/lib/musicVideoSceneAttention.js b/client/src/lib/musicVideoSceneAttention.jsindex a0626a5898..087204276d 100644--- a/client/src/lib/musicVideoSceneAttention.js+++ b/client/src/lib/musicVideoSceneAttention.js@@ -26,6 +26,8 @@ export const SCENE_ATTENTION_LABELS = Object.freeze({'plate-unverified': 'Plate unverified','no-span': 'No time span','last-failure': 'Last render failed',+ 'still-unlocked': 'Still not locked',+ 'video-unlocked': 'Video not locked','song-changed': 'Lyrics changed','song-new': 'New lyrics','song-cut': 'Lyrics cut',@@ -50,6 +52,21 @@ function takeKindsInUse(scene, layer) {return isEndFrameImageEffect(scene.imageEffect) ? ['image', 'endImage'] : ['image'];}+/**+ * The shots the Shots checklist counts as not locked yet, from production+ * readiness: `stills` once the director locks shots one at a time and the board+ * is not approved, `videos` once any clip has been locked. The checklist rows+ * and the board's attention codes both read this, so their counts agree.+ */+export function unlockedShots(readiness) {+ const storyboard = readiness?.storyboard;+ const clips = Object.values(storyboard?.clipLocks || {});+ return {+ stills: storyboard?.approved ? [] : storyboard?.unlocked || [],+ videos: clips.some((state) => state === 'locked' || state === 'changed') ? storyboard.clipsUnlocked || [] : [],+ };+}+/** The `?scenes=` value as a filter id; anything unknown is `all`. */export const parseSceneFilter = (value) => (SCENE_FILTERS.includes(value) ? value : 'all');@@ -69,10 +86,11 @@ function performanceBlocked(scene, { lipSyncBackend, songDurationSec, videoSetti* that failed this session, and `songReview` (the project's revised-song* verdicts by sceneId) so a shot the new lyrics changed is flagged until acted on.* `locked`: the director locked this shot, so its other takes are not waiting on review.+ * `unlocked`: `'still'` or `'video'` when the Shots checklist counts this shot's still or video as not locked yet (`unlockedShots`).*/export function sceneAttention(scene, ctx = {}) {if (!scene) return [];- const { layered = false, footageOptional = false, lipSyncBackend = '', songDurationSec = null, clipSec = null, failed = {}, songReview = null, videoSettings = null, locked = false } = ctx;+ const { layered = false, footageOptional = false, lipSyncBackend = '', songDurationSec = null, clipSec = null, failed = {}, songReview = null, videoSettings = null, locked = false, unlocked = null } = ctx;const layer = sceneVisualLayer(scene, { layered });const codes = [];const songChange = songReview?.[scene.sceneId];@@ -94,6 +112,8 @@ export function sceneAttention(scene, ctx = {}) {if (currentPlateEvidence(scene, selected)?.verdict !== 'pass') codes.push('plate-unverified');}if (failed.frame?.[scene.sceneId] || failed.video?.[scene.sceneId]) codes.push('last-failure');+ if (unlocked === 'still') codes.push('still-unlocked');+ if (unlocked === 'video') codes.push('video-unlocked');return codes;}diff --git a/client/src/lib/musicVideoStages.js b/client/src/lib/musicVideoStages.jsindex dc11fdb28d..a8b36989fa 100644--- a/client/src/lib/musicVideoStages.js+++ b/client/src/lib/musicVideoStages.js@@ -12,6 +12,7 @@ import { formatCount, formatDurationSec, formatTimecode } from '../utils/formattimport { isNonBlankStr } from './textUtils';import { modeLabel } from './imageGenModes.js';import { falSceneTake } from './musicVideoShotTiming.js';+import { unlockedShots } from './musicVideoSceneAttention.js';import { getFalVideoModel } from './falVideoModels.js';import { latestMusicVideoReviewDraft } from '../../../server/lib/musicVideoReviewDraft.js';import { FINISHED_OUTSIDE_RERENDER_NOTE, finishedOutside, finishedOutsideCovers } from '../../../server/lib/musicVideoFinishedOutside.js';@@ -697,7 +698,7 @@ export function summarizeStoryboardProblems(problems = []) {// Once any shot is locked one at a time, the board is approved when every shot is: say how many are left.function unlockedDetail(readiness, item) {- const left = readiness?.storyboard?.approved ? 0 : (readiness?.storyboard?.unlocked || []).length;+ const left = unlockedShots(readiness).stills.length;if (!left) return item;const count = `${formatCount(left)} shot${left === 1 ? '' : 's'} not locked yet.`;// A stale board keeps its "changed since" text (and Keep approved) after the count.@@ -1019,10 +1020,11 @@ export function stageChecklist(stageId, project, readiness = project?.productionitems.push(planOpen && !reviewed.done ? { ...stills, detail: 'Finish the plan first.', action: { label: 'Open the plan', stage: 'board' } } : stills);const clips = Object.values(readiness?.storyboard?.clipLocks || {});if (clips.some((state) => state === 'locked' || state === 'changed')) {- const left = (readiness.storyboard.clipsUnlocked || []).length;+ const left = unlockedShots(readiness).videos.length;+ // The board's Needs attention filter lists exactly these shots (and any other open work).items.push({ id: 'lock-clips', label: 'Every video locked', done: !left,detail: left ? `${formatCount(left)} video${left === 1 ? '' : 's'} not locked yet. Lock each on its card once its clip is right.` : null,- action: left ? { label: 'Open the shots', anchor: 'mv-scene-board' } : null });+ action: left ? { label: left === 1 ? 'Show it' : `Show these ${formatCount(left)}`, anchor: 'mv-scene-board', params: { scenes: 'attention' } } : null });}const proofApproval = approval('proof', 'Animated proof', null);// Optional: never counted toward the step being done.diff --git a/client/src/lib/musicVideoStages.test.js b/client/src/lib/musicVideoStages.test.jsindex e5201f5694..941f0671b9 100644--- a/client/src/lib/musicVideoStages.test.js+++ b/client/src/lib/musicVideoStages.test.js@@ -535,6 +535,14 @@ describe('stageChecklist', () => {const stale = { ...readiness, storyboard: { ...readiness.storyboard, stale: { changedFields: ['scene 2 prompt'] } } };expect(stills(stale).detail).toMatch(/^2 shots not locked yet\. .*changed since: scene 2 prompt/);});+ // Uniquely catches the video count losing its one-tap way to the shots it counts.+ it('counts the videos left to lock and shows them on the board', () => {+ const readiness = { ...NOT_APPROVED, art: { approved: true, problems: [] },+ storyboard: { approved: true, problems: [], unlocked: [], clipLocks: { s1: 'locked', s2: 'changed', s3: 'open' }, clipsUnlocked: ['s2', 's3'] } };+ const clips = stageChecklist('produce', castProject({ scenes: [scene()] }), readiness).find((i) => i.id === 'lock-clips');+ expect(clips).toMatchObject({ done: false, detail: '2 videos not locked yet. Lock each on its card once its clip is right.',+ action: { label: 'Show these 2', anchor: 'mv-scene-board', params: { scenes: 'attention' } } });+ });it('counts per-scene changes in a stale approval instead of naming every scene', () => {const prompts = Array.from({ length: 26 }, (_, i) => `scene ${i + 1} prompt`);expect(changedFieldsText(['storyboard shots', ...prompts, 'scene 4 timing'])).toBe('storyboard shots, 26 scene prompts, scene 4 timing');diff --git a/client/src/pages/MusicVideo.jsx b/client/src/pages/MusicVideo.jsxindex 025d49d4a0..0f9ff996e1 100644--- a/client/src/pages/MusicVideo.jsx+++ b/client/src/pages/MusicVideo.jsx@@ -93,6 +93,7 @@ import GalleryVideoPicker from '../components/videoGen/GalleryVideoPicker.jsx';import { autoArrangeScenes } from '../lib/beatGrid.js';import { isLtx2FamilyRuntime } from '../lib/runnerFamilies';import { videoPosterForJob } from '../lib/creativeDirectorPreview.js';+import { unlockedShots } from '../lib/musicVideoSceneAttention.js';import { sceneTakeList } from '../lib/musicVideoTakes.js';import { pluralize } from '../lib/textUtils.js';import { formatCount, formatTimecode } from '../utils/formatters.js';@@ -310,6 +311,7 @@ export default function MusicVideo() {const shotLocks = productionReview.readiness?.storyboard?.shotLocks;const shotLockValue = shotLocks? { locks: shotLocks, clips: productionReview.readiness.storyboard.clipLocks || null,+ unlocked: unlockedShots(productionReview.readiness),toggle: (sceneId, lock, stage) => productionReview.lockShots([sceneId], lock, stage), busy: productionReview.busy }: null;// Posting (#9282): fill each platform's post in the PortOS Browser, post on a second press.