6.6 KiB
Tasks: Markdown slides mode (roadmap 41; replaces 19)
Spec: spec.md. One task = one agent. No new crate, Cargo registration, third-party dependency or browser runtime.
First tool call rule: batch needed reads in first call; write first OWNS source file in SECOND tool call, compiling stub plus one failing test, then make it pass.
Standing VERIFY: export PATH="$HOME/.cargo/bin:$PATH"; cargo test -p <owned package>; cargo clippy -p <owned package> --all-targets -- -D warnings; rustfmt --edition 2024 <owned Rust files>; UI adds cargo xtask i18n; final phase adds cargo xtask layers and cargo xtask tree. Future implementation checks only, no Cargo during spec authoring.
Standing DO NOT: edit outside OWNS, mutate git, add dependencies/Cargo changes, unchecked source slicing/panics/blanket allows, cargo fmt --all, source rewriting or second independent rank-19 implementation.
Phase 1 — pure deck model
- 1. Lossless Markdown slide ranges.
OWNS:
crates/markdown/src/slides.rs(new, FIRST; unit tests inside),crates/markdown/src/lib.rs(module and exports),crates/markdown/src/error.rs(narrow deck-size error if needed). FILES TO OPEN:spec.mdD1,crates/markdown/src/lib.rs,crates/markdown/src/frontmatter/mod.rs,crates/markdown/src/scanning/fences.rs,crates/markdown/src/scanning/common.rs,crates/markdown/Cargo.toml(read only, existing pulldown-cmark). GOAL:Deck,Slide,parse_deck(&str) -> Result<Deck>with D1 eligible root thematic-break events, exact source ranges, protected-region handling and byte/slide caps. TESTS: frontmatter, setext, root---, quoted/list/indented breaks,***/----, fenced/inline code, comments/math/HTML, unclosed fence/comment, CRLF, Unicode, empty note/frontmatter-only, leading/trailing/repeated valid boundaries, no-final-newline, 500/501 slides, 2 MiB/+1 bytes. Assert original source untouched and every rangegetsucceeds. VERIFY: standing-p notescraft-markdown, filterslides, confirm tests run via module declaration. DO NOT: engine/UI/IO, split raw text on---, add parser dependency.
Phase 2 — shared engine presentation
- 2. Bounded session snapshot and commands.
OWNS:
crates/engine/src/slides/state.rs(new, FIRST),crates/engine/src/slides/mod.rs(new),crates/engine/src/slides/commands.rs(new),crates/engine/src/lib.rs,crates/engine/src/vault/session.rs(presentation field, initialization and accessor),crates/engine/src/commands.rs(one register call),crates/engine/src/ai/assistant_gate.rs,crates/engine/tests/core_commands.rs,crates/engine/tests/slides.rs(new). FILES TO OPEN: D2,crates/engine/src/vault/buffers.rs,crates/engine/src/capture/mod.rs,crates/engine/tests/common/mod.rs,crates/engine/src/control/protocol.rs. GOAL: D2 exact start/status/goto/stop table, guarded path and current buffer snapshot, immutable bounded deck, generation and UI accessor; start/goto/stop use existing WRITE-class gate while status READ; preserve existing grant/review behavior and refuse unsupported previews. Read-only presentation allowed. TESTS: registry/control dispatch same status, dirty unsaved source takes priority, invalid path/index/deck leaves active state unchanged, navigation boundaries errors, stop twice, snapshot stays fixed until restart, read-only success, no disk/buffer/undo mutations, session close releases state. VERIFY: standing-p notescraft-engine,--test slides --test core_commandsplus existing control tests. DO NOT: store egui types below L5, fullscreen/window IO, serialize full source on status, write any file during navigation, bypass assistant review or invent a separate permission system.
Phase 3 — native presentation surface
- 3. Slide viewport and deterministic controls.
OWNS:
crates/ui-egui/src/views/slides_view/mod.rs(new, FIRST),crates/ui-egui/src/views/slides_view/controls.rs(new),crates/ui-egui/src/views/mod.rs,crates/ui-egui/src/text/views/slides.rs(new),crates/ui-egui/src/text/views/mod.rs,[ui.slides]at END ofcrates/i18n/locales/en.toml,crates/ui-egui/tests/slides_view.rs(new). FILES TO OPEN: D3,crates/ui-egui/src/views/note_view.rs(show_body_with_fences,BodyHooks),crates/ui-egui/src/views/note_view/blocks/embed.rs,crates/ui-egui/src/views/media_view/bar.rs,crates/ui-egui/src/design/style.rs. GOAL: read-only native slide paint using supplied snapshot, origin-relative assets, themed 16:9 viewport and tall-slide scrolling; controls return bounded navigation/stop/restart intents for shell. No engine calls in paint. TESTS: kittest arrows disabled at bounds, current/total, tall slide scroll/reset, read-only task/transclusion clicks, origin-relative image/missing asset and code/table/math; Mocha/Latte standalone view snapshots. VERIFY: standing-p notescraft-ui-egui, i18n and read snapshot PNGs. DO NOT: task edits/source mutations, remote fetch during paint, raw hardcoded UI strings, introduce another Markdown renderer or webview. - 4. Shell entry/exit, focus/fullscreen and completion gates.
OWNS:
crates/ui-egui/src/shell/app/window/views.rs(FIRST),crates/ui-egui/src/shell/app/window/frame.rs,crates/ui-egui/src/shell/app/window/commands.rs,crates/ui-egui/src/shell/app/window/menus.rs,crates/ui-egui/src/shell/hotkeys/dispatch.rs,crates/ui-egui/src/shell/hotkeys/commands.rs,crates/ui-egui/tests/slides_shell.rs(new),SPEC.md(6.1 status only after completion),ROADMAP.md,docs/ARCHITECTURE.md,docs/CODE-MAP.md, ranks 19/41 inspecs/plugins-parity/roadmap.md. FILES TO OPEN: D2/D3, current window frame/view state,crates/ui-egui/src/shell/hotkeys/defaults.rs,crates/ui-egui/src/shell/hotkeys/focus.rs, task 2 session accessor and task 3 view API. GOAL: palette/tab-menu entry, observe shared session presentation generation, consume active-only navigation once, restore tab/pane/editor selection/scroll/panels/fullscreen on exit; explicit restart refreshes source. Control-channel start reaches same surface. Mark rank19 superseded by41, never duplicate completion counts. TESTS: kittest start/navigate/exit, Space consumed once, modal/input owns keys, boundary no goto error toast, prior fullscreen true/false restoration, dirty editor unchanged, external source mutation/restart, close/switch vault clears state; offscreen view plus manual OS fullscreen smoke check. VERIFY: standing engine/UI pluscargo xtask ci; read 1440x900, narrow and 2x Mocha/Latte PNGs; record manual platform checks still unavailable instead of claiming them passed. DO NOT: register global shortcut, persist hidden chrome to workspace, broaden native menus or update completed status before gates.