Expand render graph playground editing

Amp-Thread-ID: https://ampcode.com/threads/T-01a033d4-0e44-708e-af0e-6166283416ff
Co-authored-by: Heaust Azure <heaust.azure@gmail.com>
This commit is contained in:
Amp
2026-08-25 05:18:14 +00:00
co-authored by heaust
parent d71da85307
commit e7546e4b78
20 changed files with 3058 additions and 303 deletions
+13 -2
View File
@@ -7,7 +7,11 @@ test("host snapshots are stable immutable projections with isolated subscription
view = window.view,
first = view.getHostSnapshot(),
same = first === view.getHostSnapshot(),
frozen = Object.isFrozen(first) && Object.isFrozen(first.selection) && Object.isFrozen(first.selection.mute);
frozen =
Object.isFrozen(first) &&
Object.isFrozen(first.selection) &&
Object.isFrozen(first.selection.nodeIds) &&
Object.isFrozen(first.selection.mute);
let good = 0,
bad = 0;
const offBad = view.subscribeHost(() => {
@@ -172,6 +176,7 @@ test("explicit node and selection actions preserve worker authority and structur
expect(result.duplicate).toBe("node.duplicate");
expect(result.added).toEqual({ status: "committed", version: 2 });
expect(result.selected).toEqual({
nodeIds: ["supplied-id"],
nodeCount: 1,
linkCount: 0,
canRemove: true,
@@ -182,7 +187,13 @@ test("explicit node and selection actions preserve worker authority and structur
expect(result.mutedSelection.mute).toEqual({ enabled: true, state: "all-muted" });
expect(result.removed).toEqual({ status: "committed", version: 4 });
expect(result.remaining).toBe(0);
expect(result.empty).toEqual({ nodeCount: 0, linkCount: 0, canRemove: false, mute: { enabled: false } });
expect(result.empty).toEqual({
nodeIds: [],
nodeCount: 0,
linkCount: 0,
canRemove: false,
mute: { enabled: false },
});
expect(result.notifications).toBe(3);
});
test("dedicated worker renders, commits FIFO, fans out and destroys", async ({ page }) => {