Skip to main content

Module content_pack

Module content_pack 

Source

Constants§

MAIN_WINDOW_LABEL 🔒
Content-pack IPC is restricted to the main settings window, like backup.
MAX_PACK_BYTES 🔒
Hard cap on a pack file we’ll read+parse. Packs are plain text (hints + routine steps); 8 MiB is far above any hand-curated bundle while keeping the read+parse allocation small.

Functions§

apply_pack 🔒
Merge pack into the active profile and persist. Mirrors the update_settings write sequence: merge into a clone, rebuild the #[serde(skip)] derived caches (the break fire path reads derived.*_hints_resolved, not the raw pools — without this an imported idea stays invisible until the next settings change), store, then upsert the active profile (pushing it if somehow absent, like update_settings) and persist. Split out so it’s unit-testable without a WebviewWindow.
ensure_main_window 🔒
export_content_pack
Export the active profile’s hint pools + custom routines as a content pack written to path. name labels the pack.
import_content_pack
Import a content pack from path: read (size-capped), parse, validate, and merge its hints + routines into the active profile additively (duplicates and id-collisions skipped). Persists and returns a summary of what was added. Errors are user-facing strings.