From 38a8529d0c801d95faa50d964208eee3475dfa18 Mon Sep 17 00:00:00 2001 From: tommy0103 Date: Mon, 3 Aug 2026 03:47:16 +0800 Subject: [PATCH] fix(renderer): anchor the reader from image mount, not image load A decoder sizes an image from its header, so the row grows as soon as the first bytes are parsed -- measured here at 421ms against a load event at 2407ms. Marking the row only once load fired left that first and largest growth outside the compensation window, and scrolling back through history still moved the reader by the full image height. Rows are now marked from the moment an image mounts until loading finishes, counted so a message with several images stays marked until the last one is done. The listener also moves to the document: rows announce their images while mounting, before a ref-driven listener on the timeline element would exist to hear the first one, which is why the mount signal was being lost. The fixture serves a real PNG and holds the response open, so the row grows long before load the way a large image does; an SVG served in one shot lays out and fires load together and cannot reproduce this. A companion assertion checks the fixture still has that gap, so it cannot quietly stop testing the timing it exists to test. Co-Authored-By: Claude Opus 5 (1M context) --- .../src/components/SessionImage.ce.vue | 40 +-- .../renderer/src/session-image-contract.js | 12 +- .../src/session-timeline-viewport.mjs | 74 ++++-- app/tests/electron-session-images.mjs | 229 ++++++++++++++---- 4 files changed, 270 insertions(+), 85 deletions(-) diff --git a/app/src/renderer/src/components/SessionImage.ce.vue b/app/src/renderer/src/components/SessionImage.ce.vue index b219188..d918048 100644 --- a/app/src/renderer/src/components/SessionImage.ce.vue +++ b/app/src/renderer/src/components/SessionImage.ce.vue @@ -1,6 +1,9 @@