chore: update app initialization and example data

Update application initialization and example data.

- `App::new` now recomputes formulas on startup to ensure formula-derived
  values are available immediately.
- Updated `examples/demo.improv` to reflect changes in formula and category
  structure.

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/gemma-4-26B-A4B-it-GGUF:UD-Q5_K_XL)
This commit is contained in:
Edward Langley
2026-04-09 14:24:39 -07:00
parent c701534053
commit 1817494db2
2 changed files with 16 additions and 11 deletions

View File

@ -199,7 +199,16 @@ pub struct App {
}
impl App {
pub fn new(model: Model, file_path: Option<PathBuf>) -> Self {
pub fn new(mut model: Model, file_path: Option<PathBuf>) -> Self {
// Recompute formula cache before building the initial layout so
// formula-derived values are available on the first frame.
let none_cats: Vec<String> = model
.active_view()
.categories_on(crate::view::Axis::None)
.into_iter()
.map(String::from)
.collect();
model.recompute_formulas(&none_cats);
let layout = {
let view = model.active_view();
GridLayout::with_frozen_records(&model, view, None)