Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/canvas/workspace/WorkspaceView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -366,13 +366,22 @@ export function WorkspaceView({ rt }: { rt: WorkspaceRuntime }) {
const outputState = timelineOutput.state;
const outputSource = outputState ? doc.nodes.find((node) => node.id === outputState.itemId) : undefined;
const existingOutput = outputState ? projected.nodes.find((node: { id: string }) => node.id === outputState.output.id) : undefined;
const outputSize = {
width: existingOutput?.width ?? 352,
height: existingOutput?.height ?? 198,
};
const pendingOutput = outputSource && outputState && outputState.phase !== "done"
? {
id: outputState.output.id,
type: "video" as const,
position: outputState.output.position,
width: existingOutput?.width ?? 352, height: existingOutput?.height ?? 198,
style: { width: existingOutput?.width ?? 352, height: existingOutput?.height ?? 198 },
width: outputSize.width, height: outputSize.height,
// The injection is rebuilt on every render, so React Flow compares a new
// node object each time and resets `handleBounds` whenever `measured` is
// absent. The pending reference edge then has no path and disappears until
// the node is measured again, which a settled canvas never triggers.
measured: outputSize,
style: { width: outputSize.width, height: outputSize.height },
selectable: false, draggable: false, connectable: false, deletable: false, focusable: false,
data: {
kind: "video" as const, title: outputState.output.title,
Expand Down
3 changes: 3 additions & 0 deletions tests/browser/timeline_node_output.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ try {
await page.locator(`.react-flow__edge[data-id="timeline-pending:${pendingId}"]`).waitFor();
assert.equal(await panel.locator('progress').count(), 0);
await page.waitForTimeout(400);
// The injected pending node keeps its measured size, so the reference edge survives
// later canvas renders instead of vanishing once its first frame is painted.
await page.locator(`.react-flow__edge[data-id="timeline-pending:${pendingId}"]`).waitFor({ state: "visible", timeout: 5000 });
await page.screenshot({ path: "/tmp/opendirector-timeline-pending.png" });
releaseFirst();
await page.unrouteAll({ behavior: "wait" });
Expand Down
Loading