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

Merge pull request #10199 from atomantic/claim/issue-10143

[._.]/5098da314cb1
diff --cc client/src/pages/MusicVideo.jsx
index e738c1ecde,7f036b3be7..a74ecb945c
--- a/client/src/pages/MusicVideo.jsx
+++ b/client/src/pages/MusicVideo.jsx
@@@ -234,25 -185,20 +235,32 @@@ export default function MusicVideo()
const [renamingId, setRenamingId] = useState(null);
const renaming = !!selected && renamingId === selected.id;
const [renameDraft, setRenameDraft] = useState('');
- const replaceProject = (next) => setProjects((prev) => prev.map((p) => (p.id === next.id ? next : p)));
- const sortedProjects = useMemo(
- () => [...projects].sort(compareMusicVideoProjectsNewestFirst),
- [projects],
- );
+ // A full record replaces its summary in the index list; the project card
+ // derives from whichever it holds, so no summary-only field can go stale.
+ const replaceProject = (next) => {
+ setSelectedProject((prev) => (prev?.id === next.id ? next : prev));
+ summaries.setItems((prev) => prev.map((p) => (p.id === next.id ? next : p)));
+ };
+ // Open a project the page just received whole (created, forked, started).
+ const openProject = (proj) => {
+ summaries.setItems((prev) => [proj, ...prev.filter((p) => p.id !== proj.id)]);
+ setSelectedProject(proj);
+ };
+ // The open project leads; summaries fill in the rest of the picker.
+ const sortedProjects = useMemo(() => {
+ const byId = new Map(summaries.items.map((p) => [p.id, p]));
+ if (selected) byId.set(selected.id, selected);
+ return [...byId.values()].sort(compareMusicVideoProjectsNewestFirst);
+ }, [selected, summaries.items]);
const productionReview = useMusicVideoProductionReview({ project: selected, replaceProject });
- const progress = useMemo(() => deriveStages(selected, productionReview.readiness), [selected, productionReview.readiness]);
+ // Posting (#9282): fill each platform's post in the PortOS Browser, post on a second press.
+ const publishing = useMusicVideoPublishing({ project: selected, replaceProject });
+ // Publish counts every platform the director turned on (#9287), not just any one post.
+ const publish = {
+ targets: PUBLISH_TARGETS.filter((entry) => publishing.enabledTargets?.includes(entry.target)),
+ drafts: publishing.drafts,
+ };
+ const progress = deriveStages(selected, productionReview.readiness, publish);
const [openedStage, setOpenedStage] = useState({ id: null, stage: null });
if (selected && openedStage.id !== selected.id) setOpenedStage({ id: selected.id, stage: progress.current });
const pinnedStage = openedStage.id === selected?.id ? openedStage.stage : null;