Repository navigation
fix(preview): image lanes render — report bitmap dims to store - #19
Merged
Merged
Conversation
Symptom: adding an image as a lane left the preview black. Videos kept working. Latent since 3d0d320 (V1 preview path drop, 30 Apr) — the old V1 <img>-overlay was the only thing reporting natural dims back to the store. After it went, image clips' displayW/H stayed undefined and buildPreviewLayers' early-exit (baseW <= 0) dropped them from descriptor.layers. buildSourcesMap's lazy ensureImageBitmap then never fired, so the bitmap never loaded, so dims never came in — chicken- and-egg lock. Fix is symmetric to the video pool: PreviewRuntime now reports bm.width/height via setClipDisplayDims after every successful loadBitmap.then, the same way VideoElementPool's onDimsReport feeds the store from videoWidth/Height. To break the henne-ei-lock, image bitmaps are now started up front in init() and on the reconcile gate (clips/cams ref change) — not lazily from inside the descriptor loop, since the image isn't in that loop yet. Tests 5 new preview-runtime tests cover: load fires for image without pre-set dims, dim-report runs with the right values, failed load doesn't report, no per-frame churn (one report per image), and the live + Media flow (clip added after init via setCams). 31/31 preview-runtime tests green; 674/674 unit suite green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
<img>-Overlay war die einzige Stelle, dienaturalWidth/Heightan den Store reportete. Ohne ihn bliebendisplayW/Hfür Bilder undefined →buildPreviewLayersmacht Early-Exit → Bild kommt nie indescriptor.layers→ Lazy-Loader inbuildSourcesMaptriggert nie → Henne-Ei-Lock.PreviewRuntime.ensureImageBitmapreportet jetztbm.width/heightübersetClipDisplayDims(analogVideoElementPool.onDimsReport). Bitmap-Loads werden eager ininit()und im Reconcile-Gate (clips/cams ref change) angestoßen statt lazy aus dem Descriptor-Loop.Test plan
+ MediaFlow nach init.+ Media→ PNG → Preview rendert das Bild.🤖 Generated with Claude Code