Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

fix: address timeline layout review feedback

EtienneLescot164cc15632c0
diff --git a/crates/compositor/src/frame_geometry.rs b/crates/compositor/src/frame_geometry.rs
index 041184142..258169996 100644
--- a/crates/compositor/src/frame_geometry.rs
+++ b/crates/compositor/src/frame_geometry.rs
@@ -3041,7 +3041,12 @@ pub fn plan_frame(input: &FrameGeometryInput) -> FrameGeometry {
let cursor = input.cursor;
let layout_time = input.timeline_t_override.unwrap_or(frame / FPS);
let sampled_layout = scene.and_then(|s| s.layout_at(layout_time));
- let previous_layout = scene.and_then(|s| s.layout_at(layout_time - 1.0 / FPS));
+ // A cut has no layout velocity. Keep the previous zoom sample, but never trail
+ // the old layout into a new passage whose transition was intentionally disabled.
+ let previous_layout_time = if sampled_layout.as_ref().is_some_and(|s| s.hard_cut) {
+ layout_time
+ } else { layout_time - 1.0 / FPS };
+ let previous_layout = scene.and_then(|s| s.layout_at(previous_layout_time));
if let Some(shape) = sampled_layout.as_ref().and_then(|s| s.layout.webcam_shape.as_ref()) {
lp.webcam_shape = webcam_shape_code(shape);
}
@@ -4925,6 +4930,53 @@ mod tests {
assert_eq!(trimmed.layout_at(3.5).unwrap().layout.webcam_rect.unwrap().width, 1.0);
}
+ #[test]
+ fn hard_layout_cuts_do_not_trail_the_previous_layout() {
+ use crate::scene::SceneRect;
+ let cfg = crate::config::all().pop().expect("compositor config");
+ let full = SceneRect { x: 0.0, y: 0.0, width: 1.0, height: 1.0 };
+ for explicit_from in [false, true] {
+ let mut scene = golden_scene();
+ scene.effects.motion_blur = 1.0;
+ let source = layout_region("picture-in-picture", 0.0, 3.0,
+ Some(SceneRect { x: 0.7, y: 0.7, width: 0.2, height: 0.2 }));
+ let mut target = layout_region("camera-only", 3.0, 10.0, Some(full));
+ target.layout.screen_rect = full;
+ target.from_layout = explicit_from.then(|| source.layout.clone());
+ target.transition_sec = 0.0;
+ scene.layout_regions = vec![source, target];
+ assert!(scene.layout_at(3.0).unwrap().hard_cut);
+ let mut input = golden_input(&scene, &cfg);
+ input.timeline_t_override = Some(3.0);
+ let g = plan_frame(&input);
+ assert!(g.mb_amount > 0.0);
+ assert_eq!(g.s_dst, g.s_dst_prev, "a hard cut must not smear the old screen");
+ assert_eq!(g.w_dst, g.w_dst_prev, "a hard cut must not smear the old camera");
+ }
+ }
+
+ #[test]
+ fn animated_layout_changes_keep_the_previous_frame_for_motion_blur() {
+ use crate::scene::SceneRect;
+ let cfg = crate::config::all().pop().expect("compositor config");
+ let mut scene = golden_scene();
+ scene.effects.motion_blur = 1.0;
+ let full = SceneRect { x: 0.0, y: 0.0, width: 1.0, height: 1.0 };
+ let source = layout_region("picture-in-picture", 0.0, 3.0,
+ Some(SceneRect { x: 0.7, y: 0.7, width: 0.2, height: 0.2 }));
+ let mut target = layout_region("camera-only", 3.0, 10.0, Some(full));
+ target.layout.screen_rect = full;
+ target.from_layout = Some(source.layout.clone());
+ target.transition_sec = 0.2;
+ scene.layout_regions = vec![source, target];
+ assert!(!scene.layout_at(3.1).unwrap().hard_cut);
+ let mut input = golden_input(&scene, &cfg);
+ input.timeline_t_override = Some(3.1);
+ let g = plan_frame(&input);
+ assert_ne!(g.s_dst, g.s_dst_prev, "an animated screen keeps its motion trail");
+ assert_ne!(g.w_dst, g.w_dst_prev, "an animated camera keeps its motion trail");
+ }
+
#[test]
fn every_layout_pair_has_continuous_footage_at_both_transition_edges() {
use crate::scene::{SceneFrame, SceneRect};
diff --git a/crates/compositor/src/scene.rs b/crates/compositor/src/scene.rs
index 0322aab8e..a4f190334 100644
--- a/crates/compositor/src/scene.rs
+++ b/crates/compositor/src/scene.rs
@@ -183,6 +183,7 @@ pub struct SampledLayout<'a> {
pub preset: &'a str,
pub layout: ResolvedClipLayout,
pub from_layout: Option<&'a ResolvedClipLayout>,
+ pub hard_cut: bool,
pub progress: f32,
pub screen_cover_mix: f32,
pub webcam_reactive_zoom: f32,
@@ -230,6 +231,7 @@ impl SceneLayoutRegion {
}
}
SampledLayout { preset: &self.preset, layout, from_layout: self.from_layout.as_ref(),
+ hard_cut: self.from_layout.is_none() || self.transition_sec <= 0.0,
progress, screen_cover_mix, webcam_reactive_zoom: reactive, webcam_shadow }
}
}
diff --git a/electron/ai-edition/agent-tools.test.ts b/electron/ai-edition/agent-tools.test.ts
index b0be46889..44fa595e3 100644
--- a/electron/ai-edition/agent-tools.test.ts
+++ b/electron/ai-edition/agent-tools.test.ts
@@ -245,6 +245,55 @@ describe("the mutating-tool table", () => {
});
describe("executeAgentTool", () => {
+ it("refuses layout edits that would not change the document", () => {
+ const doc = withCameraTrack(fixtureDocument());
+ const unchanged = executeAgentTool(
+ doc,
+ "addLayoutChange",
+ JSON.stringify({
+ timeSec: 5,
+ preset: "picture-in-picture",
+ }),
+ );
+ expect(unchanged.ok).toBe(false);
+ expect(unchanged.document).toBeUndefined();
+ expect(JSON.parse(unchanged.resultJson).error).toMatch(/nothing to change/i);
+
+ const added = executeAgentTool(
+ doc,
+ "addLayoutChange",
+ JSON.stringify({
+ timeSec: 5,
+ preset: "dual-frame",
+ }),
+ );
+ expect(added.ok).toBe(true);
+ const next = added.document as AxcutDocument;
+ const layoutId = next.layoutRegions?.find((r) => r.preset === "dual-frame")?.id;
+ expect(layoutId).toBeDefined();
+ const samePassage = executeAgentTool(
+ next,
+ "setLayoutPreset",
+ JSON.stringify({
+ layoutId,
+ preset: "dual-frame",
+ }),
+ );
+ expect(samePassage.ok).toBe(false);
+ expect(samePassage.document).toBeUndefined();
+ expect(JSON.parse(samePassage.resultJson).error).toMatch(/nothing to change/i);
+ const sameChange = executeAgentTool(
+ next,
+ "addLayoutChange",
+ JSON.stringify({
+ timeSec: 6,
+ preset: "dual-frame",
+ }),
+ );
+ expect(sameChange.ok).toBe(false);
+ expect(sameChange.document).toBeUndefined();
+ });
+
it("edits the same continuous layouts as the timeline and protects the first passage", () => {
const first = executeAgentTool(
withCameraTrack(fixtureDocument()),
diff --git a/electron/ai-edition/agent-tools.ts b/electron/ai-edition/agent-tools.ts
index 3e650b760..128d0b910 100644
--- a/electron/ai-edition/agent-tools.ts
+++ b/electron/ai-edition/agent-tools.ts
@@ -3383,6 +3383,7 @@ export function executeAgentTool(
if (blind) return blind;
}
const next = addLayoutChange(document, timeSec, preset);
+ if (next === document) return failure("This layout already applies here; nothing to change.");
return {
ok: true,
document: next,
@@ -3402,6 +3403,8 @@ export function executeAgentTool(
if (blind) return blind;
}
const next = setLayoutPreset(document, parsed.data.layoutId, parsed.data.preset);
+ if (next === document)
+ return failure("This passage already uses this layout; nothing to change.");
return {
ok: true,
document: next,
diff --git a/src/components/ai-edition/RightPanes.layout.test.tsx b/src/components/ai-edition/RightPanes.layout.test.tsx
index 59005eb84..33a321ca5 100644
--- a/src/components/ai-edition/RightPanes.layout.test.tsx
+++ b/src/components/ai-edition/RightPanes.layout.test.tsx
@@ -10,8 +10,10 @@ import userEvent from "@testing-library/user-event";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { I18nProvider } from "@/contexts/I18nContext";
import { LOCALE_STORAGE_KEY } from "@/i18n/config";
+import { addLayoutChange, layoutRuns } from "@/lib/ai-edition/document/layout";
import { type AxcutDocument, createEmptyDocument } from "@/lib/ai-edition/schema";
import { useProjectStore } from "@/lib/ai-edition/store/projectStore";
+import { nativeBridgeClient } from "@/native/client";
import { LayoutPane } from "./RightPanes";
const segmentation = vi.hoisted(() => ({ supported: false, segmentCameraFrame: vi.fn() }));
@@ -138,6 +140,34 @@ describe("LayoutPane camera availability", () => {
});
});
+describe("LayoutPane passage editing", () => {
+ beforeEach(() => {
+ vi.spyOn(nativeBridgeClient.aiEdition, "save").mockImplementation(async (document) => ({
+ success: true,
+ document,
+ }));
+ });
+ afterEach(() => vi.restoreAllMocks());
+
+ it.each([6, 10, 12.5])("edits only the last passage at playhead %s", async (currentTimeSec) => {
+ const doc = addLayoutChange(seedProject(true), 4, "dual-frame");
+ useProjectStore.setState({ currentTimeSec });
+ renderLayout(doc);
+ expect(screen.getByRole("button", { name: "Side by side" })).toHaveAttribute(
+ "aria-pressed",
+ "true",
+ );
+ await userEvent.setup().click(screen.getByRole("button", { name: "Camera only" }));
+ await waitFor(() => {
+ const saved = useProjectStore.getState().document;
+ expect(saved && layoutRuns(saved).map((r) => [r.start, r.end, r.member.preset])).toEqual([
+ [0, 4, "picture-in-picture"],
+ [4, 10, "camera-only"],
+ ]);
+ });
+ });
+});
+
describe("LayoutPane webcam framing picture", () => {
// Shown in the camera's own shape only: before its metadata the box is a 16:9 guess, and a
// picture drawn in it would be stretched.
diff --git a/src/components/ai-edition/RightPanes.tsx b/src/components/ai-edition/RightPanes.tsx
index 8e3183e93..ccada8808 100644
--- a/src/components/ai-edition/RightPanes.tsx
+++ b/src/components/ai-edition/RightPanes.tsx
@@ -2781,7 +2781,10 @@ export function LayoutPane() {
const saveDocument = useProjectStore((s) => s.saveDocument);
const runs = useMemo(() => (document ? layoutRuns(document) : []), [document]);
const hasLayoutChanges = runs.length > 1 || Boolean(runs[0]?.member.legacyCamera);
- const passage = runs.find((r) => currentTime >= r.start && currentTime < r.end);
+ const lastPassage = runs.at(-1);
+ const passage =
+ runs.find((r) => currentTime >= r.start && currentTime < r.end) ??
+ (lastPassage && currentTime >= lastPassage.end ? lastPassage : undefined);
// A project can hold clips with no camera attached at all (plain imports or a
// recording made without a webcam). Keep the saved camera preference for later, but
// make the disabled control describe whether this project has any camera at all.
diff --git a/src/components/ai-edition/v4/V4Timeline.geometry.test.tsx b/src/components/ai-edition/v4/V4Timeline.geometry.test.tsx
index fb1c85b8f..9d37a5440 100644
--- a/src/components/ai-edition/v4/V4Timeline.geometry.test.tsx
+++ b/src/components/ai-edition/v4/V4Timeline.geometry.test.tsx
@@ -149,9 +149,10 @@ function renderTimeline(
};
const setCurrentTime = vi.fn();
const onAnnotationRowCountChange = vi.fn();
- const timeline = (
+ const timeline = (variant: "edit" | "media" = "edit") => (
<ShortcutsProvider>
<V4Timeline
+ variant={variant}
// Only the members the lanes and the clip row read are mocked; the prop
// stays typed as the real API rather than widened to `any` (AGENTS.md).
tl={tl as unknown as ReturnType<typeof useTimeline>}
@@ -164,16 +165,17 @@ function renderTimeline(
/>
</ShortcutsProvider>
);
- render(
+ const view = render(
onRender ? (
<Profiler id="timeline" onRender={onRender}>
- {timeline}
+ {timeline()}
</Profiler>
) : (
- timeline
+ timeline()
),
);
return {
+ rerenderVariant: (variant: "edit" | "media") => view.rerender(timeline(variant)),
onAnnotationRowCountChange,
// A getter: a test that empties `annotationRegions` renders no such pill, and an eager
// lookup would throw before its own assertions ran.
@@ -657,6 +659,29 @@ describe("V4Timeline create-from-toolbar", () => {
// timeline it renders nothing in the preview and nothing in the export — the region is
// stored and forgotten. `addCameraFullscreen` now refuses to write one; the button says
// so before it is clicked instead of looking like it worked.
+ it.each([
+ "media",
+ "no-document",
+ "empty-timeline",
+ ] as const)("closes the layout picker and ignores shortcuts while %s, without reopening on return", (condition) => {
+ const { tl, rerenderVariant } = renderTimeline();
+ const clips = tl.clips;
+ const openPicker = () => act(() => window.dispatchEvent(new Event("openscreen:change-layout")));
+ openPicker();
+ expect(screen.getByRole("group", { name: "layouts.title" })).toBeInTheDocument();
+ if (condition === "no-document") tl.hasDoc = false;
+ if (condition === "empty-timeline") tl.clips = [];
+ rerenderVariant(condition === "media" ? "media" : "edit");
+ expect(screen.queryByRole("group", { name: "layouts.title" })).not.toBeInTheDocument();
+ openPicker();
+ tl.hasDoc = true;
+ tl.clips = clips;
+ rerenderVariant("edit");
+ expect(screen.queryByRole("group", { name: "layouts.title" })).not.toBeInTheDocument();
+ openPicker();
+ expect(screen.getByRole("group", { name: "layouts.title" })).toBeInTheDocument();
+ });
+
it("keeps layout changes available for screen-only footage", () => {
renderTimeline();
const button = screen.getByRole("button", { name: "layouts.changeHere" });
diff --git a/src/components/ai-edition/v4/V4Timeline.tsx b/src/components/ai-edition/v4/V4Timeline.tsx
index 9cd67cb34..6e6ea6448 100644
--- a/src/components/ai-edition/v4/V4Timeline.tsx
+++ b/src/components/ai-edition/v4/V4Timeline.tsx
@@ -713,11 +713,16 @@ export function V4Timeline({
const [autoEnhanceOpen, setAutoEnhanceOpen] = useState(false);
const [audioMenuOpen, setAudioMenuOpen] = useState(false);
const [layoutOpen, setLayoutOpen] = useState(false);
+ const canChangeLayout = variant === "edit" && tl.hasDoc && tl.clips.length > 0;
useEffect(() => {
+ if (!canChangeLayout) {
+ setLayoutOpen(false);
+ return;
+ }
const open = () => setLayoutOpen(true);
window.addEventListener("openscreen:change-layout", open);
return () => window.removeEventListener("openscreen:change-layout", open);
- }, []);
+ }, [canChangeLayout]);
const [autoBusy, setAutoBusy] = useState(false);
// The AI cut pass reads the transcript, and the transcript is produced in the
// background (see transcriptionStore). Until it is there, the entry says why
@@ -2271,7 +2276,7 @@ export function V4Timeline({
<Crosshair size={16} />
</button>
</Tooltip>
- <Popover open={layoutOpen} onOpenChange={setLayoutOpen}>
+ <Popover open={canChangeLayout && layoutOpen} onOpenChange={setLayoutOpen}>
<Tooltip
content={t("layouts.changeHere")}
shortcut={formatBinding(shortcuts.addCameraFullscreen, isMac)}
@@ -2281,7 +2286,7 @@ export function V4Timeline({
type="button"
className={styles.tlToolBtn}
aria-label={t("layouts.changeHere")}
- disabled={!tl.hasDoc || clips.length === 0}
+ disabled={!canChangeLayout}
data-testid="change-layout"
>
<PanelsTopLeft size={16} />
diff --git a/src/lib/compositeLayout.test.ts b/src/lib/compositeLayout.test.ts
index 9397780b3..45bbe26ca 100644
--- a/src/lib/compositeLayout.test.ts
+++ b/src/lib/compositeLayout.test.ts
@@ -4,6 +4,7 @@ import {
autoFrameAspect,
computeCameraFullscreenRect,
computeCompositeLayout,
+ interpolateCompositeLayout,
isWebcamBlockLayout,
paddedContentSize,
paddingFit,
@@ -12,6 +13,7 @@ import {
restingCompositionAspect,
type Size,
type StyledRenderRect,
+ type WebcamCompositeLayout,
type WebcamLayoutPreset,
} from "./compositeLayout";
import { frameFootprint, frameUnit, type Insets } from "./frameFootprint";
@@ -715,6 +717,82 @@ describe("Auto frame", () => {
}
});
+describe("interpolateCompositeLayout", () => {
+ const pip: WebcamCompositeLayout = {
+ screenRect: { x: 10, y: 20, width: 600, height: 340 },
+ webcamRect: { x: 700, y: 500, width: 200, height: 200, borderRadius: 100, maskShape: "circle" },
+ };
+ const block: WebcamCompositeLayout = {
+ screenRect: { x: 100, y: 50, width: 400, height: 240 },
+ webcamRect: {
+ x: 600,
+ y: 100,
+ width: 300,
+ height: 400,
+ borderRadius: 12,
+ maskShape: "rectangle",
+ },
+ screenCover: true,
+ screenBorderRadius: 24,
+ };
+ const screenOnly: WebcamCompositeLayout = { ...pip, webcamRect: null };
+
+ it("moves screen and camera geometry together and rounds the intermediate mask", () => {
+ const sampled = interpolateCompositeLayout(pip, block, 0.25);
+ expect(sampled.screenRect).toEqual({ x: 32.5, y: 27.5, width: 550, height: 315 });
+ expect(sampled.webcamRect).toEqual({
+ x: 675,
+ y: 400,
+ width: 225,
+ height: 250,
+ borderRadius: 78,
+ maskShape: "rectangle",
+ });
+ expect(sampled.screenBorderRadius).toBe(6);
+ expect(interpolateCompositeLayout(block, pip, 0.25).screenBorderRadius).toBe(18);
+ });
+
+ it("keeps the block crop through both transition directions", () => {
+ for (const t of [0, 0.25, 0.999]) {
+ expect(interpolateCompositeLayout(pip, block, t).screenCover).toBe(true);
+ expect(interpolateCompositeLayout(block, pip, t).screenCover).toBe(true);
+ expect(interpolateCompositeLayout(pip, pip, t).screenCover).toBe(false);
+ }
+ });
+
+ it("grows a webcam from its centre when leaving screen-only", () => {
+ expect(interpolateCompositeLayout(screenOnly, pip, 0).webcamRect).toMatchObject({
+ x: 800,
+ y: 600,
+ width: 0,
+ height: 0,
+ borderRadius: 0,
+ maskShape: "rectangle",
+ });
+ expect(interpolateCompositeLayout(screenOnly, pip, 0.25).webcamRect).toEqual({
+ x: 775,
+ y: 575,
+ width: 50,
+ height: 50,
+ borderRadius: 25,
+ maskShape: "rectangle",
+ });
+ });
+
+ it("shrinks a webcam toward its centre when entering screen-only", () => {
+ expect(interpolateCompositeLayout(pip, screenOnly, 0.25).webcamRect).toEqual({
+ x: 725,
+ y: 525,
+ width: 150,
+ height: 150,
+ borderRadius: 75,
+ maskShape: "rectangle",
+ });
+ expect(interpolateCompositeLayout(pip, screenOnly, 0.999).webcamRect?.width).toBeGreaterThan(0);
+ expect(interpolateCompositeLayout(screenOnly, screenOnly, 0.5).webcamRect).toBeNull();
+ });
+});
+
describe("computeCameraFullscreenRect", () => {
const CANVAS = { width: 1920, height: 1080 };
const pip = (over: Partial<StyledRenderRect> = {}): StyledRenderRect => ({
diff --git a/src/native/sceneDescription.ts b/src/native/sceneDescription.ts
index 7afdcced2..f8d73df8e 100644
--- a/src/native/sceneDescription.ts
+++ b/src/native/sceneDescription.ts
@@ -406,16 +406,21 @@ export interface ResolvedClipLayout {
}
export interface SceneLayoutRegion {
+ /** Index of the clip whose SOURCE clock addresses this passage. */
clipIndex: number;
+ /** Source seconds visible after trims; these can be narrower than the original passage. */
startSec: number;
endSec: number;
preset: LayoutPreset;
layout: ResolvedClipLayout;
webcamReactiveZoom: boolean;
+ /** Previous resolved layout, preset and reactive flag: supplied together or all omitted. */
fromLayout?: ResolvedClipLayout;
fromPreset?: LayoutPreset;
fromWebcamReactiveZoom?: boolean;
+ /** Original passage start in source seconds; trimming must not restart its animation. */
transitionStartSec: number;
+ /** Duration in source seconds, or 0 without fromLayout (including legacy-camera neighbours). */
transitionSec: number;
}
diff --git a/technical-documentation/architecture/document-model.md b/technical-documentation/architecture/document-model.md
index be53613df..e5efe94c8 100644
--- a/technical-documentation/architecture/document-model.md
+++ b/technical-documentation/architecture/document-model.md
@@ -27,6 +27,7 @@ and anything unknown is rejected by the `z.literal(axcutSchemaVersion)` check in
| `timeline` | `{ clips[], gaps[], trimRanges[], muteRanges[], speedRanges[], captionRanges[] }` | Clips carry their own in/out (`sourceStartSec`/`sourceEndSec`); trims are anchored to a clip (`clipId?`) since v7. See [timeline-model.md](timeline-model.md). |
| `annotations[]` | `AxcutAnnotationRegion[]` | Text/image/figure/blur overlays, anchored to a clip (`clipId?`). |
| `zoomRanges[]` | `AxcutZoomRegion[]` | Zoom-in effects, depth 1–6, anchored to a clip (`clipId?`). |
+| `layoutRegions[]?` | `LayoutRegion[]` | Optional clip-anchored layout partition (v9). Absent or empty uses the global `legacyEditor.webcamLayoutPreset`. See [Layout passages (v9)](#layout-passages-v9). |
| `shaderEffects[]?` | `AxcutShaderEffect[]` | Agent-written shader effects: WGSL `code`, `name`, `description`, the contract version, declared `params`, and the compositor's cached `cost`. Optional: absent on a document without effects. A definition no region uses is dropped by the edit that removed its last region. See [docs/shader-effects.md](../../docs/shader-effects.md). |
| `shaderEffectRanges[]?` | `AxcutShaderEffectRange[]` | Where each effect applies: clip-anchored regions like the zooms, with the parameter `values` that differ from the defaults, a `target` (`image`, `text`, `both`). One effect at a time: regions do not overlap. Optional, like `shaderEffects`. |
| `audioTracks[]` | `AxcutAudioTrack[]` | Imported audio (voiceover / BGM / SFX, issue #350) mixed over the programme. NOT clip-anchored — addressed in RAW/document timeline seconds (`timelineStartSec`), with `trimStartSec`/`trimEndSec` windowing the source and `gainDb` its level. Added from the timeline toolbar; the referenced asset has `kind: "audio"`. |
@@ -137,6 +138,15 @@ ratio with `"16:9"` (`DEFAULT_EDITOR_LAYOUT_SETTINGS`), since every v2 file pred
Auto. The one producer of new v2 files, `openscreen record --project`, states Auto
explicitly.
+### v8 → v9 (`upgradeV8DocumentToV9`, `schema/index.ts`)
+
+The load migration converts Full Camera into `camera-only` passages and removes the
+old mutable collection. Migration-only `legacyCamera` metadata preserves the
+original source envelopes and easing. A v8 document with existing `layoutRegions`
+retains them; when its clip timeline exists and `legacyEditor.aspectRatio` is
+missing, the upgrader pins `"16:9"`. The released v7 → v8 aspect-ratio migration
+remains in the chain unchanged. Validation stays pure.
+
### Legacy v2 → current (`migrateProjectDataToAxcutDocument`, `document/migrate.ts`)
OpenScreen's pre-merge editor stored projects as `EditorProjectData` (an envelope
@@ -245,8 +255,5 @@ A change lasts until the next one; removing it extends the preceding passage. Th
first passage cannot be removed. Equal neighbours merge, and a uniform partition
collapses back to the global preset. Global settings writes also use this partition.
-The v8→v9 load migration converts Full Camera into `camera-only` passages and removes
-the old mutable collection. Migration-only `legacyCamera` metadata keeps the original
-source envelopes and easing. Existing layouts from the earlier experimental v8 build
-are retained, including its implicit 16:9 shape. The released v7→v8 aspect-ratio
-migration stays in the chain unchanged. Validation remains pure.
+The [v8 → v9 load migration](#v8--v9-upgradev8documenttov9-schemaindexts) preserves
+existing Full Camera playback and layout partitions when opening older projects.
diff --git a/technical-documentation/testing/manual-e2e-checklist.md b/technical-documentation/testing/manual-e2e-checklist.md
index 906c00660..cc45f4d8c 100644
--- a/technical-documentation/testing/manual-e2e-checklist.md
+++ b/technical-documentation/testing/manual-e2e-checklist.md
@@ -1003,3 +1003,4 @@ These checks are the human slice: an agent cannot click Apple's picker (see abov
| 2026-10-22 | Dev `d8bf2d81` + issue #1260 patch (`fix/agent-stop-1260`), Electron 41.2.1; Vite `127.0.0.1:5186`, private `openscreen1260-ui-*` userData, local controlled OpenAI-compatible provider | macOS 15.8, Apple Silicon | Superseded — pre-`0cb26e07` Agent Stop check | **Superseded by `0cb26e07`:** the two-Undo observation below records the old per-tool behavior. The current implementation applies the accumulated document once on completion or Stop, with one save and one undo step per turn. Automated regressions cover normal and stopped turns with 60 tool edits; this desktop check has not been rerun on the new head. **Historical run:** Real Electron operated through computer-use: sent a first turn, observed Stop while the provider held its SSE response open, applied two `setVocabulary` edits, clicked Stop, saw the stopped status and Send return, confirmed the provider connection closed and the partial answer plus `stopped: true` reached the chat sidecar. Document bytes stayed at `Second edit`; one Undo restored `First edit`, a second restored the initial document. A new turn completed with `Next turn works.` Screenshots captured for running and continued states. Skipped: paid/remote providers, Windows/Linux desktop UI, capture, media preview and export (this patch changes Agent chat only). |
| 2026-10-23 | `fix/mac-mic-silent-with-system-audio` on `main` @ `264975d`, dev build (`npm run dev`), capture helper built locally with Xcode 27 and copied from `out/Products/Release` by hand | macOS 26.6.2 (25G83), MacBook Pro M2 Pro; built-in microphone and a USB Audio CODEC (08bb:2902) | **Partial: fix slice only, pass** | #1173, Apple's picker, system audio on, output device idle (after `sudo killall coreaudiod`, or checked idle). Before the fix: the microphone delivered nothing until another app played a sound, 56 s (built-in) and 14 s (USB) into the take; without system audio it started at 0.17 s. With the tap merely started after the stream, four takes (built-in twice, USB twice) recorded the microphone from 0.17–0.18 s, but only 12–30 ms ahead of the tap. With this branch's version, the tap waiting for the first microphone buffer: one USB take recorded the microphone from 0.18 s and the tap started 27 ms after it; one take with the microphone off. In both, a sound played mid-take was in system audio. Measured with temporary per-source buffer counters in the helper, not shipped. **Not covered:** this branch's version with the built-in microphone, a legacy-picker take, macOS 15, an Intel Mac, a microphone that never delivers (the 1 s fallback), pause before the first microphone buffer, a CI-built artifact. |
| 2026-10-27 | Dev v2.1.2, `codex/timeline-dispositions` on `main` @ `27d9be27b` + local layouts/schema-v9 changes; Windows compositor rebuilt from this tree; complete v2.1.2 native binary directory copied and hash-checked before the rebuild | Windows 11, D3D11 / NVENC | **Partial — export slice passed; desktop UI interrupted** | Synthetic screen + linked webcam, shared native scene exported to MP4 (300 frames at 30 fps) and GIF (100 frames at 10 fps). Side-by-side and top/bottom keep zoomed footage inside their slots (0 blue source pixels outside either slot); PiP restores overflow. For top/bottom → PiP with 2.2× zoom, the MP4 has identical blue areas before/at the transition start (66,612 pixels) and at/after its end (483,645 pixels), with progressive intermediate sizes. Native geometry tests cover all 20 ordered layout pairs, both animation edges, zoom 1×/2×, frames none/window/laptop, crop, camera, corners and shadow. 472 native tests passed; the one excluded playback-at-end test also fails on pristine `27d9be27b` on this hardware. Desktop computer-use was stopped by the user with Escape, so GUI preview/playback, actual device-frame controls, timeline mouse/keyboard editing and persistence were **not visually verified** after the port. The app was relaunched with the rebuilt addon; the maintainer subsequently tested it and reported that the feature works. Final pre-PR JavaScript suite: 5,058 passed, 5 skipped; app/test typechecks passed. **Skipped:** real capture/webcam/tray, tilted/3D transition pixel exports, the remaining checklist, macOS/Linux runtime verification. This is not release-promotion QA. |
+| 2026-10-27 | Dev v2.1.2, `codex/timeline-dispositions`, review follow-up to `5b76530fb`; MSVC Rust test binary rebuilt from this tree | Windows 11 | **Partial — automated regression slice only** | PR #1404 review fixes: 10 native layout tests passed, including new hard-cut motion-blur isolation and preservation of positive-duration animation trails. React regressions cover selecting only the last passage at/after timeline end and closing/clearing the layout picker in media mode, without a document, or without clips. Agent tests reject no-op layout writes; workbench verifies reports only when no later mutation follows. Full JavaScript suite: 5,069 passed, 5 skipped; 19 targeted workbench tests and app/test/workbench typechecks pass. **Skipped:** desktop computer-use was not resumed after the user's earlier Escape; no fresh GUI preview, export pixel, capture, device, tray, macOS/Linux runtime or full checklist pass. The running app's native addon was not replaced during this review follow-up. |
diff --git a/workbench/l0/oracles.wb.ts b/workbench/l0/oracles.wb.ts
index a03ac5360..10171f62b 100644
--- a/workbench/l0/oracles.wb.ts
+++ b/workbench/l0/oracles.wb.ts
@@ -12,6 +12,7 @@ import {
} from "../lib/fixtures";
import {
assetDuration,
+ buildEvalContext,
classifyFailure,
compressedDurationSec,
diffMatches,
@@ -130,6 +131,63 @@ describe("unplayableRegions", () => {
});
describe("diffMatches", () => {
+ it("does not compare an earlier layout report with a later settings write", () => {
+ const before = withCameraTrack();
+ const first = apply(before, "addLayoutChange", { timeSec: 5, preset: "camera-only" });
+ const last = apply(first.document, "setEditorSettings", { webcamLayoutPreset: "no-webcam" });
+ expect(first.call.resultOk).toBe(true);
+ expect(last.call.resultOk).toBe(true);
+ expect(JSON.parse(last.call.resultJson ?? "{}").layoutSegments).toBeUndefined();
+ expect(diffMatches(last.document, first.call)).toBe(false);
+ const context = buildEvalContext({
+ answer: "",
+ before,
+ after: last.document,
+ mutated: true,
+ run: { ok: true, ms: 1 },
+ wire: {
+ systemBlocks: [],
+ systemChars: 0,
+ systemSha256: "",
+ toolsSent: [],
+ toolNames: [],
+ toolsSha256: "",
+ rounds: 1,
+ calls: [first.call, last.call],
+ },
+ });
+ expect(context.diffMatches(first.call)).toBe(true);
+ });
+
+ it("still verifies layout reports when only a read follows", () => {
+ const before = withCameraTrack();
+ const { document, call } = apply(before, "addLayoutChange", {
+ timeSec: 5,
+ preset: "camera-only",
+ });
+ const read = { ...apply(document, "getCurrentDocument", {}).call, mutating: false };
+ const check = (reported: WireCall) =>
+ buildEvalContext({
+ answer: "",
+ before,
+ after: document,
+ mutated: true,
+ run: { ok: true, ms: 1 },
+ wire: {
+ systemBlocks: [],
+ systemChars: 0,
+ systemSha256: "",
+ toolsSent: [],
+ toolNames: [],
+ toolsSha256: "",
+ rounds: 1,
+ calls: [reported, read],
+ },
+ }).diffMatches(reported);
+ expect(check(call)).toBe(true);
+ expect(check({ ...call, resultJson: JSON.stringify({ layoutSegments: [] }) })).toBe(false);
+ });
+
it("checks the whole layout partition returned by the tool against the document", () => {
const { document, call } = apply(withCameraTrack(), "addLayoutChange", {
timeSec: 5,
diff --git a/workbench/lib/oracles.ts b/workbench/lib/oracles.ts
index b17894324..194e9fdc7 100644
--- a/workbench/lib/oracles.ts
+++ b/workbench/lib/oracles.ts
@@ -310,7 +310,7 @@ function spanOfId(document: AxcutDocument, id: string): Span | null {
* not carry — the repel clamp (DSL-4), the multi-clip pill amputation (DSL-1),
* and a silently dropped region (invariant 2) all land here.
*/
-export function diffMatches(after: AxcutDocument, call: WireCall): boolean {
+export function diffMatches(after: AxcutDocument, call: WireCall, laterMutation = false): boolean {
if (!call.mutating || !call.resultOk || call.resultJson === undefined) return true;
let result: Record<string, unknown>;
try {
@@ -321,6 +321,8 @@ export function diffMatches(after: AxcutDocument, call: WireCall): boolean {
return true;
}
if (Array.isArray(result.layoutSegments)) {
+ // Only the final document is available; a later write can replace this partition.
+ if (laterMutation) return true;
const actual = layoutRuns(after);
return (
result.layoutSegments.length === actual.length &&
@@ -435,7 +437,12 @@ export function buildEvalContext(input: EvalInput): EvalContext {
return index === -1 ? Number.POSITIVE_INFINITY : index;
},
unplayableRegions: () => unplayableRegions(after),
- diffMatches: (call) => diffMatches(after, call),
+ diffMatches: (call) =>
+ diffMatches(
+ after,
+ call,
+ wire.calls.slice(wire.calls.indexOf(call) + 1).some((later) => later.mutating),
+ ),
assetDuration: (assetId) => assetDuration(after, assetId),
compressedDurationSec: () => compressedDurationSec(after),
classifyFailure: () => classifyFailure(input.run),