Files
Marcos Paulo de3ec375ae
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 Tasks, Templater, Kanban and icons/banners
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-21 06:06:54 -03:00

9.5 KiB

Tasks: icons and banners from properties (roadmap item 16)

One task = one agent's work (OpenCode brief template, specs/agents/opencode-runbook.md). [ ] open. Spec: spec.md (D-numbers point into it). Rules for every task: AGENTS.md, docs/CODE-MAP.md. No new crate: the resolver lives in notescraft-index (L1), the rest in engine and ui-egui.

First tool call rule: after at most three reads, your FIRST write is the first OWNS file: a compiling stub with the signatures from GOAL and ONE failing test. Then make it pass. Do not explore the repo.

Standing VERIFY: cargo test -p <pkg> ; cargo clippy -p <pkg> --all-targets -- -D warnings ; rustfmt --edition 2024 <owned files>. UI/i18n tasks add cargo xtask i18n; the last task of a phase adds cargo xtask layers and cargo xtask tree. Always export PATH="$HOME/.cargo/bin:$PATH". Standing DO NOT: edit Cargo.toml/Cargo.lock, files outside OWNS, git state, cargo fmt --all; add allow attributes; use unwrap/expect/panic/[i]/[a..b] on input-derived data; add a dependency.

Owner/lead step 0 (not an agent task)

Answer Q1 (a real Iconize note: paste its frontmatter into the spec), Q2 and Q3 (catalogue size). Check cargo xtask tree headroom: crates/index/src/ must stay at 12 loose files or fewer after decor.rs (list the count in the report if it is 12; the agent adds the file under crates/index/src/decor/ if so).

Phase 1 - pure resolver

  • 1. Parse icon, iconColor, banner* into Decor (brief briefs/12-icon-property-resolver.md). OWNS: crates/index/src/decor.rs, crates/index/src/lib.rs (one mod decor; + pub use), crates/index/tests/decor.rs. FILES TO OPEN: spec.md D1 and D2, crates/index/src/props.rs (the property value type and note_props), crates/index/src/lib.rs. GOAL: IconRef, ColorRef, BannerRef, BannerTarget, Decor, pub fn parse_icon(&str) -> Option<IconRef>, pub fn parse_color(&str) -> Option<ColorRef>, pub fn decor_from_props(props, keys: &DecorKeys) -> Decor where DecorKeys { icon, color, banner } carry the configurable property names (defaults per D3). TESTS: LiRocket, lucide-rocket, rocket, Rocket, LiArrowRight normalise; emoji (🚀, 👩‍💻, ❤️); [[icons/star.svg]], icons/star.png; #f80, #ff8800, accent; bad colour #12 is None; banner wikilink, ![[x.jpg]], path, https URL (Url target), quoted; banner_y 0.2 parsed, "0.2" string parsed, -1 and NaN ignored (default 0.5); 2 KiB value ignored; banner_icon used only when icon is absent. VERIFY: standing, -p notescraft-index. DO NOT: touch index data structures; read files.

Phase 2 - engine

  • 2. decor.list, decor.set and settings. OWNS: crates/engine/src/decor/mod.rs, .../commands.rs, .../resolve.rs, one mod decor; in crates/engine/src/lib.rs, one register_decor(reg) call in crates/engine/src/commands.rs::register_core, crates/engine/src/prefs/decor_config.rs, crates/engine/src/prefs/catalog/ (listing entries), crates/engine/src/ai/assistant_gate.rs, crates/engine/tests/core_commands.rs (CORE_IDS), crates/engine/tests/decor.rs. FILES TO OPEN: spec.md D3, crates/engine/src/bases/commands.rs (group to copy), crates/engine/src/vault/properties.rs (set), crates/engine/src/builtin/properties_commands.rs, crates/engine/src/prefs/files_config.rs + crates/engine/tests/files_config_viewers.rs, crates/engine/src/vault/folders.rs (folder note name). GOAL: D3 exactly; cache keyed by index generation; folder icon from folder note; banner target resolved with the wiki link resolver (find it in crates/engine/src/vault/ before writing one). There is no decor.icons command: the catalogue lives in ui-egui and the picker reads it directly. TESTS: decor.rs on a TempVault: icon note listed, undecorated omitted, folder note icon on the folder, banner [[cover.jpg]] resolves to assets/cover.jpg, https banner returned as url not path, decor.set writes icon: with the body byte-identical, null removes the key, open buffer gets one undo step, custom property names setting honoured, out-of-range banner_height rejected, read-only refuses set, no network (no HTTP code reachable). VERIFY: standing for notescraft-engine + --test decor --test core_commands. DO NOT: add a per-note IO read (use the index props); touch the UI.

Phase 3 - UI (lead wires the dispatch lines; each task is a small file plus one hook)

  • 3. Icon painter, Lucide catalogue and the decor snapshot. OWNS: crates/ui-egui/src/design/note_icon.rs, crates/ui-egui/src/design/icon_catalogue.rs, crates/ui-egui/assets/icons/lucide/*.svg (about 250 files, ISC licence header kept), crates/ui-egui/src/shell/app/decor.rs (snapshot in egui memory, refresh on index generation), crates/ui-egui/tests/note_icon.rs. FILES TO OPEN: crates/ui-egui/src/design/icons.rs (icon!, paint), crates/ui-egui/src/views/base_view/layouts/cover.rs (bounded texture cache pattern), crates/ui-egui/src/shell/app/window/commands.rs (engine_command). GOAL: pub fn paint(ui, &IconRef, rect, tint: Color32); Catalogue::get(name) -> Option<&[u8]> and names(); File icons decode off the UI thread into a 256-entry cache; DecorSnapshot { get(path) -> Option<&Item> }. TESTS: kittest paints a Lucide, an emoji and a File icon without panic; unknown Lucide name returns the generic icon; the snapshot refreshes when the generation changes; 300 KB SVG rejected; texture cache never exceeds 256. VERIFY: standing + cargo xtask tree. DO NOT: call the engine per frame; add icons that are not Lucide (ISC).
  • 4. Explorer rows and tabs show icons. OWNS: crates/ui-egui/src/panels/tree.rs (the icon slot near line 672 only), crates/ui-egui/src/widgets/tabs/paint.rs (icon at lines ~35 and ~204 only), crates/ui-egui/tests/decor_tree.rs. FILES TO OPEN: crates/ui-egui/src/panels/tree.rs:655-680, crates/ui-egui/src/widgets/tabs/paint.rs, crates/ui-egui/src/design/note_icon.rs. GOAL: a decorated note/folder paints its icon instead of file-text/folder; folders keep the open/close Lottie toggle when undecorated; the row cache (panels/tree/rows.rs) is NOT invalidated per frame. TESTS: kittest: decorated note row differs from an undecorated one (pixel or shape counter), folder note icon on folder row, selection tint applied, scroll of 5 000 rows makes 0 engine calls (counter). VERIFY: standing; snapshot PNG read. DO NOT: change row heights; edit rows.rs.
  • 5. Note view: icon above the title and the banner. OWNS: crates/ui-egui/src/views/note_view/banner.rs, crates/ui-egui/src/views/note_view/title_icon.rs, crates/ui-egui/src/text/views/banner.rs, new [ui.banner] table at the END of crates/i18n/locales/en.toml, crates/ui-egui/tests/banner.rs. FILES TO OPEN: spec.md D4, crates/ui-egui/src/views/base_view/layouts/cover.rs, crates/ui-egui/src/views/note_view/ (find where the document top is laid out: grep -n "fn show" views/note_view/edit.rs). GOAL: banner painted full width at the top (cover crop with x/y focus, height from settings), icon above the title (40 px); https banner shows the placeholder "Remote banners are off" with no request; missing file shows nothing. The two hook lines in edit.rs are listed in the report for the lead. TESTS: kittest: banner present for a fixture note (image texture requested once), crop focus y=0.2 picks the right source rect (unit test on the pure crop function), URL banner makes no engine/network call, no banner key shows nothing. VERIFY: standing + cargo xtask i18n; snapshot at 1440x900 with a real jpg fixture, PNG read. DO NOT: hardcode strings; decode on the UI thread.
  • 6. Icon and banner picker, context menu and palette entries. OWNS: crates/ui-egui/src/views/icon_picker/mod.rs, .../grid.rs, .../colors.rs, crates/ui-egui/src/text/views/icon_picker/mod.rs, [ui.icon_picker] table at the END of en.toml, crates/ui-egui/tests/icon_picker.rs. FILES TO OPEN: crates/ui-egui/src/widgets/context_menu.rs, crates/ui-egui/src/views/share_dialog/mod.rs (modal with a job), crates/ui-egui/src/shell/app/window/menus.rs (where Explorer context menus are built), .claude/skills/notescraft-egui-screen/. GOAL: popover with Icons (search + grid), Emoji (text field), File (pick a vault image) and colour swatches from tokens.theme.colors; Remove button; every choice calls decor.set; entries "Set icon...", "Set banner...", "Remove icon" in the Explorer note/folder menu and the palette. Menu/palette wiring lines are listed for the lead. TESTS: kittest: search "rock" shows rocket, click sends decor.set {icon:"rocket"} once, colour swatch sends iconColor, Remove sends nulls. VERIFY: standing + cargo xtask i18n + cargo xtask tree. DO NOT: use raw egui widgets where a library widget exists.
  • 7. Quick switcher, search rows, Bases name column; docs and status. OWNS: crates/ui-egui/src/widgets/palette.rs (note rows only), crates/ui-egui/src/panels/search_panel.rs (row leading icon), crates/ui-egui/src/views/base_view/table/cell.rs (name cell icon), ROADMAP.md, docs/ARCHITECTURE.md, docs/CODE-MAP.md (decor rows), specs/plugins-parity/roadmap.md (mark 16). FILES TO OPEN: those four files at the icon-painting lines, crates/ui-egui/src/design/note_icon.rs. GOAL: the same icon wherever a note name is listed; docs updated. TESTS: snapshot-free unit tests per surface use the DecorSnapshot fake; Bases name cell paints the icon for a decorated row. VERIFY: cargo xtask ci (whole set). DO NOT: add surfaces beyond the three.