8000 fix(preview): image lanes render — report bitmap dims to store by johannboehme · Pull Request #19 · johannboehme/tk-1 · GitHub
[go: up one dir, main page]

Skip to content

fix(preview): image lanes render — report bitmap dims to store - #19

Merged
johannboehme merged 1 commit into
mainfrom
claude/frosty-meitner-2e919a
May 2, 2026
Merged

johannboehme merged 1 commit into
mainfrom
claude/frosty-meitner-2e919a

Conversation

@johannboehme
Copy link
Copy Markdown
Owner

Summary

  • Image-Lanes blieben im Preview schwarz (Videos OK). Latent seit 3d0d320 (V1 preview path drop, 30. Apr) — der alte V1-<img>-Overlay war die einzige Stelle, die naturalWidth/Height an den Store reportete. Ohne ihn blieben displayW/H für Bilder undefined → buildPreviewLayers macht Early-Exit → Bild kommt nie in descriptor.layers → Lazy-Loader in buildSourcesMap triggert nie → Henne-Ei-Lock.
  • Fix symmetrisch zum Video-Pool: PreviewRuntime.ensureImageBitmap reportet jetzt bm.width/height über setClipDisplayDims (analog VideoElementPool.onDimsReport). Bitmap-Loads werden eager in init() und im Reconcile-Gate (clips/cams ref change) angestoßen statt lazy aus dem Descriptor-Loop.

Test plan

  • 5 neue preview-runtime Tests (RED → GREEN): load triggers ohne Pre-Set-Dims, Dim-Report mit korrekten Werten, kein Report bei failed load, ein Report pro Bild (kein per-frame churn), Live + Media Flow nach init.
  • 31/31 preview-runtime Tests grün (5 neu + 26 existing).
  • 674/674 unit-Suite grün.
  • Manuell verifiziert: + Media → PNG → Preview rendert das Bild.

🤖 Generated with Claude Code

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>
@johannboehme
johannboehme merged commit 05f4a67 into main May 2, 2026
1 check passed
@johannboehme
johannboehme deleted the claude/frosty-meitner-2e919a branch May 2, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0