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:
co-authored by
Claude Opus 5
parent
5cecaabfc2
commit
e9596af1cf
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user