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

review: fix blank-canvas 0-size collapse, stale-scenes clobber, hidden thumbnail

[._.]/ Adam Eivyced15366d8dc
diff --git a/client/src/components/media/AnnotationCanvas.jsx b/client/src/components/media/AnnotationCanvas.jsx
index 16dae7d7f8..fefd0fa3c0 100644
--- a/client/src/components/media/AnnotationCanvas.jsx
+++ b/client/src/components/media/AnnotationCanvas.jsx
@@ -147,12 +147,18 @@ const AnnotationCanvas = forwardRef(function AnnotationCanvas(
}), [dims, isBlank, backgroundColor]);
return (
- <div className="relative inline-block max-w-full bg-port-bg rounded-lg overflow-hidden">
+ <div className={`relative max-w-full bg-port-bg rounded-lg overflow-hidden ${isBlank ? 'block' : 'inline-block'}`}>
{isBlank ? (
- // A sized spacer establishes the natural aspect ratio so the absolutely
- // positioned canvas below scales to it (matches the <img> layout in
- // overlay mode). No <img> element exists in blank mode.
- <div style={{ aspectRatio: `${dims?.w || blankWidth} / ${dims?.h || blankHeight}` }} className="w-full max-w-full" />
+ // A sized spacer establishes the natural size + aspect ratio so the
+ // absolutely-positioned canvas below scales to it (in overlay mode the
+ // <img>'s intrinsic size does this). The block wrapper has no in-flow
+ // content otherwise, so the spacer needs a definite width — clamped to
+ // the canvas's natural pixels and never wider than the container — or
+ // the surface collapses to 0×0.
+ <div
+ style={{ width: dims?.w || blankWidth, aspectRatio: `${dims?.w || blankWidth} / ${dims?.h || blankHeight}` }}
+ className="max-w-full"
+ />
) : (
<img
ref={imgRef}
diff --git a/client/src/components/pipeline/stages/StoryboardsStage.jsx b/client/src/components/pipeline/stages/StoryboardsStage.jsx
index 6d45113c10..10de7b27f8 100644
--- a/client/src/components/pipeline/stages/StoryboardsStage.jsx
+++ b/client/src/components/pipeline/stages/StoryboardsStage.jsx
@@ -415,8 +415,7 @@ export default function StoryboardsStage({ issue, series, onStageUpdate, actions
// PortOS's plain-HTTP origin). An existing key just reopens the same canvas.
// The sketch page returns here (?returnTo=) at the same stage.
const openSceneSketch = async (i) => {
- const scene = scenes[i];
- let key = scene.sketchKey;
+ let key = scenesRef.current[i]?.sketchKey;
if (!key) {
setSketchingIdx(i);
const res = await createBlankSketch({ silent: true }).catch((err) => {
@@ -427,8 +426,12 @@ export default function StoryboardsStage({ issue, series, onStageUpdate, actions
if (!res?.key) return;
key = res.key;
// Persist the key on the scene BEFORE navigating so a reload/return lands
- // on the same canvas. persist() resolves once the PATCH settles.
- const ok = await persist(scenes.map((s, j) => j === i ? { ...s, sketchKey: key } : s));
+ // on the same canvas. Merge against scenesRef.current (not the render-scope
+ // `scenes` captured before the await) so an edit made while the key was
+ // minting isn't clobbered under last-write-wins. Bail if the scene was
+ // removed mid-flight. persist() resolves once the PATCH settles.
+ if (!scenesRef.current[i]) return;
+ const ok = await persist(scenesRef.current.map((s, j) => j === i ? { ...s, sketchKey: key } : s));
if (!ok) return;
}
const returnTo = `/pipeline/issues/${issue.id}/storyboards`;
@@ -601,7 +604,11 @@ export default function StoryboardsStage({ issue, series, onStageUpdate, actions
src={sketchSrc(scene.sketchKey)}
alt={`Scene ${i + 1} sketch`}
className="w-full h-auto"
+ // Hide until the PNG exists (a freshly-minted, not-yet-saved
+ // sketch 404s); restore on a later successful load so a
+ // nonce-bump src swap after the first save shows it again.
onError={(e) => { e.currentTarget.style.display = 'none'; }}
+ onLoad={(e) => { e.currentTarget.style.display = ''; }}
/>
</button>
) : null}