Part of #184 (Fountain import).
What
Add a meta.extra: Map<String, String> field to the .screenplay document schema, holding any title-page keys that don't map to first-class fields (title, author, director, tagline, registration_number, footnote, contact, draft_number, draft_date).
Why
Fountain title pages allow arbitrary keys (Source:, Notes:, Copyright:, plus anything writers invent). On import we have to put them somewhere; on Fountain re-export we have to emit them back. Without this field, a co-writer's custom title-page metadata silently disappears on round-trip.
Implementation sketch
src-tauri/src/screenplay/document.rs — add pub extra: HashMap<String, String> to the meta struct, with #[serde(default, skip_serializing_if = \"HashMap::is_empty\")] so legacy files keep round-tripping byte-clean.
BTreeMap instead of HashMap if we want stable key ordering on save (probably yes — diff-friendlier for git-tracked .screenplay files).
- No UI surface in v1. Keys are read-only inside Scriptty; only the importer writes them, only the exporter emits them.
Acceptance
- New field round-trips through serde without changes to existing fixtures.
- A
.screenplay with no extra field loads identically to before.
- Loading then re-saving an old file does not introduce an empty
extra: {} to the JSON.
Part of #184 (Fountain import).
What
Add a
meta.extra: Map<String, String>field to the.screenplaydocument schema, holding any title-page keys that don't map to first-class fields (title,author,director,tagline,registration_number,footnote,contact,draft_number,draft_date).Why
Fountain title pages allow arbitrary keys (
Source:,Notes:,Copyright:, plus anything writers invent). On import we have to put them somewhere; on Fountain re-export we have to emit them back. Without this field, a co-writer's custom title-page metadata silently disappears on round-trip.Implementation sketch
src-tauri/src/screenplay/document.rs— addpub extra: HashMap<String, String>to the meta struct, with#[serde(default, skip_serializing_if = \"HashMap::is_empty\")]so legacy files keep round-tripping byte-clean.BTreeMapinstead ofHashMapif we want stable key ordering on save (probably yes — diff-friendlier for git-tracked .screenplay files).Acceptance
.screenplaywith noextrafield loads identically to before.extra: {}to the JSON.