4.1 KiB
4.1 KiB
Tasks: media timestamp links (roadmap 28)
One task = one agent (specs/agents/opencode-runbook.md). Spec: spec.md. Rules: AGENTS.md, docs/CODE-MAP.md. No new crate.
First tool call rule: after at most three reads, write the first OWNS file in your SECOND tool call (compiling stub + ONE failing test), then make it pass.
Standing VERIFY: export PATH="$HOME/.cargo/bin:$PATH"; cargo test -p <pkg>; cargo clippy -p <pkg> --all-targets -- -D warnings; rustfmt --edition 2024 <owned files>; UI tasks add cargo xtask i18n; last task adds cargo xtask layers and cargo xtask tree.
Standing DO NOT: edit Cargo files, files outside OWNS, git state, cargo fmt --all; add allow; unwrap/expect/panic/[i]/[a..b] on input-derived data; add a dependency.
Phase 1 - pure parser
- 1.
parse_time_fragment,format_time(briefbriefs/15-time-fragment-parser.md). OWNS:crates/markdown/src/timefrag.rs, onemod timefrag;+pub use timefrag::{TimeFragment, parse_time_fragment, format_time};incrates/markdown/src/lib.rs,crates/markdown/tests/timefrag.rs. FILES TO OPEN:spec.mdD1,crates/markdown/src/links.rs(LinkTarget,parse_link_target),crates/markdown/src/lib.rs:40-50(exports). GOAL / TESTS / VERIFY: see the brief. DO NOT: changeparse_link_target. - 2. Lint and index ignore valid
t=subpaths on media targets. OWNS:crates/index/src/lookup/resolve.rs(only the anchor check),crates/lint/src/(the broken-anchor rule file: find withgit grep -n "anchor" crates/lint/src),crates/index/tests/media_anchor.rsorcrates/lint/tests/media_anchor.rs. FILES TO OPEN:spec.mdD2,crates/index/src/lookup/resolve.rs,crates/markdown/src/links.rs(anchors_match). GOAL: valid fragment on a file whose extension is audio/video is never an anchor error; real missing heading still is. Share the extension list through apub const MEDIA_EXTSintimefrag.rsONLY if task 1 exported it, else duplicate with a// keep in sync with widgets/tabs/kind.rscomment. TESTS: rec.mp3#t=04:12 clean; note.md#t=04:12 still an anchor error; rec.mp3#Heading error; rename keeps suffix. VERIFY: standing for the crates touched. DO NOT: change the link model.
Phase 2 - UI
- 3. Click starts playback at the offset (audio first).
OWNS:
crates/ui-egui/src/shell/app/media_links.rs(new: purefn command_for_link(target, root) -> Option<AudioCommand>), one call in the link-open path (list the line for the lead),crates/ui-egui/tests/media_links.rs. FILES TO OPEN:spec.mdD3,crates/ui-egui/src/views/media_view/audio/bus.rs(AudioCommand,commands_id),crates/ui-egui/src/views/note_view.rs:150-165,git grep -n "open_file\|link" crates/ui-egui/src/shell/app/window/frame.rs. GOAL: link with valid fragment on an audio file opens the Audio tab and queuesPlay{from}; invalid fragment opens only. TESTS: pure function table (valid, invalid, video returns None until task 5, path traversal../x.mp3#t=1None); kittest: click queues command. VERIFY: standing. DO NOT: restart a player already on that file at that time every frame. - 4. Embed start offset, copy/insert timestamp link, display label.
OWNS:
crates/ui-egui/src/views/media_view/audio/embed.rs,crates/ui-egui/src/views/media_view/bar.rs(one button),crates/ui-egui/src/shell/hotkeys/commands.rs(palette entry),crates/ui-egui/src/text/views/media strings file +en.tomlkeys at END of the media table,crates/ui-egui/tests/media_timestamp_ui.rs. FILES TO OPEN: those files,crates/ui-egui/src/views/note_view/lines.rs:179(embed_label). GOAL: spec goals 2, 3, 4. TESTS: copy at 125.4 s ->[[rec.mp3#t=2:05]]; embed with fragment plays from offset; labelrec.mp3 @ 4:12. VERIFY: standing +cargo xtask i18n. DO NOT: hardcode strings; raw buttons. - 5. Video seek (Q2), docs. OWNS:
crates/ui-egui/src/shell/app/video.rs(start offset),crates/ui-egui/src/shell/app/media_links.rs(video arm),ROADMAP.md,docs/ARCHITECTURE.md,docs/CODE-MAP.md,specs/plugins-parity/roadmap.md(mark 28). VERIFY:cargo xtask ci.