fix(ui): keep a callee row hidden until the rail has been measured (CG-44)

A row's position comes from measuring the laid-out DOM, so between Svelte
creating it and the first relayout it has no place to be. Drawing it at
top: 0 stacks the whole rail at its head for a frame; keeping the previous
symbol's coordinates is worse. It stays invisible until it has been placed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Colby McHenry
2026-08-27 00:12:07 -05:00
co-authored by Claude Opus 5
parent 5cecaabfc2
commit e9596af1cf
2 changed files with 22 additions and 3 deletions
+11
View File
@@ -73,6 +73,14 @@
let stageMinHeight = $state(0);
let connectors = $state<Connector[]>([]);
let overlay = $state({ width: 0, height: 0 });
/**
* The rail has been measured at least once for the symbol on screen.
*
* Until it has, a row has no place to be: drawing it at `top: 0` would stack
* every row at the head of the rail for a frame, and drawing it at the
* PREVIOUS symbol's coordinates would be worse. It stays hidden instead.
*/
let placed = $state(false);
/* ---------------------------------------------------------------- data -- */
@@ -90,6 +98,7 @@
source = null;
railFocus.reset();
hot.set(null);
placed = false;
void project.ensure();
let node: WireSymbolPayload;
@@ -322,6 +331,7 @@
});
connectors = next;
overlay = { width: inner.scrollWidth, height: Math.max(inner.offsetHeight, stageMinHeight) };
placed = true;
}
let scheduled = false;
@@ -460,6 +470,7 @@
{tops}
{foldTop}
{noteTop}
{placed}
focalFile={payload.node.file}
originId={originRight}
emptyReason={emptyCalleeReason}