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

fix: give production projects a real empty state (#10993)

Adam Eivyb786d4e30df1
diff --git a/client/src/components/codeAnimation/ProductionContainment.jsx b/client/src/components/codeAnimation/ProductionContainment.jsx
index 04f29866b7..8b40682e00 100644
--- a/client/src/components/codeAnimation/ProductionContainment.jsx
+++ b/client/src/components/codeAnimation/ProductionContainment.jsx
@@ -6,13 +6,22 @@ import { formatCount } from '../../utils/formatters';
const buttonClass = 'rounded border border-port-border px-3 py-2 text-sm hover:border-port-accent disabled:opacity-50';
/** Machine-level contained-execution status: fail-closed readiness, operator tool path, on-demand check. */
-export default function ProductionContainment() {
+export default function ProductionContainment({ rendererKind = null }) {
const [execution, setExecution] = useState(null);
+ const [open, setOpen] = useState(false);
const [blenderPath, setBlenderPath] = useState('');
const [savedPath, setSavedPath] = useState('');
const [mode, setMode] = useState('contained');
const [engine, setEngine] = useState('CYCLES');
const [acknowledged, setAcknowledged] = useState(false);
+ const blenderReady = execution?.lanes?.blender?.ready;
+ const blocking = rendererKind === 'blender' && blenderReady === false;
+ useEffect(() => {
+ if (rendererKind !== 'blender') setOpen(false);
+ }, [rendererKind]);
+ useEffect(() => {
+ if (blocking) setOpen(true);
+ }, [blocking]);
const apply = (next) => {
if (!next) return;
setExecution(next);
@@ -33,13 +42,14 @@ export default function ProductionContainment() {
if (!execution) return null;
const { mechanism, lanes, probe: result } = execution;
const dirty = blenderPath.trim() !== savedPath || mode !== (execution.executionMode || 'contained') || engine !== (execution.tools.blender.engine || 'CYCLES') || acknowledged !== (execution.executionMode === 'trusted-local');
- return <section className="space-y-3 rounded-xl border border-port-border bg-port-card p-4">
- <h2 className="text-base font-semibold">Blender execution</h2>
- <p className="text-sm text-gray-400">Contained mode is the default and refuses execution when its sandbox cannot run Blender. Trusted-local mode requires your explicit acknowledgement and runs only source you trust. No automatic fallback occurs.</p>
+ const shown = open || blocking;
+ return <details open={shown} onToggle={event => { if (blocking) { event.currentTarget.open = true; return; } setOpen(event.currentTarget.open); }} className="space-y-3 rounded-xl border border-port-border bg-port-card p-4">
+ <summary className="cursor-pointer text-base font-semibold">Blender execution <span className={lanes.blender.ready ? 'text-sm font-normal text-gray-400' : 'text-sm font-normal text-port-warning'}>{lanes.blender.ready ? 'Ready' : lanes.blender.reason}</span></summary>
+ <p className="text-sm text-gray-400">Contained mode refuses execution when its sandbox cannot run Blender.</p>
<div className="grid grid-cols-1 gap-2 text-sm md:grid-cols-3">
<p>Sandbox: {mechanism.supported ? mechanism.id : <span className="text-port-warning">{mechanism.reason}</span>}</p>
<p>Browser lane: {lanes.browser.mechanism}</p>
- <p>Blender lane: {lanes.blender.ready ? 'Ready for production rendering' : <span className="text-port-warning">{lanes.blender.reason}</span>}</p>
+ <p>Blender lane: {lanes.blender.ready ? 'Ready for production rendering' : <span className="text-port-warning">Not ready</span>}</p>
</div>
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2">
<div><label htmlFor="cap-blender-mode" className="mb-1 block text-sm">Execution mode</label>
@@ -55,7 +65,12 @@ export default function ProductionContainment() {
<p>{execution.trustedLocalWarning || 'Trusted-local Blender can access this account’s host filesystem, network and processes. Environment scrubbing and process supervision are not containment.'}</p>
<label htmlFor="cap-blender-ack" className="flex items-start gap-2"><input id="cap-blender-ack" type="checkbox" checked={acknowledged} disabled={saving || probing} onChange={event => setAcknowledged(event.target.checked)} />I understand the host access and trust the source I will run.</label>
</div>}
- <p className="text-xs text-gray-400">Cycles CPU can take substantial time for a full sequence. EEVEE needs a successful GPU check and disables motion blur to preserve stepped holds. Project version and engine must match the checked runtime.</p>
+ <p className="text-xs text-gray-400">Cycles CPU can take substantial time for a full sequence.</p>
+ <details className="text-xs text-gray-400">
+ <summary className="cursor-pointer">Execution notes</summary>
+ <p className="mt-1">Trusted-local mode requires your explicit acknowledgement and runs only source you trust. No automatic fallback occurs.</p>
+ <p className="mt-1">EEVEE needs a successful GPU check and disables motion blur to preserve stepped holds. Project version and engine must match the checked runtime.</p>
+ </details>
<div className="flex flex-wrap items-end gap-2">
<div className="min-w-0 flex-1 basis-72">
<label htmlFor="cap-blender-path" className="mb-1 block text-sm">Blender executable (operator-owned)</label>
@@ -72,5 +87,5 @@ export default function ProductionContainment() {
{result.tools?.blender && <li className={result.tools.blender.passed ? 'text-gray-400' : 'text-port-warning'}>{result.tools.blender.detail}</li>}
</ul>
</div>}
- </section>;
+ </details>;
}
diff --git a/client/src/components/codeAnimation/ProductionProjects.jsx b/client/src/components/codeAnimation/ProductionProjects.jsx
index 656b87ad7c..54e84c8ecb 100644
--- a/client/src/components/codeAnimation/ProductionProjects.jsx
+++ b/client/src/components/codeAnimation/ProductionProjects.jsx
@@ -90,24 +90,45 @@ export default function ProductionProjects() {
downloadBlob(JSON.stringify(data, null, 2), revisionId ? `source-${revisionId}.json` : 'animation-brief.json', 'application/json');
});
const project = resource.data;
+ const listEmpty = projects.loaded && !projects.loading && !projects.error && projects.items.length === 0;
+ const focusTitle = event => {
+ const title = document.getElementById('cap-title');
+ if (!title) return;
+ event.preventDefault();
+ title.focus();
+ };
+ const starter = <>
+ <button type="button" className={buttonClass} disabled={busy} onClick={createBlenderStarter}>Create painterly Blender starter</button>
+ <p className="text-xs text-gray-400">Creates a 10-second 1080p24 Blender scene; no render or AI call starts.</p>
+ </>;
return <div className="space-y-4">
<section className="space-y-3 rounded-xl border border-port-border bg-port-card p-4">
<div className="flex flex-wrap items-center justify-between gap-3">
<h2 className="text-base font-semibold">Production projects</h2>
- <Link to="/code-animation/production" className={buttonClass}>New Production project</Link>
- </div>
- <p className="text-sm text-gray-400">Keep a film brief, independent budgets and immutable source revisions. Import and source acceptance stage files; rendering and evidence review are separate production stages.</p>
- <button type="button" className={buttonClass} disabled={busy} onClick={createBlenderStarter}>Create painterly Blender starter</button>
- <p className="text-xs text-gray-400">Creates original scene source at 1080p, 24 fps, 10 seconds. Importing starts no render or AI call. Check Blender execution before starting production.</p>
- <div className="grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3">
- {projects.items.map(item => <Link key={item.id} to={`/code-animation/production/${item.id}`} className="min-w-0 rounded border border-port-border p-3 hover:border-port-accent" aria-current={item.id === projectId ? 'page' : undefined}>
- <span className="block truncate font-medium">{item.title || 'Untitled production'}</span>
- <span className="text-xs text-gray-400">{item.acceptedRevisionId ? 'Accepted source' : 'No accepted source'} · {timeAgo(item.createdAt)}</span>
- </Link>)}
+ {projectId && <Link to="/code-animation/production" className={buttonClass}>New Production project</Link>}
</div>
- <InfiniteScrollFooter hasMore={projects.hasMore} loading={projects.loading} error={projects.error} onLoadMore={projects.loadMore} autoLoad={false} label="Load older projects" />
+ <p className="text-sm text-gray-400">Each project keeps its brief, budgets and accepted source revisions.</p>
+ <details className="text-sm text-gray-400">
+ <summary className="cursor-pointer">How production projects work</summary>
+ <p className="mt-1">Import and source acceptance stage files; rendering and evidence review are separate production stages.</p>
+ <p className="mt-1">Check Blender execution before starting a Blender production.</p>
+ </details>
+ {listEmpty ? <div className="space-y-2">
+ <p>No production projects yet.</p>
+ {starter}
+ <a href="#cap-title" className="inline-block text-sm text-port-accent underline" onClick={focusTitle}>Go to the create form</a>
+ </div> : <>
+ {starter}
+ <div className="grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3">
+ {projects.items.map(item => <Link key={item.id} to={`/code-animation/production/${item.id}`} className="min-w-0 rounded border border-port-border p-3 hover:border-port-accent" aria-current={item.id === projectId ? 'page' : undefined}>
+ <span className="block truncate font-medium">{item.title || 'Untitled production'}</span>
+ <span className="text-xs text-gray-400">{item.acceptedRevisionId ? 'Accepted source' : 'No accepted source'} · {timeAgo(item.createdAt)}</span>
+ </Link>)}
+ </div>
+ <InfiniteScrollFooter hasMore={projects.hasMore} loading={projects.loading} error={projects.error} onLoadMore={projects.loadMore} autoLoad={false} label="Load older projects" />
+ </>}
</section>
- <ProductionContainment />
+ <ProductionContainment rendererKind={project?.manifest?.renderer?.kind || null} />
{projectId && resource.loading && <p>Loading production project…</p>}
{resource.error && <div role="alert" className="rounded border border-port-error p-3">
diff --git a/client/src/components/codeAnimation/ProductionProjects.test.jsx b/client/src/components/codeAnimation/ProductionProjects.test.jsx
index f2401b5af6..1d9af05247 100644
--- a/client/src/components/codeAnimation/ProductionProjects.test.jsx
+++ b/client/src/components/codeAnimation/ProductionProjects.test.jsx
@@ -38,6 +38,7 @@ const execution = (overrides = {}) => ({
lanes: { browser: { mechanism: 'chromium-cdp-sandbox' }, blender: { ready: false, reason: 'Blender: Not configured.' } },
...overrides,
});
+const executionPanel = () => screen.getByText('Blender execution', { selector: 'summary', exact: false }).closest('details');
const renderPage = (entry = '/code-animation/production/' + project.id) => render(
<MemoryRouter initialEntries={[entry]}><Routes>
<Route path="/code-animation/production" element={<ProductionProjects />} />
@@ -221,4 +222,35 @@ describe('Production project rendered interactions', () => {
expect(await screen.findByText(/Ready for production rendering/)).toBeInTheDocument();
expect(screen.getByText('Cycles / CPU test scene rendered.')).toBeInTheDocument();
});
+
+ it('shows an empty state on the index and focuses the create form', async () => {
+ const user = userEvent.setup();
+ api.listCodeAnimationProjects.mockResolvedValue(page([]));
+ renderPage('/code-animation/production');
+ expect(await screen.findByText('No production projects yet.')).toBeInTheDocument();
+ expect(screen.getByRole('button', { name: 'Create painterly Blender starter' })).toBeEnabled();
+ expect(screen.queryByText('All results loaded')).toBeNull();
+ expect(screen.queryByRole('link', { name: 'New Production project' })).toBeNull();
+ expect(screen.getByRole('heading', { name: 'New Production project' })).toBeInTheDocument();
+ await user.click(screen.getByRole('link', { name: 'Go to the create form' }));
+ expect(screen.getByLabelText('Title')).toHaveFocus();
+ expect(executionPanel().open).toBe(false);
+ });
+
+ it('keeps a switch-to-new link on an open project and collapses Blender execution for the browser renderer', async () => {
+ renderPage();
+ expect(await screen.findByRole('link', { name: 'New Production project' })).toHaveAttribute('href', '/code-animation/production');
+ expect(screen.getAllByText('New Production project')).toHaveLength(1);
+ expect(executionPanel().open).toBe(false);
+ });
+
+ it('opens Blender execution when the selected project renders with Blender and the lane is not ready', async () => {
+ const blender = { ...project, manifest: { ...project.manifest, renderer: { kind: 'blender', version: '4.2.0', engine: 'CYCLES' } } };
+ api.listCodeAnimationProjects.mockResolvedValue(page([blender]));
+ api.getCodeAnimationProject.mockResolvedValue(blender);
+ renderPage(`/code-animation/production/${blender.id}`);
+ expect(await screen.findByLabelText('Execution mode')).toBeInTheDocument();
+ expect(executionPanel().open).toBe(true);
+ expect(screen.getByText('Blender: Not configured.')).toBeInTheDocument();
+ });
});