From 710990ea5cd4ee14c319ff83728231b8eef2036f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20B=C3=A1lint=20Hunor?= Date: Sun, 15 Nov 2026 21:16:05 +0200 Subject: [PATCH 1/5] wip: v2 docs refresh (DeepSeek free, unreviewed) --- docs/getting-started.md | 4 + .../tutorial-advanced/ai-agent-integration.md | 4 + docs/tutorial-advanced/complex-animations.md | 4 + docs/tutorial-advanced/conclusion.md | 4 + .../importing-manim-scenes.md | 4 + .../working-with-multimedia.md | 4 + docs/tutorial-basics/adding-text-and-latex.md | 4 + .../tutorial-basics/exporting-your-project.md | 4 + .../managing-timeline-and-animations.md | 4 + .../understanding-the-interface.md | 4 + .../working-with-mathematical-components.md | 4 + docs/v2/architecture.md | 865 +++++++++++++ docs/v2/captions-and-automation.md | 126 ++ docs/v2/cli.md | 933 +++++++++++++++ docs/v2/editor.md | 107 ++ docs/v2/getting-started.md | 72 ++ docs/v2/install.md | 70 ++ docs/v2/keyboard-shortcuts.md | 155 +++ docs/v2/math-objects.md | 75 ++ docs/v2/mcp.md | 580 +++++++++ docs/v2/migrating-from-v1.md | 110 ++ docs/v2/plugins.md | 1065 +++++++++++++++++ docusaurus.config.ts | 29 +- scripts/sync-v2-docs.mjs | 87 ++ sidebars.ts | 33 +- static/img/v2/editor-auto-reframe.png | Bin 0 -> 108455 bytes static/img/v2/editor-auto-reframe.webp | Bin 0 -> 51000 bytes static/img/v2/editor-autocut.png | Bin 0 -> 107873 bytes static/img/v2/editor-autocut.webp | Bin 0 -> 52556 bytes static/img/v2/editor-effect-warning.webp | Bin 0 -> 52712 bytes static/img/v2/editor-export-queue.png | Bin 0 -> 136159 bytes static/img/v2/editor-export-queue.webp | Bin 0 -> 46944 bytes static/img/v2/editor-export.webp | Bin 0 -> 32784 bytes static/img/v2/editor-main.png | Bin 0 -> 123622 bytes static/img/v2/editor-main.webp | Bin 0 -> 50878 bytes static/img/v2/editor-markers.png | Bin 0 -> 138960 bytes static/img/v2/editor-markers.webp | Bin 0 -> 58476 bytes static/img/v2/editor-math-dialog.png | Bin 0 -> 182019 bytes static/img/v2/editor-math-dialog.webp | Bin 0 -> 61714 bytes static/img/v2/editor-math-panel.png | Bin 0 -> 176467 bytes static/img/v2/editor-math-panel.webp | Bin 0 -> 76246 bytes static/img/v2/editor-media-fit.webp | Bin 0 -> 50014 bytes static/img/v2/editor-media.png | Bin 0 -> 170832 bytes static/img/v2/editor-media.webp | Bin 0 -> 70372 bytes static/img/v2/editor-multiselect.webp | Bin 0 -> 89512 bytes static/img/v2/editor-scale-100.webp | Bin 0 -> 58954 bytes static/img/v2/editor-scale-150.webp | Bin 0 -> 99444 bytes static/img/v2/editor-start.png | Bin 0 -> 122589 bytes static/img/v2/editor-start.webp | Bin 0 -> 51528 bytes static/img/v2/editor-timeline.png | Bin 0 -> 113217 bytes static/img/v2/editor-timeline.webp | Bin 0 -> 63052 bytes static/img/v2/editor-titles.png | Bin 0 -> 104536 bytes static/img/v2/editor-titles.webp | Bin 0 -> 48850 bytes static/img/v2/editor-viewer.png | Bin 0 -> 177527 bytes static/img/v2/editor-viewer.webp | Bin 0 -> 72712 bytes static/img/v2/favicon-32.png | Bin 0 -> 1697 bytes static/img/v2/logo.png | Bin 0 -> 26541 bytes static/img/v2/media-fit-modes.webp | Bin 0 -> 31800 bytes static/img/v2/subtitles.png | Bin 0 -> 97498 bytes static/img/v2/subtitles.webp | Bin 0 -> 54198 bytes 60 files changed, 4322 insertions(+), 29 deletions(-) create mode 100644 docs/v2/architecture.md create mode 100644 docs/v2/captions-and-automation.md create mode 100644 docs/v2/cli.md create mode 100644 docs/v2/editor.md create mode 100644 docs/v2/getting-started.md create mode 100644 docs/v2/install.md create mode 100644 docs/v2/keyboard-shortcuts.md create mode 100644 docs/v2/math-objects.md create mode 100644 docs/v2/mcp.md create mode 100644 docs/v2/migrating-from-v1.md create mode 100644 docs/v2/plugins.md create mode 100644 scripts/sync-v2-docs.mjs create mode 100644 static/img/v2/editor-auto-reframe.png create mode 100644 static/img/v2/editor-auto-reframe.webp create mode 100644 static/img/v2/editor-autocut.png create mode 100644 static/img/v2/editor-autocut.webp create mode 100644 static/img/v2/editor-effect-warning.webp create mode 100644 static/img/v2/editor-export-queue.png create mode 100644 static/img/v2/editor-export-queue.webp create mode 100644 static/img/v2/editor-export.webp create mode 100644 static/img/v2/editor-main.png create mode 100644 static/img/v2/editor-main.webp create mode 100644 static/img/v2/editor-markers.png create mode 100644 static/img/v2/editor-markers.webp create mode 100644 static/img/v2/editor-math-dialog.png create mode 100644 static/img/v2/editor-math-dialog.webp create mode 100644 static/img/v2/editor-math-panel.png create mode 100644 static/img/v2/editor-math-panel.webp create mode 100644 static/img/v2/editor-media-fit.webp create mode 100644 static/img/v2/editor-media.png create mode 100644 static/img/v2/editor-media.webp create mode 100644 static/img/v2/editor-multiselect.webp create mode 100644 static/img/v2/editor-scale-100.webp create mode 100644 static/img/v2/editor-scale-150.webp create mode 100644 static/img/v2/editor-start.png create mode 100644 static/img/v2/editor-start.webp create mode 100644 static/img/v2/editor-timeline.png create mode 100644 static/img/v2/editor-timeline.webp create mode 100644 static/img/v2/editor-titles.png create mode 100644 static/img/v2/editor-titles.webp create mode 100644 static/img/v2/editor-viewer.png create mode 100644 static/img/v2/editor-viewer.webp create mode 100644 static/img/v2/favicon-32.png create mode 100644 static/img/v2/logo.png create mode 100644 static/img/v2/media-fit-modes.webp create mode 100644 static/img/v2/subtitles.png create mode 100644 static/img/v2/subtitles.webp diff --git a/docs/getting-started.md b/docs/getting-started.md index 7afb510..0e4da11 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -4,6 +4,10 @@ sidebar_position: 1 # Getting Started with AniMathIO +:::caution Legacy documentation +This page describes AniMathIO 1.x (the Electron app). For AniMathIO 2.0, start with the [2.0 documentation](/docs/v2/getting-started). +::: + Let's discover **AniMathIO in less than 5 minutes** - your tool for creating mathematical videos without coding. ## Installation diff --git a/docs/tutorial-advanced/ai-agent-integration.md b/docs/tutorial-advanced/ai-agent-integration.md index 95c9781..71c83c4 100644 --- a/docs/tutorial-advanced/ai-agent-integration.md +++ b/docs/tutorial-advanced/ai-agent-integration.md @@ -4,6 +4,10 @@ sidebar_position: 4 # AI Agent Integration +:::caution Legacy documentation +This page describes AniMathIO 1.x (the Electron app). For AniMathIO 2.0, start with the [2.0 documentation](/docs/v2/getting-started). +::: + AniMathIO's MCP server lets an AI agent work directly in your editor. MCP (Model Context Protocol) is an open standard that lets agents call tools. Connect Claude Code, Claude Desktop, or another MCP-capable client to add text and equations, import Manim scripts and media files, create animations, and export finished videos — while you watch the changes appear live on the canvas. For example, you could ask Claude: diff --git a/docs/tutorial-advanced/complex-animations.md b/docs/tutorial-advanced/complex-animations.md index 9d44145..b29f6f3 100644 --- a/docs/tutorial-advanced/complex-animations.md +++ b/docs/tutorial-advanced/complex-animations.md @@ -4,6 +4,10 @@ sidebar_position: 1 # Creating Complex Animations +:::caution Legacy documentation +This page describes AniMathIO 1.x (the Electron app). For AniMathIO 2.0, start with the [2.0 documentation](/docs/v2/getting-started). +::: + While basic animations in AniMathIO are straightforward, creating complex, multi-stage animations requires some planning and advanced techniques. This guide will help you create sophisticated mathematical animations that build up concepts step by step. ## Understanding Animation Types in AniMathIO diff --git a/docs/tutorial-advanced/conclusion.md b/docs/tutorial-advanced/conclusion.md index 7859ee6..4956b7d 100644 --- a/docs/tutorial-advanced/conclusion.md +++ b/docs/tutorial-advanced/conclusion.md @@ -4,6 +4,10 @@ sidebar_position: 5 # Conclusion: Your Journey with AniMathIO +:::caution Legacy documentation +This page describes AniMathIO 1.x (the Electron app). For AniMathIO 2.0, start with the [2.0 documentation](/docs/v2/getting-started). +::: + Congratulations on completing the AniMathIO tutorials! You've learned how to create engaging, educational mathematical animations that can help explain complex concepts visually. Let's summarize what you've accomplished and explore where to go from here. ## What You've Learned diff --git a/docs/tutorial-advanced/importing-manim-scenes.md b/docs/tutorial-advanced/importing-manim-scenes.md index 361fbbf..2e2927e 100644 --- a/docs/tutorial-advanced/importing-manim-scenes.md +++ b/docs/tutorial-advanced/importing-manim-scenes.md @@ -4,6 +4,10 @@ sidebar_position: 3 # Importing Manim Scenes +:::caution Legacy documentation +This page describes AniMathIO 1.x (the Electron app). For AniMathIO 2.0, start with the [2.0 documentation](/docs/v2/getting-started). +::: + AniMathIO can read a [Manim Community](https://www.manim.community/) Python scene and turn it into ordinary AniMathIO elements and animations on your timeline. If you already have Manim scripts, this is the fastest way to bring them into a project you can then edit visually. The import is a translation, not an emulation — AniMathIO does not run Python or Manim. It reads your script and rebuilds the equivalent elements natively, which means you can move, restyle and retime everything afterwards just like anything else you created by hand. diff --git a/docs/tutorial-advanced/working-with-multimedia.md b/docs/tutorial-advanced/working-with-multimedia.md index 5d42a02..4d1b80c 100644 --- a/docs/tutorial-advanced/working-with-multimedia.md +++ b/docs/tutorial-advanced/working-with-multimedia.md @@ -4,6 +4,10 @@ sidebar_position: 2 # Working with Multimedia +:::caution Legacy documentation +This page describes AniMathIO 1.x (the Electron app). For AniMathIO 2.0, start with the [2.0 documentation](/docs/v2/getting-started). +::: + AniMathIO allows you to enhance your mathematical animations with multimedia elements such as images, videos, and audio. This guide will show you how to incorporate these elements effectively. ## Working with Images diff --git a/docs/tutorial-basics/adding-text-and-latex.md b/docs/tutorial-basics/adding-text-and-latex.md index 9bd6387..5274b4e 100644 --- a/docs/tutorial-basics/adding-text-and-latex.md +++ b/docs/tutorial-basics/adding-text-and-latex.md @@ -4,6 +4,10 @@ sidebar_position: 4 # Adding Text and LaTeX +:::caution Legacy documentation +This page describes AniMathIO 1.x (the Electron app). For AniMathIO 2.0, start with the [2.0 documentation](/docs/v2/getting-started). +::: + Text and mathematical formulas are crucial for explaining concepts in educational videos. AniMathIO makes it easy to add both regular text and LaTeX mathematical notation to your projects. ## Adding Regular Text diff --git a/docs/tutorial-basics/exporting-your-project.md b/docs/tutorial-basics/exporting-your-project.md index d388800..bd335dc 100644 --- a/docs/tutorial-basics/exporting-your-project.md +++ b/docs/tutorial-basics/exporting-your-project.md @@ -4,6 +4,10 @@ sidebar_position: 5 # Exporting Your Project +:::caution Legacy documentation +This page describes AniMathIO 1.x (the Electron app). For AniMathIO 2.0, start with the [2.0 documentation](/docs/v2/getting-started). +::: + After creating your mathematical animation, you'll want to export it as a video file or save your project for future editing. This guide explains the export options in AniMathIO. ## Saving Your Project diff --git a/docs/tutorial-basics/managing-timeline-and-animations.md b/docs/tutorial-basics/managing-timeline-and-animations.md index 5aa7d3f..00f0c57 100644 --- a/docs/tutorial-basics/managing-timeline-and-animations.md +++ b/docs/tutorial-basics/managing-timeline-and-animations.md @@ -4,6 +4,10 @@ sidebar_position: 3 # Managing Timeline and Animations +:::caution Legacy documentation +This page describes AniMathIO 1.x (the Electron app). For AniMathIO 2.0, start with the [2.0 documentation](/docs/v2/getting-started). +::: + The timeline is where the magic happens in AniMathIO - it's where you control when elements appear, disappear, and how they animate over time. This guide will help you master timeline controls and create smooth animations. ## Understanding the Timeline diff --git a/docs/tutorial-basics/understanding-the-interface.md b/docs/tutorial-basics/understanding-the-interface.md index de98dfb..a4fd78b 100644 --- a/docs/tutorial-basics/understanding-the-interface.md +++ b/docs/tutorial-basics/understanding-the-interface.md @@ -4,6 +4,10 @@ sidebar_position: 1 # Understanding the Interface +:::caution Legacy documentation +This page describes AniMathIO 1.x (the Electron app). For AniMathIO 2.0, start with the [2.0 documentation](/docs/v2/getting-started). +::: + Let's explore the AniMathIO interface to help you navigate and use the software effectively. ## Main Layout diff --git a/docs/tutorial-basics/working-with-mathematical-components.md b/docs/tutorial-basics/working-with-mathematical-components.md index 6cae784..dbfcef4 100644 --- a/docs/tutorial-basics/working-with-mathematical-components.md +++ b/docs/tutorial-basics/working-with-mathematical-components.md @@ -4,6 +4,10 @@ sidebar_position: 2 # Working with Mathematical Components +:::caution Legacy documentation +This page describes AniMathIO 1.x (the Electron app). For AniMathIO 2.0, start with the [2.0 documentation](/docs/v2/getting-started). +::: + Mathematical components are the building blocks of your animations in AniMathIO. This guide will walk you through adding and customizing these components. ## Accessing Mathematical Components diff --git a/docs/v2/architecture.md b/docs/v2/architecture.md new file mode 100644 index 0000000..821e9f1 --- /dev/null +++ b/docs/v2/architecture.md @@ -0,0 +1,865 @@ +--- +title: "Architecture" +sidebar_label: "Architecture" +sidebar_position: 10 +description: "Crate map, layering, the time model and the data flow." +--- + + + +# Architecture + +This document describes the 2.0 crate map, the layering rules, the time model and +the render/audio/export data flow. The authority for these rules is +[issue #156](https://github.com/AniMathIO/AniMathIO/issues/156). + +## Crate map + +| Crate | Owns | +| --- | --- | +| `core` | Plain project data (`Project`, `Track`, `Clip`, `ClipKind`, `Transform`, `Animation`), exact timeline arithmetic (`Time`, `FrameRate`), the `Command` mutation API with undo/redo, and pure `evaluate(&Project, Time) -> Scene`. Effects are plain data (`EffectInstance`: plugin id + effect id + numeric params); the `EffectProcessor` port is how the renderer asks a plugin host to run one. **No IO, GPU, decoder or UI dependencies.** | +| `format` | Versioned `project.json` (schema version 7) and content-addressed `.amio` ZIP containers. Stream APIs support custom storage; filesystem save helpers validate and atomically replace targets using synced temporary files in the same directory. | +| `render` | Deterministic, GPU-free Vello CPU backend (the reference for tests and export), the clip-effect chain mechanics (rasterize a clip layer, hand each effect to the context's `EffectProcessor`, composite), an optional `gpu` feature with a Vello/wgpu `GpuBackend` for preview, embedded font shaping, the engine `ResourcePool`, `Frame` (RGBA8), PNG encoding and PNG/JPEG decoding. Also the shared `sample` demo project and the `FrameSource` video seam. | +| `audio` | Engine-owned audio pools (one seekable `PcmReader` per asset; nothing holds a whole decoded asset), lazy block-wise resampling and channel mapping behind an LRU-budgeted cache, immutable mixer snapshots, Opus/Symphonia decoding, and cpal/rtrb device playback. No audio resources live in `Project`. Also pure offline beat detection (`detect_beats`). | +| `media` | FilmCraft decode behind the `MediaBackend` trait (probe, frame-exact video seek, audio PCM), an LRU-budgeted engine `MediaPool` with prefetch, and the H.264 + AAC `Mp4Encoder` (BT.709-tagged). Untrusted-input limits (dimensions, frame counts, rates, checked arithmetic) are enforced before codec work. | +| `export` | Deterministic offline MP4 export: steps `render(evaluate(project, t))` frame by frame plus the audio mixer, encoded with `Mp4Encoder`. Never a recording of playback. | +| `transcribe` | Local automatic subtitles: whisper.cpp speech recognition behind the opt-in `whisper` cargo feature (whisper.cpp through the whisper-rs bindings; needs cmake, a C++ toolchain and libclang), on-demand SHA-256-verified model downloads with resumable atomic writes, 16 kHz mono audio preparation on top of `audio`, pure cue splitting (line/duration/overlap rules) and SRT/WebVTT reading and writing. Everything but the engine works without the feature. | +| `control` | Local JSON-RPC 2.0 control protocol over a user-only socket/named pipe: methods (including `export`), token auth, headless handler and client. | +| `plugin-api` | The WIT world (`crates/plugin-api/wit/plugin.wit`), the `plugin.toml` manifest format, `.amplugin` package (zip of `plugin.toml` + `plugin.wasm`), the inspector schema, guest SDK and first-party clip authoring helpers (`sources`). | +| `plugin-host` | wasmtime Component Model runtime: loading/compiling plugins, the sandbox (fuel, epoch, memory, output caps), host imports (shape-text, svg-to-paths, typeset-math, limits, log, and `read-sibling` for importers), ABI 1.1.0 (1.0.0 components load unchanged) plus an explicit 0.2.x adapter, plugin scene resolution, pixel-effect plugins (`PluginHost::effects`, `effect_processor`: instance-pre cached components, a fresh fuel/memory/epoch-limited store per call, frame-size caps), animation presets (`PluginHost::animation_presets`, `animation_preset_command`) and importers (`PluginHost::importers`, `PluginHost::import`). | +| `typeset` | Host-side math typesetting: Typst as a library plus MiTeX for LaTeX→Typst conversion, turned into vector path outlines plus a tight bbox. | +| `import-v1` | One-way importer for v1 `.animathio` projects (deflated JSON + base64 media). Still native (see "Importers" below). | +| `import-manim` | One-way importer for Manim Community scene scripts (`.py`), parsed with a small pure-Rust Python parser (`pyparse`) whose node vocabulary follows tree-sitter-python. The app runs it only inside the `org.animathio.import-manim` importer plugin. | +| `apps/animathio-cli` | Headless validation, PNG rendering, MP4 export, importers and the MCP sidecar. | +| `apps/animathio` | The GPUI desktop editor: a thin view over the command-only core, plus an export worker and dialog. | +| `plugins/*` | Standalone first-party WebAssembly plugins: `shapes`, `text`, `latex`, `graph`, `effects-basic`, `audio-basic`, `animations` (animation presets), `import-manim` (Manim importer), `trap` (sandbox fixture), and `examples/hello`. | + +Video clips decode through `render::FrameSource` via the `media` crate's +`MediaPool`, so real video frames appear in preview, the CLI and headless +renders. `export` encodes MP4 (H.264 + AAC, BT.709-tagged) offline. WebM export +and an FFmpeg fallback backend remain future work; `MediaBackend` is shaped so a +second backend can be added without touching callers. + +## Layering + +Dependencies point inward. The core owns its domain types and exposes no +`&mut` outside command application; the UI and control layers change state only +through `Command`s. + +```mermaid +flowchart TD + UI[apps/animathio · apps/animathio-cli] --> CTL[control] + CTL --> IMP[import-v1] + CTL --> RENDER[render] + CTL --> AUDIO[audio] + CTL --> EXPORT[export] + RENDER --> MEDIA[media] + EXPORT --> RENDER + EXPORT --> MEDIA + EXPORT --> AUDIO + MEDIA --> AUDIO + IMP --> FORMAT[format] + CTL --> FORMAT + FORMAT --> CORE[core] + AUDIO --> CORE + MEDIA --> CORE + RENDER --> CORE + EXPORT --> CORE + CTL --> HOST[plugin-host] + HOST --> API[plugin-api · WIT/SDK] + HOST --> TYPESET[typeset] + HOST --> CORE + TYPESET --> CORE +``` + +`render` and `export` share `media`; `export` additionally uses `audio`'s mixer +and `render`'s rasterizer, and `media` reuses `audio`'s Symphonia decode for +non-indexed audio assets. Every crate bottoms out in `core`. + +Rules that keep the layers honest: + +- `core` has no IO/GPU/decoder deps. `Project` contains no runtime resources. +- `format`, `render`, `audio`, `media`, `export`, `import-v1`, `import-manim`, + `control` and `plugin-host` all depend on `core` and never the reverse. +- `control` sits above `format`/`render`/`export`/`import-v1` so the MCP sidecar + can load, mutate, render, export and import headlessly without the editor. + Manim import and animation presets reach `control` only through `plugin-host`; + `import-manim` is compiled into the `plugins/import-manim` component, not linked + into the apps. +- Third-party crates (FilmCraft, vello, GPUI) stay behind adapter boundaries; + no third-party type leaks into `core`. + +## Desktop editor foundations + +`editor_env.rs` supplies production defaults and a headless test environment (monotonic +playback clock, CPU preview, built plugins or no plugins, private settings/cache paths). +`editor/ui_tests` mounts the real editor in gpui's test window and exercises actions and +shared panel handlers, asserting project and view state without devices or pixel snapshots. + + +`apps/animathio/src/editor.rs` owns view state and composes implementation modules +under `editor/`: `menus`, `workspace`, `viewer`, `transport`, `timeline_view`, +`fields`, `audio_effects` (inspector audio-effect cards), `animations` (the inspector +Animations section and the Effects-tab preset library), `video_effects` (inspector video-effect cards), `inspector_view`, `media_pool`, `math` (Math tab, typed object dialog and inspector), `titles` (Titles tab), `dialogs`, `export_panel` +(export queue popover), `start_screen`, `templates`, `clip_ops`, `commands`, `project_io`, +`control_bridge`, `playback_glue`, `timeline_thumbnails` and `actions`. Shared drawing/resource helpers live in +`support`; `color_edit` owns the live-preview transaction (colour pickers, sliders, +number scrubbing and the viewer's transform gizmo all preview through it, so one +gesture is one history entry). The gizmo maths in `viewer` shares the renderer's +canvas mapping and builds its edit with `inspector::transform_edit_commands`, which +merges plain properties into one `SetTransform` and keyframes animated ones. `editing.rs` holds pure +shuttle, in/out, blade and ripple command planning. In/out points and tool mode stay +in view state. Ripple trim uses one `Command::Batch` on the source track; +Shift+Delete uses `RippleDelete`. The ruler and export range share half-open bounds. +The audio device clock stays master at every shuttle speed; with no output device a signed +monotonic clock stands in. + +Audible shuttle lives in `crates/audio` (`Speed`, `BlockGenerator`, `varispeed`). +`Player::set_speed` restarts the session at the latency-corrected position like a seek. +Timeline painting uses GPUI canvas quads/paths and culls clips before building +labels or requesting previews. A separate `timeline_thumbnails` worker decodes +five source-time samples per visible video clip, resizes them to low-resolution +BGRA tiles and repeats one tile for still images. Keys include asset, source time +and track height; the queue holds 16 requests and the UI retains at most 256 tiles. +The worker keeps at most eight video decoders and eight small still images. +Waveforms reuse the editor's cached 4096-peak audio summaries and a bounded cache +of 128 paint-ready paths, invalidated by clip geometry, zoom, scroll or window +position changes. These resources +never enter the project model. The overview uses only lightweight clip ranges; +zoom interpolates view state over the design token's 180ms motion duration. + +The mixer worker (never the device callback) renders blocks: it mixes the timeline span a +block covers and resamples it by the signed rate with linear interpolation, carrying the +fractional position so blocks join seamlessly. Negative speeds read backwards, so the block +is the reversed PCM. Forward up to 8x and reverse up to 4x are audible (pitch follows +speed); faster rates push silence. The callback's clock is `origin + frames * speed` +computed with a rational speed (reverse counts down), so video stays exact at each rate. +Half-speed K+J/K+L jog uses `Speed::HALF`. + +Exports run through `export_queue`: each job owns a project snapshot, jobs run sequentially +on the export worker (`crates/export` honours the cancel flag through its progress +callback and leaves no partial file), and the editor polls the queue to drive the Export +queue popover and toasts. Control-protocol exports appear in the same queue. + +`start_screen` provides project presets, recents and importer entry points. +`templates` supplies launcher cards, the placeholder fill dialog and user-library save/delete. +Template manifests stay outside the project schema; source replacements are ordinary +undoable command batches. Media fitting uses the typed `Clip::fit` field in both +rendering backends. Workflow +dialogs use gpui-component forms; export works on an immutable snapshot, so selecting +a delivery preset does not change the open project. `control::ExportPreset` is the +shared table for editor, CLI and MCP. Preferences persist under the application +config directory (`preferences.json`, renderer selection in `preview.json`) and +never enter project serialization. + +The `actions` module registers GPUI actions and a contextual keymap (`Editor`, +`Timeline`, `Viewer`, `Inspector`, `MediaPool`). `secondary-` bindings are resolved +with GPUI's OS-aware loader: Cmd on macOS and Ctrl elsewhere. App menus and button +tooltips read hints from those bindings. Text and numeric inputs own their editing +keys, clipboard, selection and IME; timeline Delete/Space never intercept a focused +input. The Help menu opens the shortcut reference. + +The workspace uses horizontal and vertical resizable panel groups. Sizes, visibility +and S/M/L track density (28/44/72 logical pixels) persist in `dock-layout.json` under +the application config directory. Older files default to medium tracks. Headers and +clips share a vertical scroll surface, so every track remains accessible. Wheel +scrolls vertically; Alt+wheel scrolls horizontally; Ctrl/Cmd+wheel zooms. + +Chrome uses the active dark theme, a 12 px base and monospaced timecodes. A single +custom title bar hosts the application menus, project/dirty state, control-server +status and Export. The status bar contains project output settings, duration and +autosave age. Transient errors, information and successful work use typed +notifications hosted by `Root`. + +A colour drag applies `Command`s for immediate preview. On pointer release, it +restores the original value with the inverse command and records the final command +once in `History`. Other commands and control calls finish a pending drag first, +so a colour change undoes in one step without swallowing adjacent edits. Asset +parameter selectors display names but commit asset identities (or `null` for None). + +## Time model (integer ticks) + +AniMathIO 2.0 uses **integer ticks** at a fixed rate, with **rational frame rates** +on top. The rate is 705,600,000 ticks per second — the *flicks* constant, chosen so +frame and audio-sample boundaries are always exact: + +```text +TICKS_PER_SECOND = 705_600_000 +``` + +It is divisible by 24, 25, 30, 50, 60, 120, the NTSC numerators 24000/30000/60000/ +120000 (so 23.976, 29.97, 59.94 and 119.88 fps are exact), and the audio rates +44100/48000/96000/192000. An `i64` of ticks still spans over 400 years in either +direction. Code and CLI flags call the unit "ticks"; the underlying rate is the +flicks rate. + +- `Time(i64)` — a signed tick position. Negative values are allowed for intermediate math. +- `FrameRate { numerator, denominator }` — a positive, reduced rational rate. + `frame_to_time(frame, rounding)` and `time_to_frame(time, rounding)` convert with + an explicit `Rounding` policy (`Floor`, `Ceil`, `Nearest`) so rational frame + boundaries that fall between ticks are never silently rounded. +- `TimeRange { start, end }` — a half-open `[start, end)` nonnegative interval. + +The `core` model stores no `f64` seconds and no absolute pixels. `Transform` is +resolution-independent (position/scale are fractions of the canvas, rotation is +radians, opacity is `[0, 1]`). Pixel conversion happens only at the render/UI +boundary. + +## Engine rules from #156 + +Each rule exists because of a specific v1 failure, and each is enforced by a test. + +| v1 failure | 2.0 rule | Enforced by | +| --- | --- | --- | +| Live Konva nodes, `