fix: formula evaluation and management bugs
Three bugs fixed, each with a failing regression test added first: 1. WHERE filter fallthrough: when the filter's category was absent from the cell key, the formula was applied unconditionally. Now returns the raw stored value (no formula applied) when the category is missing. 2. Agg inner/filter ignored: SUM(Revenue) was summing ALL cells in the partial slice rather than constraining to the Revenue item. Now resolves the inner Ref to its category and pins that coordinate before scanning. 3. Formula dedup by target only: add_formula and remove_formula keyed on target name alone, so two formulas with the same item name in different categories would collide. Both now key on (target, target_category). RemoveFormula command updated to carry target_category. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@ -80,8 +80,8 @@ pub fn dispatch(model: &mut Model, cmd: &Command) -> CommandResult {
|
||||
}
|
||||
}
|
||||
|
||||
Command::RemoveFormula { target } => {
|
||||
model.remove_formula(target);
|
||||
Command::RemoveFormula { target, target_category } => {
|
||||
model.remove_formula(target, target_category);
|
||||
CommandResult::ok()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user