feat: Add auto-snapshot feature with git commit every N words

- Add new module src/app/auto_snapshot.rs for auto-snapshot functionality
- Add configuration options: auto_snapshot_enabled (default: false) and
  auto_snapshot_threshold (default: 250 words)
- Automatically create git commits when word count crosses threshold boundaries
- Add 'Edit -> Snapshots' menu option to open snapshots window
- Snapshots window shows: enable/disable toggle, threshold setting, current
  word count, next snapshot target, list of all snapshots with rollback buttons
- Manual snapshot creation via button in snapshots window
- Rollback to any previous snapshot with one click
- Snapshot info includes: word count, timestamp, commit message, commit hash
- Make run_git in gitsync.rs public for use by auto_snapshot module
- Update README.md with Auto-Snapshots documentation

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
landon
2026-09-16 12:11:35 -05:00
parent dcb97da518
commit aafe1786b5
6 changed files with 378 additions and 1 deletions
+13
View File
@@ -164,6 +164,17 @@ pub struct Config {
/// paginated screenplay PDF instead of an ODT.
#[serde(default)]
pub manuscript_screenplay: bool,
/// Whether auto-snapshot (git commit every N words) is enabled.
#[serde(default)]
pub auto_snapshot_enabled: bool,
/// Word count threshold for auto-snapshots.
#[serde(default = "default_auto_snapshot_threshold")]
pub auto_snapshot_threshold: usize,
}
/// Default auto-snapshot threshold: 250 words.
pub fn default_auto_snapshot_threshold() -> usize {
250
}
/// The toolbar and the file list are what the window opens with; hiding either
@@ -335,6 +346,8 @@ impl Default for Config {
manuscript_title_page: false,
manuscript_standard_format: false,
manuscript_screenplay: false,
auto_snapshot_enabled: false,
auto_snapshot_threshold: default_auto_snapshot_threshold(),
}
}
}