Implement retained target sessions, runtime sizing and Component navigation

This commit is contained in:
2026-11-12 14:20:26 +01:00
parent e41b276b13
commit 6e25cf3ac6
71 changed files with 2538 additions and 120 deletions
@@ -406,6 +406,53 @@ public final class ProjectionHostChecks {
.get()
.text()
.equals(root.replace("root text", "root changed") + "<!-- queued source edit -->"));
var fullFile =
java.nio.file.Path.of(document.snapshot().toCompletableFuture().get().document())
.resolveSibling("Full.fxml");
String full = java.nio.file.Files.readString(fullFile);
set(document, full);
await(() -> fx(() -> source(pane).getText().equals(full) && object(pane, "home") != null));
click(pane, "Render drafts");
await(
() ->
fx(
() ->
java.util.List.of("home", "visits", "table").stream()
.allMatch(
id ->
object(pane, id).getSceneGraphObject() instanceof SnapshotRegion r
&& r.image() != null
&& r.statusText().equals("Target runtime"))));
check(
document.snapshot().toCompletableFuture().get().text().equals(full),
"Runtime sizing changed source");
document
.save(document.snapshot().toCompletableFuture().get().revision())
.toCompletableFuture()
.get();
click(pane, "Interactive preview");
await(
() ->
pane.interactivePid() > 0
&& ProcessHandle.of(pane.interactivePid())
.map(ProcessHandle::isAlive)
.orElse(false));
long interactivePid = pane.interactivePid();
String editedFull = full + "<!-- unsaved interactive draft -->";
set(document, editedFull);
await(() -> fx(() -> source(pane).getText().equals(editedFull)));
Thread.sleep(500);
check(pane.interactivePid() == interactivePid, "Unsaved edit restarted interactive sample");
document
.save(document.snapshot().toCompletableFuture().get().revision())
.toCompletableFuture()
.get();
await(() -> pane.interactivePid() > 0 && pane.interactivePid() != interactivePid);
await(() -> ProcessHandle.of(interactivePid).map(p -> !p.isAlive()).orElse(true));
long restarted = pane.interactivePid();
click(pane, "Stop preview");
await(() -> ProcessHandle.of(restarted).map(p -> !p.isAlive()).orElse(true));
set(document, original);
await(() -> fx(() -> source(pane).getText().equals(original) && object(pane, "card") != null));
document