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:
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user