Files
Marcos Paulo b32650767c
ci / ci (macos-latest) (push) Has been cancelled
ci / ci (ubuntu-latest) (push) Has been cancelled
ci / ci (windows-latest) (push) Has been cancelled
docs: specs and briefs for smart folders, version diff, media timestamps, clean paste, link cards, spaced repetition
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-21 12:18:00 -03:00

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 (brief briefs/15-time-fragment-parser.md). OWNS: crates/markdown/src/timefrag.rs, one mod timefrag; + pub use timefrag::{TimeFragment, parse_time_fragment, format_time}; in crates/markdown/src/lib.rs, crates/markdown/tests/timefrag.rs. FILES TO OPEN: spec.md D1, 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: change parse_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 with git grep -n "anchor" crates/lint/src), crates/index/tests/media_anchor.rs or crates/lint/tests/media_anchor.rs. FILES TO OPEN: spec.md D2, 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 a pub const MEDIA_EXTS in timefrag.rs ONLY if task 1 exported it, else duplicate with a // keep in sync with widgets/tabs/kind.rs comment. 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: pure fn 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.md D3, 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 queues Play{from}; invalid fragment opens only. TESTS: pure function table (valid, invalid, video returns None until task 5, path traversal ../x.mp3#t=1 None); 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.toml keys 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; label rec.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.