feat(slides): typed themes selectable per slide #26
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Theme is a single freeform markdown block applied globally — there is no type, no reference images, and no way to select a different theme per slide without editing the slide file directly. Making theme a structured on-disk resource with a type and reference images enables reusable visual identities, per-slide selection, and auto-assignment based on slide role. See ADR-0004 for the on-disk format decision.
Goals
themes/<name>/theme.tomlwith fieldsname,type(intro | outro | stats | content | generic),description,tags; sibling image files treated as style reference imagestheme: "<name>"selects a theme; no theme text embedded in the slide fileintrotype if one exists, last →outro, remainder →contentorgenericdescriptionas style guidance and ref images as style-only multimodal refs (not reproduced — style cues only)Feasibility
Medium-to-high complexity. The on-disk format and discovery are low-risk, but the
theme.mdstack is deeply embedded and the replacement is a meaningful refactor, not just an addition.Code to remove / replace:
deck_get_theme()anddeck_save_theme()indeck.rs— the read/write API fortheme.mdis replaced by structured TOML loading/savingparse_theme()call indeck.rs— replaced byserdedeserialization oftheme.tomlTheme.raw_contentfield used ingenerator.rs:302as freeform prompt text — replaced by the structureddescriptionfield; the prompt injection point changes but does not growdefault_theme()string function inparser.rs— replaced by seeding a defaultthemes/default/theme.tomlon deck creationcreate_deck()indeck.rs:394currently writestheme.md— changes to create thethemes/directory and default TOMLtheme_hashtracking inmetadata.tomlneeds to target the TOML file instead oftheme.mdMigration path is required: decks with an existing
theme.mdmust either be auto-migrated (readtheme.md, writethemes/default/theme.tomlfrom its content, deletetheme.md) or supported via a legacy fallback read path. Recommend auto-migration on first scan.The UI (theme picker + management tab) is additive and follows existing background panel patterns — lower risk than the backend refactor.