From a7a708d0f64ad20a76dcba4e00de8f2219411eb2 Mon Sep 17 00:00:00 2001 From: TheRenegadeDev Date: Mon, 26 Oct 2026 13:22:28 -0500 Subject: [PATCH 1/9] #2641: cascade AutoFilter dropdown values --- crates/engine/src/cmd/data.rs | 145 ++++++++------ .../engine/tests/cascading_filter_values.rs | 183 ++++++++++++++++++ .../ui-egui/tests/cascading_filter_values.rs | 69 +++++++ docs/ui-parity.md | 20 +- 4 files changed, 360 insertions(+), 57 deletions(-) create mode 100644 crates/engine/tests/cascading_filter_values.rs create mode 100644 crates/ui-egui/tests/cascading_filter_values.rs diff --git a/crates/engine/src/cmd/data.rs b/crates/engine/src/cmd/data.rs index fcab9db713..de17bc54c8 100644 --- a/crates/engine/src/cmd/data.rs +++ b/crates/engine/src/cmd/data.rs @@ -679,17 +679,17 @@ pub(crate) fn grow_autofilter(sh: &mut Sheet, at: CellRef) { } } -/// Hides rows of the autofilter range that fail any criterion. -pub(crate) fn apply_filter(wb: &mut Workbook, sheet: usize) { - let Some(sh) = wb.sheet(sheet) else { return }; - let Some(af) = sh.autofilter.clone() else { return }; +/// Statistics use the original range, regardless of the other active criteria (as in Excel). +fn filter_stats(sh: &Sheet, af: &AutoFilter, excluded_offset: Option) -> std::collections::HashMap, f64)> { let r = af.range; - let mut hide = Vec::new(); // Precompute per-criterion top10 threshold and average once, not per row. let mut col_stats: std::collections::HashMap, f64)> = std::collections::HashMap::new(); for (i, (off, c)) in af.criteria.iter().enumerate() { + if Some(*off) == excluded_offset { + continue; + } if matches!(c, FilterCriterion::Top10 { .. } | FilterCriterion::AboveAverage(_)) { - let col = r.start.col + off; + let Some(col) = r.start.col.checked_add(*off).filter(|col| *col <= r.end.col) else { continue }; let mut nums: Vec = (r.start.row + 1..=r.end.row).filter_map(|row| sh.value(CellRef::new(row, col)).as_f64()).collect(); let avg = if nums.is_empty() { 0.0 } else { nums.iter().sum::() / nums.len() as f64 }; let thr = match c { @@ -704,59 +704,84 @@ pub(crate) fn apply_filter(wb: &mut Workbook, sheet: usize) { col_stats.insert(i, (thr, avg)); } } - for row in r.start.row + 1..=r.end.row { - let mut visible = true; - for (i, (off, crit)) in af.criteria.iter().enumerate() { - let c = CellRef::new(row, r.start.col + off); - let v = sh.value(c); - let text = crate::display::cell_text(wb, sh, c); - let ok = match crit { - FilterCriterion::Values { values, blanks } => { - if filter_blank(&v) { - *blanks - } else { - values.iter().any(|x| x.eq_ignore_ascii_case(&text) || x.eq_ignore_ascii_case(&v.display())) + col_stats +} + +/// Evaluate criteria directly, without conflating manual visibility with filter results. +fn filter_row_matches( + wb: &Workbook, + sh: &Sheet, + af: &AutoFilter, + row: u32, + col_stats: &std::collections::HashMap, f64)>, + excluded_offset: Option, +) -> bool { + for (i, (off, crit)) in af.criteria.iter().enumerate() { + if Some(*off) == excluded_offset { + continue; + } + let Some(col) = af.range.start.col.checked_add(*off).filter(|col| *col <= af.range.end.col) else { continue }; + let c = CellRef::new(row, col); + let v = sh.value(c); + let text = crate::display::cell_text(wb, sh, c); + let ok = match crit { + FilterCriterion::Values { values, blanks } => { + if filter_blank(&v) { + *blanks + } else { + values.iter().any(|x| x.eq_ignore_ascii_case(&text) || x.eq_ignore_ascii_case(&v.display())) + } + } + FilterCriterion::Custom { a, b, and } => { + let x = custom_ok(&v, &text, &a.0, &a.1); + match b { + Some(b) => { + let y = custom_ok(&v, &text, &b.0, &b.1); + if *and { x && y } else { x || y } } + None => x, + } + } + FilterCriterion::Top10 { bottom, .. } => match (v.as_f64(), col_stats.get(&i)) { + (Some(n), Some((thr, _))) => { + let thr = thr.unwrap_or(n); + if *bottom { n <= thr } else { n >= thr } } - FilterCriterion::Custom { a, b, and } => { - let x = custom_ok(&v, &text, &a.0, &a.1); - match b { - Some(b) => { - let y = custom_ok(&v, &text, &b.0, &b.1); - if *and { x && y } else { x || y } - } - None => x, + _ => false, + }, + FilterCriterion::AboveAverage(above) => match (v.as_f64(), col_stats.get(&i)) { + (Some(n), Some((_, avg))) => { + if *above { + n > *avg + } else { + n < *avg } } - FilterCriterion::Top10 { bottom, .. } => match (v.as_f64(), col_stats.get(&i)) { - (Some(n), Some((thr, _))) => { - let thr = thr.unwrap_or(n); - if *bottom { n <= thr } else { n >= thr } - } - _ => false, - }, - FilterCriterion::AboveAverage(above) => match (v.as_f64(), col_stats.get(&i)) { - (Some(n), Some((_, avg))) => { - if *above { - n > *avg - } else { - n < *avg - } - } - _ => false, - }, - FilterCriterion::FillColor(col) => wb.styles.get(sh.style_id(c)).fill.fg == *col, - FilterCriterion::FontColor(col) => wb.styles.get(sh.style_id(c)).font.color == *col, - // Icons are not evaluated here: the row keeps its current visibility. - FilterCriterion::Icon { .. } => !sh.is_row_hidden(row), - }; - if !ok { - visible = false; - break; - } + _ => false, + }, + FilterCriterion::FillColor(col) => wb.styles.get(sh.style_id(c)).fill.fg == *col, + FilterCriterion::FontColor(col) => wb.styles.get(sh.style_id(c)).font.color == *col, + // Icon criteria are retained from files but cannot be evaluated yet. + FilterCriterion::Icon { .. } => true, + }; + if !ok { + return false; } - hide.push((row, !visible)); } + true +} + +/// Hides rows of the autofilter range that fail any criterion. +pub(crate) fn apply_filter(wb: &mut Workbook, sheet: usize) { + let Some(sh) = wb.sheet(sheet) else { return }; + let Some(af) = sh.autofilter.clone() else { return }; + let r = af.range; + let col_stats = filter_stats(sh, &af, None); + // Reapplying a retained icon filter preserves visibility until icons can be evaluated. + let has_icon = af.criteria.iter().any(|(_, c)| matches!(c, FilterCriterion::Icon { .. })); + let hide: Vec<_> = (r.start.row + 1..=r.end.row) + .map(|row| (row, !filter_row_matches(wb, sh, &af, row, &col_stats, None) || (has_icon && sh.is_row_hidden(row)))) + .collect(); let Some(shm) = wb.sheet_mut(sheet) else { return }; for (row, h) in hide { if h { @@ -789,14 +814,22 @@ fn reapply(s: &mut Session, _: &Json) -> Result { }) } -/// Distinct display values of a filter column (for the dropdown list). +/// Distinct display values from rows matching the other columns' criteria. +/// The current criterion only determines checkboxes, so its unchecked alternatives stay available. pub fn filter_values(wb: &Workbook, sheet: usize, col: u32) -> Vec<(String, bool)> { let Some(sh) = wb.sheet(sheet) else { return vec![] }; let Some(af) = &sh.autofilter else { return vec![] }; - let off = col.saturating_sub(af.range.start.col); + if col < af.range.start.col || col > af.range.end.col { + return vec![]; + } + let off = col - af.range.start.col; let selected: Option<&FilterCriterion> = af.criteria.iter().find(|(o, _)| *o == off).map(|(_, c)| c); + let col_stats = filter_stats(sh, af, Some(off)); let mut seen = std::collections::BTreeMap::new(); - for row in af.range.start.row + 1..=af.range.end.row.min(af.range.start.row + 1_000_000) { + for row in af.range.start.row.saturating_add(1)..=af.range.end.row.min(af.range.start.row.saturating_add(1_000_000)) { + if !filter_row_matches(wb, sh, af, row, &col_stats, Some(off)) { + continue; + } let c = CellRef::new(row, col); let v = sh.value(c); let blank = filter_blank(&v); diff --git a/crates/engine/tests/cascading_filter_values.rs b/crates/engine/tests/cascading_filter_values.rs new file mode 100644 index 0000000000..afaf720282 --- /dev/null +++ b/crates/engine/tests/cascading_filter_values.rs @@ -0,0 +1,183 @@ +use std::sync::Arc; + +use gridcraft_engine::{ + Session, + cmd::data::filter_values, + model::{Color, FilterCriterion}, +}; +use serde_json::json; + +#[test] +fn choices_use_the_same_custom_and_statistical_criteria_as_filtering() { + for (criterion, expected) in [ + (json!({"custom": {"op": ">=", "value": 20, "op2": "<", "value2": 100}}), vec!["mid", "upper"]), + (json!({"custom": {"op": "=", "value": 10, "op2": "=", "value2": 100, "and": false}}), vec!["high", "low"]), + (json!({"custom": {"op": "=", "value": "n?*"}}), vec!["text"]), + (json!({"top": {"count": 2}}), vec!["high", "upper"]), + (json!({"top": {"count": 50, "percent": true, "bottom": true}}), vec!["low", "mid"]), + (json!({"aboveAverage": true}), vec!["high"]), + (json!({"aboveAverage": false}), vec!["low", "mid", "upper"]), + ] { + let mut s = Session::new(); + s.new_workbook(); + s.execute( + "range.setValues", + json!({"range": "A1", "values": [ + ["Name", "Amount"], ["low", 10], ["mid", 20], ["upper", 30], ["high", 100], ["blank", null], ["text", "n/a"] + ]}), + ) + .unwrap(); + s.execute("data.filter", json!({"range": "A1:B7"})).unwrap(); + let mut params = criterion.clone(); + params["column"] = json!("B"); + s.execute("data.filterBy", params).unwrap(); + let actual: Vec<_> = filter_values(&s.doc().unwrap().wb, 0, 0).into_iter().map(|(v, _)| v).collect(); + assert_eq!(actual, expected, "{criterion}"); + // Statistics still come from the whole range even with another column filtered. + s.execute("data.filterBy", json!({"column": "A", "values": ["mid"]})).unwrap(); + let actual: Vec<_> = filter_values(&s.doc().unwrap().wb, 0, 0).into_iter().map(|(v, _)| v).collect(); + assert_eq!(actual, expected, "{criterion}, with the current column filtered"); + assert_eq!( + filter_values(&s.doc().unwrap().wb, 0, 1), + vec![("20".into(), true)], + "the numeric column's own criterion must be excluded: {criterion}" + ); + } +} + +#[test] +fn choices_match_other_columns_but_keep_the_current_columns_unchecked_values() { + let mut s = Session::new(); + s.new_workbook(); + s.execute( + "range.setValues", + json!({"range": "B3", "values": [ + ["Company", "Job", "Status"], + ["East", "Alpha", "Open"], + ["East", "Beta", "Open"], + ["East", "Closed job", "Closed"], + ["West", "Other company", "Open"], + ["East", null, "Open"], + ["East", "=\"\"", "Open"], + ["East", "Outside range", "Open"] + ]}), + ) + .unwrap(); + s.execute("data.filter", json!({"range": "B3:D9"})).unwrap(); + s.execute("data.filterBy", json!({"column": "B", "values": ["East"]})).unwrap(); + s.execute("data.filterBy", json!({"column": "D", "values": ["Open"]})).unwrap(); + s.execute("data.filterBy", json!({"column": "C", "values": ["Alpha"]})).unwrap(); + + let choices = |s: &Session| filter_values(&s.doc().unwrap().wb, 0, 2); + let expected = + |beta: bool, blanks: bool| -> Vec<(String, bool)> { vec![("Alpha".into(), !beta), ("Beta".into(), beta), ("(Blanks)".into(), blanks)] }; + assert_eq!(choices(&s), expected(false, false)); + s.execute("data.filterBy", json!({"column": "C", "values": ["Beta"], "blanks": true})).unwrap(); + assert_eq!(choices(&s), expected(true, true)); + s.execute("data.filterBy", json!({"column": "C", "clear": true})).unwrap(); + assert_eq!(choices(&s), vec![("Alpha".into(), true), ("Beta".into(), true), ("(Blanks)".into(), true)]); + // Manual visibility is not a filter criterion, even when every eligible row is hidden. + s.execute("home.hideRows", json!({"rows": "4:10"})).unwrap(); + assert_eq!(choices(&s).len(), 3); + assert!(filter_values(&s.doc().unwrap().wb, 0, 0).is_empty()); + assert!(filter_values(&s.doc().unwrap().wb, 0, 4).is_empty()); +} + +#[test] +fn choices_respect_blank_and_formatted_value_criteria_on_other_columns() { + let mut s = Session::new(); + s.new_workbook(); + s.execute( + "range.setValues", + json!({"range": "A1", "values": [ + ["Name", "Value"], ["empty", null], ["formula", "=\"\""], ["spaces", " "], ["number", 12], ["other", 30] + ]}), + ) + .unwrap(); + s.execute("home.numberFormat", json!({"range": "B5:B6", "code": "0.00"})).unwrap(); + s.execute("data.filter", json!({"range": "A1:B6"})).unwrap(); + s.execute("data.filterBy", json!({"column": "B", "values": [], "blanks": true})).unwrap(); + assert_eq!(filter_values(&s.doc().unwrap().wb, 0, 0), vec![("empty".into(), true), ("formula".into(), true)]); + for value in ["12", "12.00"] { + s.execute("data.filterBy", json!({"column": "B", "values": [value]})).unwrap(); + assert_eq!(filter_values(&s.doc().unwrap().wb, 0, 0), vec![("number".into(), true)]); + } + s.execute("data.filterBy", json!({"column": "B", "values": ["absent"]})).unwrap(); + assert!(filter_values(&s.doc().unwrap().wb, 0, 0).is_empty()); +} + +#[test] +fn choices_match_color_criteria_and_do_not_infer_icon_matches_from_hidden_rows() { + let mut s = Session::new(); + s.new_workbook(); + s.execute("range.setValues", json!({"range": "A1", "values": [["Name", "Color"], ["red", 1], ["plain", 2]]})).unwrap(); + s.execute("home.fillColor", json!({"range": "B2", "color": "#FF0000"})).unwrap(); + s.execute("home.fontColor", json!({"range": "B2", "color": "#FF0000"})).unwrap(); + s.execute("data.filter", json!({"range": "A1:B3"})).unwrap(); + for criterion in [FilterCriterion::FillColor(Color::Rgb(0xFF0000)), FilterCriterion::FontColor(Color::Rgb(0xFF0000))] { + let sh = Arc::make_mut(&mut s.doc_mut().unwrap().wb).sheet_mut(0).unwrap(); + sh.autofilter.as_mut().unwrap().criteria = vec![(1, criterion)]; + s.execute("data.reapply", json!({})).unwrap(); + assert_eq!(filter_values(&s.doc().unwrap().wb, 0, 0), vec![("red".into(), true)]); + } + let sh = Arc::make_mut(&mut s.doc_mut().unwrap().wb).sheet_mut(0).unwrap(); + sh.autofilter.as_mut().unwrap().criteria = vec![(1, FilterCriterion::Icon { set: "3Arrows".into(), id: Some(0) })]; + s.execute("data.reapply", json!({})).unwrap(); + assert!(s.doc().unwrap().wb.active().unwrap().is_row_hidden(2), "reapply preserves imported icon visibility"); + assert_eq!( + filter_values(&s.doc().unwrap().wb, 0, 0), + vec![("plain".into(), true), ("red".into(), true)], + "unsupported icon criteria cannot distinguish manual and current-column hiding" + ); +} + +#[test] +fn querying_a_table_backed_sheet_filter_is_read_only_and_preserves_xlsx_criteria() { + for table in [false, true] { + let mut s = Session::new(); + s.new_workbook(); + s.execute("range.setValues", json!({"range": "B3", "values": [["Company", "Job"], ["East", "Alpha"], ["East", "Beta"], ["West", "Other"]]})) + .unwrap(); + if table { + s.execute("insert.table", json!({"range": "B3:C6", "header": true})).unwrap(); + } + s.execute("selection.set", json!({"cell": "B3"})).unwrap(); + s.execute("data.filterBy", json!({"column": "B", "values": ["East"]})).unwrap(); + let before = gridcraft_xlsx::write_xlsx(&s.doc().unwrap().wb).unwrap(); + assert_eq!(filter_values(&s.doc().unwrap().wb, 0, 2), vec![("Alpha".into(), true), ("Beta".into(), true)]); + assert_eq!(before, gridcraft_xlsx::write_xlsx(&s.doc().unwrap().wb).unwrap()); + let (reopened, _) = gridcraft_xlsx::read_xlsx(&before).unwrap(); + let sh = reopened.active().unwrap(); + let criteria = if table { &sh.tables[0].filter } else { &sh.autofilter.as_ref().unwrap().criteria }; + assert_eq!(criteria, &vec![(0, FilterCriterion::Values { values: vec!["East".into()], blanks: false })]); + assert!(!sh.is_row_hidden(3) && !sh.is_row_hidden(4) && sh.is_row_hidden(5)); + } +} + +#[test] +fn an_unrelated_tables_criteria_do_not_restrict_the_sheet_filter_choices() { + let mut s = Session::new(); + s.new_workbook(); + s.execute("range.setValues", json!({"range": "B3", "values": [["Company", "Job"], ["East", "Alpha"], ["East", "Beta"], ["West", "Other"]]})) + .unwrap(); + s.execute("range.setValues", json!({"range": "F3", "values": [["Company", "Job"], ["West", "Unrelated"], ["East", "Separate"]]})).unwrap(); + s.execute("insert.table", json!({"range": "F3:G5", "header": true})).unwrap(); + let sh = Arc::make_mut(&mut s.doc_mut().unwrap().wb).sheet_mut(0).unwrap(); + sh.tables[0].filter = vec![(0, FilterCriterion::Values { values: vec!["West".into()], blanks: false })]; + s.execute("selection.set", json!({"cell": "B3"})).unwrap(); + s.execute("data.filter", json!({"range": "B3:C6"})).unwrap(); + s.execute("data.filterBy", json!({"column": "B", "values": ["East"]})).unwrap(); + assert_eq!(filter_values(&s.doc().unwrap().wb, 0, 2), vec![("Alpha".into(), true), ("Beta".into(), true)]); +} + +#[test] +fn choices_are_bounded_at_the_last_sheet_row_and_empty_for_missing_data() { + let mut s = Session::new(); + s.new_workbook(); + assert!(filter_values(&s.doc().unwrap().wb, 0, 0).is_empty()); + assert!(filter_values(&s.doc().unwrap().wb, 99, 0).is_empty()); + s.execute("range.setValues", json!({"range": "B1048574", "values": [["Company", "Job"], ["East", "Last East"], ["West", "Last West"]]})).unwrap(); + s.execute("data.filter", json!({"range": "B1048574:C1048576"})).unwrap(); + s.execute("data.filterBy", json!({"column": "B", "values": ["East"]})).unwrap(); + assert_eq!(filter_values(&s.doc().unwrap().wb, 0, 2), vec![("Last East".into(), true)]); +} diff --git a/crates/ui-egui/tests/cascading_filter_values.rs b/crates/ui-egui/tests/cascading_filter_values.rs new file mode 100644 index 0000000000..c217d35fc4 --- /dev/null +++ b/crates/ui-egui/tests/cascading_filter_values.rs @@ -0,0 +1,69 @@ +#[path = "common/mod.rs"] +mod common; + +use egui::{Event, Key, Modifiers}; +use egui_kittest::kittest::Queryable; +use gridcraft_engine::Session; +use serde_json::json; + +fn key(h: &mut common::Harness, key: Key, modifiers: Modifiers) { + for pressed in [true, false] { + h.input_mut().events.push(Event::Key { key, physical_key: Some(key), pressed, repeat: false, modifiers }); + } + h.run_steps(3); +} + +#[test] +fn dropdown_can_change_and_clear_a_column_while_another_filter_stays_active() { + for table in [false, true] { + let mut session = Session::new(); + session.new_workbook(); + session + .execute( + "range.setValues", + json!({"range": "A1", "values": [ + ["Company", "Job"], ["East", "Alpha"], ["East", "Beta"], ["West", "Other"], ["East", null] + ]}), + ) + .unwrap(); + if table { + session.execute("insert.table", json!({"range": "A1:B5", "header": true})).unwrap(); + } + session.execute("data.filterBy", json!({"column": "A", "values": ["East"]})).unwrap(); + session.execute("data.filterBy", json!({"column": "B", "values": ["Alpha"]})).unwrap(); + session.execute("selection.set", json!({"cell": "B1"})).unwrap(); + let screenshot = std::env::var("GRIDCRAFT_CASCADING_SNAPSHOT").ok().filter(|_| !table); + let mut h = if screenshot.is_some() { + common::harness_with( + common::builder().with_os(egui::os::OperatingSystem::Windows).with_size(egui::vec2(1200.0, 800.0)).wgpu(), + common::app(session), + 4, + ) + } else { + common::os_harness(session, egui::os::OperatingSystem::Windows) + }; + key(&mut h, Key::ArrowDown, Modifiers::ALT); + assert!(h.query_by_label("Alpha").is_some()); + assert!(h.query_by_label("Beta").is_some(), "current-column filtering must not remove alternatives"); + assert!(h.query_by_label("(Blanks)").is_some()); + assert!(h.query_by_label("Other").is_none(), "the other company's job must not be listed"); + if let Some(path) = screenshot { + h.render().unwrap().save(path).unwrap(); + } + h.get_by_label("Alpha").click(); + h.run_steps(2); + h.get_by_label("Beta").click(); + h.run_steps(2); + h.get_by_label("Apply").click(); + h.run_steps(3); + let hidden = |h: &common::Harness| { + let sh = h.state().session.active().unwrap().wb.active().unwrap(); + (1..=4).map(|row| sh.is_row_hidden(row)).collect::>() + }; + assert_eq!(hidden(&h), [true, false, true, true]); + key(&mut h, Key::ArrowDown, Modifiers::ALT); + h.get_by_label("Clear Filter").click(); + h.run_steps(3); + assert_eq!(hidden(&h), [false, false, true, false], "clearing Job keeps Company filtered"); + } +} diff --git a/docs/ui-parity.md b/docs/ui-parity.md index f35899236b..dca4ea508e 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -1,6 +1,6 @@ # UI parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-25 · **Change:** minor (AutoSum over a selected row puts its total to the right) · **Target:** Microsoft Excel (Microsoft 365), Excel for Mac 16.113.4 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-26 · **Change:** minor (cascading AutoFilter choices) · **Target:** Microsoft Excel (Microsoft 365), Excel for Mac 16.113.4 Interaction, controls and feel, against Excel. Part of [target-app-parity.md](target-app-parity.md). **UI/UX fidelity: ~55% ready, 50–80 h** (estimated). Ribbon command coverage is measured @@ -60,6 +60,7 @@ this logic, with one undo step. | Point mode (click/drag/arrow references), reference colouring, F4 | done | | AutoComplete in columns, function autocomplete and argument tips | done; cell helpers clip to the worksheet and hide when the editor scrolls out (#200) | | Header resize and double-click AutoFit | done (#42, #88 for header dividers) | +| AutoFilter value dropdowns | Choices come from rows satisfying the other columns' active criteria; the current column only determines checkbox state, including (Blanks), so its filter can be changed or cleared (#2641). Custom comparisons, Top 10, average and color criteria use the same evaluator as row filtering. Top 10 / average thresholds still use the original range. Manual hidden rows do not restrict choices; imported icon criteria remain unevaluated. | | Data › Advanced Filter | dialog offers in-place or copy-to filtering, list and optional criteria ranges, and unique records; Alt+A,Q opens it (#1622). The engine's copy-to path clears only the result footprint and rejects worksheet overflow (#1031). | | Outline symbols for grouped rows / columns (band beside the headers, brackets, − / +, level buttons 1…n+1) | done (#373): clicks run `data.hideDetail` / `data.showDetail` / `data.showLevels`, frozen panes and right-to-left sheets included; Data › Outline › Settings (`data.outlineSettings`) puts summary rows above and summary columns left of their detail, saved as `outlinePr` (the dialog's Automatic styles check box and Apply Styles button are missing), View › Show Outline Symbols (Ctrl+8) hides the bands and is saved with the sheet, and a block of cells still groups rows without the Rows / Columns dialog | | Reorder selected whole columns by dragging their headers | done (10-11) | @@ -91,6 +92,22 @@ this logic, with one undo step. | Sequential Alt access keys (Alt, H, N, …) on every ribbon tab | yes | 364-sequence keytip table for all tabs: per-control badges, prefix waiting, dropdowns open for editing (type/arrows/Enter), pending bindings for not-yet-built commands; letters also work with left Alt held (Alt+H, O, A), as in Excel; each Borders letter (H, B, …) draws its own preset, H, B, M opens Format Cells on the Border tab, and Erase Border, Line Color and Line Style are reserved; QAT/Backstage excluded | | Requests | — | #110 (more shortcuts and hot keys), #33 (sequential Alt; initial support landed in #43) | +### AutoFilter population and pending integrations + +[Microsoft's filtering guide](https://support.microsoft.com/en-us/excel/get-started/filter-data-in-a-range-or-table-in-excel) +describes additive column filters and restricting other dropdowns to the filtered range. The +current column is excluded from enumeration so its unchecked alternatives remain available. +The existing one-million-data-row enumeration limit and value sorting remain unchanged. + +This changes the population behind the pending row-count work (#1737, and its stacked Only +button #1741): a future count beside a choice should count eligible rows satisfying the other +columns, including rows rejected by the current column. It must not count the whole original +range or just currently visible rows. Search narrows the displayed choices, not that population. +These PRs are not incorporated here. Date grouping (#1509) should group this same eligible +population. Table filter activation / roundtrip ownership changes remain in #2506; enumeration +reads the active sheet AutoFilter used by the current table dropdown without changing criteria, +row visibility or the XLSX representation. + ### Shortcut audit (#110) Checked against Microsoft's published "Keyboard shortcuts in Excel" (Windows and Mac tables, @@ -187,6 +204,7 @@ scrollbar bugs 2–4 · pixel/feel pass against observed Excel 7–12. | Date | Change | Summary | |---|---|---| +| 2026-10-26 | minor | AutoFilter choices cascade across other columns while retaining current-column alternatives and blanks (#2641); document pending counts, date grouping and table roundtrip integration | | 2026-10-25 | minor | AutoSum (Alt+=, Home › AutoSum) over a selected row puts its total to the right of the row, or in its last cell when that is empty, as in Excel; it wrote a one-cell total under each cell. A selection's empty last column takes each row's total and its empty last row each column's, with the block's total in the corner when both are empty | | 2026-10-25 | minor | Paste Name lays out only the names in view, so a workbook with thousands of names opens it at once; the arrow keys still scroll the chosen name into view. Go To matches a `Sheet2!Name` reference and hides a workbook name behind the active sheet's own name in any case and script (`Größe` = `GRÖSSE`), as formulas do. The two Page Layout view rows are one; the 0.7 in side margin used when Align with Page Margins is off is marked unverified | | 2026-10-24 | minor | Go To lists the named ranges on every sheet, as Excel's does ("The Go to popup window shows named ranges on every worksheet in your workbook"): a name scoped to another sheet appears as `Sheet2!Name`, and hidden names, constants and formulas are left out. It keeps the references entered (newest first, ten at most), and a double-click on an entry goes there. The Reference box and `edit.goTo` take several names or references separated by commas (`Price, Type`, `B14:C22,F19:G30,H21:H29`) and select them all; `edit.goTo {list: true}` returns the list | From 1fcaffe7b7fdefe5885c819c8bc64d2e0bc3ef0e Mon Sep 17 00:00:00 2001 From: TheRenegadeDev Date: Mon, 26 Oct 2026 13:40:03 -0500 Subject: [PATCH 2/9] #2641: address review coverage and menu scan cost --- .../tests/{ => it}/cascading_filter_values.rs | 35 +++++++++++++++++-- crates/engine/tests/it/main.rs | 1 + crates/ui-egui/src/grid.rs | 6 ++-- .../tests/{ => it}/cascading_filter_values.rs | 3 +- crates/ui-egui/tests/it/main.rs | 1 + 5 files changed, 40 insertions(+), 6 deletions(-) rename crates/engine/tests/{ => it}/cascading_filter_values.rs (84%) rename crates/ui-egui/tests/{ => it}/cascading_filter_values.rs (98%) diff --git a/crates/engine/tests/cascading_filter_values.rs b/crates/engine/tests/it/cascading_filter_values.rs similarity index 84% rename from crates/engine/tests/cascading_filter_values.rs rename to crates/engine/tests/it/cascading_filter_values.rs index afaf720282..5c39131d21 100644 --- a/crates/engine/tests/cascading_filter_values.rs +++ b/crates/engine/tests/it/cascading_filter_values.rs @@ -33,7 +33,7 @@ fn choices_use_the_same_custom_and_statistical_criteria_as_filtering() { s.execute("data.filterBy", params).unwrap(); let actual: Vec<_> = filter_values(&s.doc().unwrap().wb, 0, 0).into_iter().map(|(v, _)| v).collect(); assert_eq!(actual, expected, "{criterion}"); - // Statistics still come from the whole range even with another column filtered. + // The current column's own criterion must not narrow its alternatives. s.execute("data.filterBy", json!({"column": "A", "values": ["mid"]})).unwrap(); let actual: Vec<_> = filter_values(&s.doc().unwrap().wb, 0, 0).into_iter().map(|(v, _)| v).collect(); assert_eq!(actual, expected, "{criterion}, with the current column filtered"); @@ -45,6 +45,36 @@ fn choices_use_the_same_custom_and_statistical_criteria_as_filtering() { } } +#[test] +fn statistical_thresholds_use_the_original_range_not_other_columns_subset() { + for (criterion, names, expected) in [ + (json!({"top": {"count": 2}}), vec!["low", "mid", "upper"], vec!["upper"]), + (json!({"top": {"count": 50, "percent": true}}), vec!["low", "mid", "upper"], vec!["upper"]), + (json!({"top": {"count": 2, "bottom": true}}), vec!["mid", "upper", "high"], vec!["mid"]), + (json!({"top": {"count": 50, "percent": true, "bottom": true}}), vec!["mid", "upper", "high"], vec!["mid"]), + (json!({"aboveAverage": true}), vec!["low", "mid", "upper"], vec![]), + (json!({"aboveAverage": false}), vec!["low", "mid", "upper"], vec!["low", "mid", "upper"]), + ] { + let mut s = Session::new(); + s.new_workbook(); + s.execute( + "range.setValues", + json!({"range": "A1", "values": [ + ["Name", "Amount", "Job"], ["low", 10, "low"], ["mid", 20, "mid"], ["upper", 30, "upper"], ["high", 100, "high"] + ]}), + ) + .unwrap(); + s.execute("data.filter", json!({"range": "A1:C5"})).unwrap(); + s.execute("data.filterBy", json!({"column": "A", "values": names})).unwrap(); + let mut params = criterion.clone(); + params["column"] = json!("B"); + s.execute("data.filterBy", params).unwrap(); + // A and B both remain active when enumerating C. Subset statistics produce different jobs. + let actual: Vec<_> = filter_values(&s.doc().unwrap().wb, 0, 2).into_iter().map(|(v, _)| v).collect(); + assert_eq!(actual, expected, "{criterion}"); + } +} + #[test] fn choices_match_other_columns_but_keep_the_current_columns_unchecked_values() { let mut s = Session::new(); @@ -176,7 +206,8 @@ fn choices_are_bounded_at_the_last_sheet_row_and_empty_for_missing_data() { s.new_workbook(); assert!(filter_values(&s.doc().unwrap().wb, 0, 0).is_empty()); assert!(filter_values(&s.doc().unwrap().wb, 99, 0).is_empty()); - s.execute("range.setValues", json!({"range": "B1048574", "values": [["Company", "Job"], ["East", "Last East"], ["West", "Last West"]]})).unwrap(); + s.execute("range.setValues", json!({"range": "B1048574", "values": [["Company", "Job"], ["West", "Before last"], ["East", "Last East"]]})) + .unwrap(); s.execute("data.filter", json!({"range": "B1048574:C1048576"})).unwrap(); s.execute("data.filterBy", json!({"column": "B", "values": ["East"]})).unwrap(); assert_eq!(filter_values(&s.doc().unwrap().wb, 0, 2), vec![("Last East".into(), true)]); diff --git a/crates/engine/tests/it/main.rs b/crates/engine/tests/it/main.rs index 4c91e58ac4..23f03a14f0 100644 --- a/crates/engine/tests/it/main.rs +++ b/crates/engine/tests/it/main.rs @@ -1,6 +1,7 @@ //! The crate's integration tests, one module per file, built as one test binary. mod autofit_filter_buttons; +mod cascading_filter_values; mod cf_formula_validate; mod chart_area_stacked100; mod chart_workbook_names; diff --git a/crates/ui-egui/src/grid.rs b/crates/ui-egui/src/grid.rs index 2f9a1ba6eb..1cdf58390c 100644 --- a/crates/ui-egui/src/grid.rs +++ b/crates/ui-egui/src/grid.rs @@ -3326,7 +3326,6 @@ fn filter_menu(app: &mut SheetApp, ui: &mut egui::Ui, geo: &Geo, was_open: bool) } } let wb = app.session.active().map(|d| d.wb.clone()).unwrap_or(wb); - let values = gridcraft_engine::cmd::data::filter_values(&wb, si, col); let key = egui::Id::unique(("filter_sel", col)); let search_key = egui::Id::unique(("filter_search", col)); let buttons_key = egui::Id::unique(("filter_buttons", col)); @@ -3352,7 +3351,10 @@ fn filter_menu(app: &mut SheetApp, ui: &mut egui::Ui, geo: &Geo, was_open: bool) } ui.separator(); ui.label(egui::RichText::new("Filter").strong()); - let mut checks: Vec<(String, bool)> = ui.ctx().data_mut(|d| d.get_temp::>(key)).unwrap_or(values.clone()); + let mut checks: Vec<(String, bool)> = ui + .ctx() + .data_mut(|d| d.get_temp::>(key)) + .unwrap_or_else(|| gridcraft_engine::cmd::data::filter_values(&wb, si, col)); // A search narrows the list; Select All and Apply then only cover the matches. let mut search: String = ui.ctx().data_mut(|d| d.get_temp(search_key)).unwrap_or_default(); let field = ui.add(egui::TextEdit::singleline(&mut search).hint_text("Search").desired_width(f32::INFINITY)); diff --git a/crates/ui-egui/tests/cascading_filter_values.rs b/crates/ui-egui/tests/it/cascading_filter_values.rs similarity index 98% rename from crates/ui-egui/tests/cascading_filter_values.rs rename to crates/ui-egui/tests/it/cascading_filter_values.rs index c217d35fc4..0b4e2259bc 100644 --- a/crates/ui-egui/tests/cascading_filter_values.rs +++ b/crates/ui-egui/tests/it/cascading_filter_values.rs @@ -1,5 +1,4 @@ -#[path = "common/mod.rs"] -mod common; +use crate::common; use egui::{Event, Key, Modifiers}; use egui_kittest::kittest::Queryable; diff --git a/crates/ui-egui/tests/it/main.rs b/crates/ui-egui/tests/it/main.rs index 53625015ed..b8fa0baa11 100644 --- a/crates/ui-egui/tests/it/main.rs +++ b/crates/ui-egui/tests/it/main.rs @@ -11,6 +11,7 @@ mod advanced_filter; mod argument_names; mod autosave_persist; mod borders; +mod cascading_filter_values; mod cell_editor_caret; mod cell_pictures; mod cf_rule_pick; From 91e6a41a63be4e67a12bfd22a8bbeff7b9ce1446 Mon Sep 17 00:00:00 2001 From: TheRenegadeDev Date: Wed, 28 Oct 2026 23:50:52 -0500 Subject: [PATCH 3/9] #2641: Discard old filter-menu state when switching columns Clear the previous column checkbox, search and button caches after the grid interaction changes the open menu. Keep the new menu state intact. The real UI regression fails on the prior production code and passes with the fix. Validation: filter15, popup6, strict UI all-target Clippy, fmt and WASM pass. Aggregate CI rerun retains only the two unchanged Windows baseline diagnostics. Small CodeRabbit finding validated and fixed directly after the three medium merge-resolution reviews. --- crates/ui-egui/src/grid/show.rs | 9 ++++ .../tests/it/cascading_filter_values.rs | 54 ++++++++++++++++++- 2 files changed, 62 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/grid/show.rs b/crates/ui-egui/src/grid/show.rs index 193d8dc734..ba9b99881d 100644 --- a/crates/ui-egui/src/grid/show.rs +++ b/crates/ui-egui/src/grid/show.rs @@ -337,6 +337,15 @@ fn show_grid_interactions(app: &mut SheetApp, ui: &mut egui::Ui, resp: &egui::Re crate::paper_view::interact(app, ui, resp, geo, sh, wb); interact(app, ui, resp, geo, sh, wb); } + if previous_popups.0 != app.grid.filter_menu + && let Some((col, _, _)) = previous_popups.0 + { + ui.ctx().data_mut(|d| { + d.remove::>(egui::Id::unique(("filter_sel", col))); + d.remove::(egui::Id::unique(("filter_search", col))); + d.remove::>(egui::Id::unique(("filter_buttons", col))); + }); + } update_cursor(app, ui, resp, geo, sh); crate::text_box::show(app, ui, geo, sh); if app.editor.as_ref().is_some_and(|e| !e.from_formula_bar) { diff --git a/crates/ui-egui/tests/it/cascading_filter_values.rs b/crates/ui-egui/tests/it/cascading_filter_values.rs index 0b4e2259bc..8b6a50341b 100644 --- a/crates/ui-egui/tests/it/cascading_filter_values.rs +++ b/crates/ui-egui/tests/it/cascading_filter_values.rs @@ -1,8 +1,10 @@ use crate::common; -use egui::{Event, Key, Modifiers}; +use egui::{Event, Key, Modifiers, PointerButton}; use egui_kittest::kittest::Queryable; use gridcraft_engine::Session; +use gridcraft_engine::core::CellRef; +use gridcraft_ui_egui::grid; use serde_json::json; fn key(h: &mut common::Harness, key: Key, modifiers: Modifiers) { @@ -12,6 +14,56 @@ fn key(h: &mut common::Harness, key: Key, modifiers: Modifiers) { h.run_steps(3); } +fn click_filter(h: &mut common::Harness, cell: &str) { + let app = h.state(); + let sh = app.session.active().unwrap().wb.active().unwrap(); + let geo = grid::Geo::new(sh, app.grid.rect.unwrap(), app.view().scroll); + let at = grid::filter_button_rect(&geo, sh, CellRef::parse(cell).unwrap()).center(); + h.input_mut().events.push(Event::PointerMoved(at)); + for pressed in [true, false] { + h.input_mut().events.push(Event::PointerButton { pos: at, button: PointerButton::Primary, pressed, modifiers: Modifiers::NONE }); + } + h.run_steps(3); +} + +#[test] +fn switching_filter_columns_discards_old_edits_and_recomputes_eligible_choices() { + let mut session = Session::new(); + session.new_workbook(); + session + .execute( + "range.setValues", + json!({"range": "A1", "values": [ + ["Company", "Job"], ["East", "Alpha"], ["East", "Beta"], ["West", "Other"] + ]}), + ) + .unwrap(); + session.execute("data.filter", json!({"range": "A1:B4"})).unwrap(); + session.execute("selection.set", json!({"cell": "B1"})).unwrap(); + let mut h = common::os_harness(session, egui::os::OperatingSystem::Windows); + key(&mut h, Key::ArrowDown, Modifiers::ALT); + h.get_by_label("Other").click(); + h.run_steps(2); + assert_eq!(h.ctx.data(|d| d.get_temp::(egui::Id::unique(("filter_search", 1u32)))).as_deref(), Some("")); + + click_filter(&mut h, "A1"); + assert_eq!(h.state().grid.filter_menu.map(|(col, _, _)| col), Some(0)); + h.ctx.data(|d| { + assert!(d.get_temp::>(egui::Id::unique(("filter_sel", 1u32))).is_none(), "old checkbox edits must be discarded"); + assert!(d.get_temp::(egui::Id::unique(("filter_search", 1u32))).is_none(), "old search must be discarded"); + assert!(d.get_temp::>(egui::Id::unique(("filter_buttons", 1u32))).is_none(), "old button focus IDs must be discarded"); + }); + assert!(h.query_by_label("East").is_some(), "the new column's choices must remain available"); + h.get_by_label("West").click(); + h.run_steps(2); + h.get_by_label("Apply").click(); + h.run_steps(3); + click_filter(&mut h, "B1"); + assert!(h.query_by_label("Alpha").is_some()); + assert!(h.query_by_label("Beta").is_some(), "eligible alternatives must remain available"); + assert!(h.query_by_label("Other").is_none(), "the other column's new criterion must narrow the reopened list"); +} + #[test] fn dropdown_can_change_and_clear_a_column_while_another_filter_stays_active() { for table in [false, true] { From 0de56624d5dd4445d037c5816d25855a53bfd733 Mon Sep 17 00:00:00 2001 From: TheRenegadeDev Date: Sun, 1 Nov 2026 01:05:32 -0500 Subject: [PATCH 4/9] 2641: cover header-only filter tables and manual visibility Exercise the real engine and header-button popup with a genuine header-only table. Verify that its installed AutoFilter offers neither header values nor a phantom blank row, and that the popup dismisses normally. Strengthen the existing manual-hide case to check exact values and selection state. Production filter matching, selection merging and popup caching are unchanged. Ten focused engine, eighteen filter UI and six popup tests, formatting and strict changed-target Clippy pass. Required aggregate CI retains the unchanged baseline Windows CLI lint failure; exact-new-head hosted CI remains pending. --- .../tests/it/cascading_filter_values.rs | 19 ++++++++++++++++++- .../tests/it/cascading_filter_values.rs | 19 +++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/crates/engine/tests/it/cascading_filter_values.rs b/crates/engine/tests/it/cascading_filter_values.rs index 928f3eb0e2..c6d7f4d1e4 100644 --- a/crates/engine/tests/it/cascading_filter_values.rs +++ b/crates/engine/tests/it/cascading_filter_values.rs @@ -135,11 +135,28 @@ fn choices_match_other_columns_but_keep_the_current_columns_unchecked_values() { assert_eq!(choices(&s), vec![("Alpha".into(), true), ("Beta".into(), true), ("(Blanks)".into(), true)]); // Manual visibility is not a filter criterion, even when every eligible row is hidden. s.execute("home.hideRows", json!({"rows": "4:10"})).unwrap(); - assert_eq!(choices(&s).len(), 3); + assert_eq!(choices(&s), vec![("Alpha".into(), true), ("Beta".into(), true), ("(Blanks)".into(), true)]); assert!(filter_values(&s.doc().unwrap().wb, 0, 0).is_empty()); assert!(filter_values(&s.doc().unwrap().wb, 0, 4).is_empty()); } +#[test] +fn a_header_only_table_has_no_data_values_or_blank_choice() { + let mut s = Session::new(); + s.new_workbook(); + s.execute("range.setValues", json!({"range": "B3", "values": [["Company", "Job"]]})).unwrap(); + s.execute("insert.table", json!({"range": "B3:C3", "header": true})).unwrap(); + s.execute("data.filter", json!({"range": "B3:C3"})).unwrap(); + let d = s.doc().unwrap(); + let sh = d.wb.active().unwrap(); + assert!(sh.tables[0].header_row); + assert_eq!(sh.tables[0].range.height(), 1); + assert_eq!(sh.autofilter.as_ref().unwrap().range.a1(), "B3:C3"); + for col in [1, 2] { + assert!(filter_values(&d.wb, 0, col).is_empty(), "headers are not values or blank data rows"); + } +} + #[test] fn choices_respect_blank_and_formatted_value_criteria_on_other_columns() { let mut s = Session::new(); diff --git a/crates/ui-egui/tests/it/cascading_filter_values.rs b/crates/ui-egui/tests/it/cascading_filter_values.rs index 6357cfb7b0..ed33019848 100644 --- a/crates/ui-egui/tests/it/cascading_filter_values.rs +++ b/crates/ui-egui/tests/it/cascading_filter_values.rs @@ -26,6 +26,25 @@ fn click_filter(h: &mut common::Harness, cell: &str) { h.run_steps(3); } +#[test] +fn a_header_only_tables_popup_has_no_value_choices() { + let mut session = Session::new(); + session.new_workbook(); + session.execute("range.setValues", json!({"range": "B3", "values": [["Company", "Job"]]})).unwrap(); + session.execute("insert.table", json!({"range": "B3:C3", "header": true})).unwrap(); + session.execute("selection.set", json!({"cell": "B3"})).unwrap(); + let mut h = common::os_harness(session, egui::os::OperatingSystem::Windows); + click_filter(&mut h, "B3"); + assert_eq!(h.state().grid.filter_menu.map(|(col, row, _)| (col, row)), Some((1, 2))); + let sh = h.state().session.active().unwrap().wb.active().unwrap(); + assert_eq!(sh.tables[0].range.height(), 1); + assert_eq!(sh.autofilter.as_ref().unwrap().range.a1(), "B3:C3"); + assert_eq!(h.ctx.data(|d| d.get_temp::>(egui::Id::unique(("filter_sel", 1u32)))), Some(vec![])); + assert!(h.query_by_label("(Blanks)").is_none()); + key(&mut h, Key::Escape, Modifiers::NONE); + assert!(h.state().grid.filter_menu.is_none()); +} + #[test] fn switching_filter_columns_discards_old_edits_and_recomputes_eligible_choices() { let mut session = Session::new(); From 6c447a808215d0a040206848fe8bfe34d34c0146 Mon Sep 17 00:00:00 2001 From: TheRenegadeDev Date: Sun, 1 Nov 2026 22:58:40 -0600 Subject: [PATCH 5/9] #2641: Clarify AutoFilter documentation scope Move the AutoFilter population discussion into its own section before Keyboard while leaving Shortcut audit under Keyboard. State explicitly that separate table dropdowns outside the active sheet AutoFilter columns remain empty, retaining the separate #2506 activation/roundtrip scope. Update the existing feature history entry. Addresses both outside-diff comments in CodeRabbit5732175733. Documentation only; implementation, tests, dependencies, credits and workflows unchanged. Formatting/parity checks pass. Required local CI hits only the unchanged Windows CLI lint; actual preceding c9 Ubuntu run passed all10 gates and lock verification. New-head hosted CI remains required. Small review findings fixed directly without new agents or tests. --- docs/ui-parity.md | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/docs/ui-parity.md b/docs/ui-parity.md index bed023d49c..f3216bb4dd 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -75,6 +75,24 @@ this logic, with one undo step. | Smooth scrolling, scrollbars | done; vertical scrollbar added 10-09 (#73); horizontal scrollbar in the tab bar (60/40 split, drag, track click pages) 10-13 (#176, #840); dragging the handle at the scrollbar's left edge gives the tabs more or less of the bar; each workbook keeps its share while it is open (not saved in the file) | | Text overflow into empty neighbours, wrap, rotation, shrink to fit | done | +## AutoFilter population and pending integrations + +[Microsoft's filtering guide](https://support.microsoft.com/en-us/excel/get-started/filter-data-in-a-range-or-table-in-excel) +describes additive column filters and restricting other dropdowns to the filtered range. The +current column is excluded from enumeration so its unchecked alternatives remain available. +The existing one-million-data-row enumeration limit and value sorting remain unchanged. + +This changes the population behind the pending row-count work (#1737, and its stacked Only +button #1741): a future count beside a choice should count eligible rows satisfying the other +columns, including rows rejected by the current column. It must not count the whole original +range or just currently visible rows. Search narrows the displayed choices, not that population; +Apply with a search excludes nonmatching values even when another filter hides them. +These PRs are not incorporated here. Date grouping (#1509) should group this same eligible +population. Table filter activation / roundtrip ownership changes remain in #2506. Enumeration +reads the active sheet AutoFilter without changing criteria, row visibility or the XLSX +representation. A separate table dropdown outside that AutoFilter's columns remains empty; +it does not receive choices from its own eligible-row population. + ## Keyboard | Area | Excel | GridCraft | @@ -93,23 +111,6 @@ this logic, with one undo step. | Sequential Alt access keys (Alt, H, N, …) on every ribbon tab | yes | 364-sequence keytip table for all tabs: per-control badges, prefix waiting, dropdowns open for editing (type/arrows/Enter), pending bindings for not-yet-built commands; letters also work with left Alt held (Alt+H, O, A), as in Excel; each Borders letter (H, B, …) draws its own preset, H, B, M opens Format Cells on the Border tab, and Erase Border, Line Color and Line Style are reserved; QAT/Backstage excluded | | Requests | — | #110 (more shortcuts and hot keys), #33 (sequential Alt; initial support landed in #43) | -### AutoFilter population and pending integrations - -[Microsoft's filtering guide](https://support.microsoft.com/en-us/excel/get-started/filter-data-in-a-range-or-table-in-excel) -describes additive column filters and restricting other dropdowns to the filtered range. The -current column is excluded from enumeration so its unchecked alternatives remain available. -The existing one-million-data-row enumeration limit and value sorting remain unchanged. - -This changes the population behind the pending row-count work (#1737, and its stacked Only -button #1741): a future count beside a choice should count eligible rows satisfying the other -columns, including rows rejected by the current column. It must not count the whole original -range or just currently visible rows. Search narrows the displayed choices, not that population; -Apply with a search excludes nonmatching values even when another filter hides them. -These PRs are not incorporated here. Date grouping (#1509) should group this same eligible -population. Table filter activation / roundtrip ownership changes remain in #2506; enumeration -reads the active sheet AutoFilter used by the current table dropdown without changing criteria, -row visibility or the XLSX representation. - ### Shortcut audit (#110) Checked against Microsoft's published "Keyboard shortcuts in Excel" (Windows and Mac tables, @@ -214,7 +215,7 @@ scrollbar bugs 2–4 · pixel/feel pass against observed Excel 7–12. | Date | Change | Summary | |---|---|---| -| 2026-11-01 | minor | Filter popup checkbox edits, search and button state belong to their document window; switching columns in another window no longer discards an open popup's pending choices (#2641) | +| 2026-11-01 | minor | Filter popup checkbox edits, search and button state belong to their document window; switching columns in another window no longer discards an open popup's pending choices (#2641); the separate AutoFilter section documents the empty dropdown outside the active sheet filter columns (#2506) | | 2026-11-01 | minor | Chart Design › Add Chart Element offers Data Table with/no legend keys and None; Format Chart Area has a Data Table section with visibility, legend keys, horizontal/vertical borders and outline. Both use engine commands. | | 2026-11-01 | minor | Page Setup has a Page order choice (Down, then over, the default, or Over, then down) with a small picture of the order, also when Print Titles opens it on its Sheet tab; OK sets it with the margins in one undo step. Printing, PDF export, the print preview, Page Break Preview's page numbers and Page Layout view's headers and footers follow the order. The dialog is in German now too | | 2026-11-01 | minor | Formulas › Error Checking › Trace Error (`formulas.traceError`): red arrows from the cell an error starts in to the selected cell, through the first reference showing the same error at each step, and blue arrows from that cell's own references, as measured in Excel; the command returns the source and the arrows | From c01eb6cd2a0a4fb9af0652a6d284f74e903ae237 Mon Sep 17 00:00:00 2001 From: TheRenegadeDev Date: Wed, 4 Nov 2026 22:24:34 -0600 Subject: [PATCH 6/9] #2641: Preserve active filter choices and index Values matching Root verified both findings, red/green regression, matcher semantics and all five quality axes; see review-4476435045-decisions.md. No additional delegate for small confirmed fixes. Fourteen scoped steps pass on the recorded tree, including engine/UI suites, strict Clippy and standalone gates. Required aggregate CI stops only at unchanged Windows CLI check.rs281; later stages skipped. Fresh hosted validation pending. --- crates/engine/src/cmd/data/filter.rs | 99 ++++++++++--------- .../tests/it/cascading_filter_values.rs | 92 +++++++++++++++-- docs/ui-parity.md | 9 +- 3 files changed, 139 insertions(+), 61 deletions(-) diff --git a/crates/engine/src/cmd/data/filter.rs b/crates/engine/src/cmd/data/filter.rs index c76701ad1d..18688e7412 100644 --- a/crates/engine/src/cmd/data/filter.rs +++ b/crates/engine/src/cmd/data/filter.rs @@ -3,6 +3,7 @@ use super::{ AutoFilter, CellRef, EngineError, FilterCriterion, Json, Ordering, RangeRef, Result, Session, Sheet, Value, Workbook, bad, bool_param, col_param, current_region, data_target, edit, json, }; +use std::collections::{HashMap, HashSet}; // ---------------------------------------------------------------- filter @@ -181,14 +182,11 @@ pub(crate) fn grow_autofilter(sh: &mut Sheet, at: CellRef) { } /// Statistics use the original range, regardless of the other active criteria. -fn filter_stats(sh: &Sheet, af: &AutoFilter, excluded_offset: Option) -> std::collections::HashMap, f64)> { +fn filter_stats(sh: &Sheet, af: &AutoFilter) -> HashMap, f64)> { let r = af.range; // Precompute per-criterion top10 threshold and average once, not per row. - let mut col_stats: std::collections::HashMap, f64)> = std::collections::HashMap::new(); + let mut col_stats = HashMap::new(); for (i, (off, c)) in af.criteria.iter().enumerate() { - if Some(*off) == excluded_offset { - continue; - } if matches!(c, FilterCriterion::Top10 { .. } | FilterCriterion::AboveAverage(_)) { let Some(col) = r.start.col.checked_add(*off) else { continue }; let mut nums: Vec = (r.start.row + 1..=r.end.row).filter_map(|row| sh.value(CellRef::new(row, col)).as_f64()).collect(); @@ -208,29 +206,46 @@ fn filter_stats(sh: &Sheet, af: &AutoFilter, excluded_offset: Option) -> st col_stats } -/// Evaluate criteria directly, without conflating manual visibility with filter results. -fn filter_row_matches( - wb: &Workbook, - sh: &Sheet, - af: &AutoFilter, - row: u32, - col_stats: &std::collections::HashMap, f64)>, - excluded_offset: Option, -) -> bool { - for (i, (off, crit)) in af.criteria.iter().enumerate() { - if Some(*off) == excluded_offset { - continue; - } - let Some(col) = af.range.start.col.checked_add(*off) else { continue }; +/// Shared row and checkbox matching, with thresholds and Values lookups prepared once per query. +struct FilterMatcher<'a> { + wb: &'a Workbook, + sh: &'a Sheet, + af: &'a AutoFilter, + stats: HashMap, f64)>, + values: HashMap>, +} + +impl<'a> FilterMatcher<'a> { + fn new(wb: &'a Workbook, sh: &'a Sheet, af: &'a AutoFilter) -> Self { + let values = af + .criteria + .iter() + .enumerate() + .filter_map(|(i, (_, crit))| match crit { + FilterCriterion::Values { values, .. } => Some((i, values.iter().map(|v| v.to_ascii_lowercase()).collect())), + _ => None, + }) + .collect(); + Self { wb, sh, af, stats: filter_stats(sh, af), values } + } + + fn row_matches(&self, row: u32, excluded_offset: Option) -> bool { + self.af.criteria.iter().enumerate().all(|(i, (off, crit))| Some(*off) == excluded_offset || self.criterion_matches(row, i, *off, crit)) + } + + fn criterion_matches(&self, row: u32, i: usize, off: u32, crit: &FilterCriterion) -> bool { + let Some(col) = self.af.range.start.col.checked_add(off) else { return true }; let c = CellRef::new(row, col); - let v = sh.value(c); - let text = crate::display::cell_text(wb, sh, c); - let ok = match crit { - FilterCriterion::Values { values, blanks } => { + let v = self.sh.value(c); + let text = crate::display::cell_text(self.wb, self.sh, c); + match crit { + FilterCriterion::Values { blanks, .. } => { if filter_blank(&v) { *blanks } else { - values.iter().any(|x| x.eq_ignore_ascii_case(&text) || x.eq_ignore_ascii_case(&v.display())) + self.values + .get(&i) + .is_some_and(|values| values.contains(&text.to_ascii_lowercase()) || values.contains(&v.display().to_ascii_lowercase())) } } FilterCriterion::Custom { a, b, and } => { @@ -243,14 +258,14 @@ fn filter_row_matches( None => x, } } - FilterCriterion::Top10 { bottom, .. } => match (v.as_f64(), col_stats.get(&i)) { + FilterCriterion::Top10 { bottom, .. } => match (v.as_f64(), self.stats.get(&i)) { (Some(n), Some((thr, _))) => { let thr = thr.unwrap_or(n); if *bottom { n <= thr } else { n >= thr } } _ => false, }, - FilterCriterion::AboveAverage(above) => match (v.as_f64(), col_stats.get(&i)) { + FilterCriterion::AboveAverage(above) => match (v.as_f64(), self.stats.get(&i)) { (Some(n), Some((_, avg))) => { if *above { n > *avg @@ -260,16 +275,12 @@ fn filter_row_matches( } _ => false, }, - FilterCriterion::FillColor(col) => wb.styles.get(sh.style_id(c)).fill.fg == *col, - FilterCriterion::FontColor(col) => wb.styles.get(sh.style_id(c)).font.color == *col, + FilterCriterion::FillColor(col) => self.wb.styles.get(self.sh.style_id(c)).fill.fg == *col, + FilterCriterion::FontColor(col) => self.wb.styles.get(self.sh.style_id(c)).font.color == *col, // Icon criteria are retained from files but cannot be evaluated yet. FilterCriterion::Icon { .. } => true, - }; - if !ok { - return false; } } - true } /// Hides rows of the autofilter range that fail any criterion. @@ -277,12 +288,11 @@ pub(crate) fn apply_filter(wb: &mut Workbook, sheet: usize) { let Some(sh) = wb.sheet(sheet) else { return }; let Some(af) = sh.autofilter.clone() else { return }; let r = af.range; - let col_stats = filter_stats(sh, &af, None); + let matcher = FilterMatcher::new(wb, sh, &af); // Reapplying a retained icon filter preserves visibility until icons can be evaluated. let has_icon = af.criteria.iter().any(|(_, c)| matches!(c, FilterCriterion::Icon { .. })); - let hide: Vec<_> = (r.start.row + 1..=r.end.row) - .map(|row| (row, !filter_row_matches(wb, sh, &af, row, &col_stats, None) || (has_icon && sh.is_row_hidden(row)))) - .collect(); + let hide: Vec<_> = + (r.start.row + 1..=r.end.row).map(|row| (row, !matcher.row_matches(row, None) || (has_icon && sh.is_row_hidden(row)))).collect(); let Some(shm) = wb.sheet_mut(sheet) else { return }; for (row, h) in hide { if h { @@ -345,27 +355,18 @@ fn column_filter_values(wb: &Workbook, sheet: usize, col: u32, eligible_only: bo return vec![]; } let off = col - af.range.start.col; - let selected: Option<&FilterCriterion> = af.criteria.iter().find(|(o, _)| *o == off).map(|(_, c)| c); - let col_stats = if eligible_only { filter_stats(sh, af, Some(off)) } else { Default::default() }; + let selected = af.criteria.iter().enumerate().find(|(_, (o, _))| *o == off); + let matcher = FilterMatcher::new(wb, sh, af); let mut seen = std::collections::BTreeMap::new(); for row in af.range.start.row.saturating_add(1)..=af.range.end.row.min(af.range.start.row.saturating_add(1_000_000)) { - if eligible_only && !filter_row_matches(wb, sh, af, row, &col_stats, Some(off)) { + if eligible_only && !matcher.row_matches(row, Some(off)) { continue; } let c = CellRef::new(row, col); let v = sh.value(c); let blank = filter_blank(&v); let t = if blank { "(Blanks)".to_string() } else { crate::display::cell_text(wb, sh, c) }; - let on = match selected { - Some(FilterCriterion::Values { values, blanks }) => { - if blank { - *blanks - } else { - values.iter().any(|x| x.eq_ignore_ascii_case(&t)) - } - } - _ => true, - }; + let on = selected.is_none_or(|(i, (off, crit))| matcher.criterion_matches(row, i, *off, crit)); let key = if blank { sort_key(&Value::Empty) } else { sort_key(&v) }; seen.entry((key, t)).or_insert(on); } diff --git a/crates/engine/tests/it/cascading_filter_values.rs b/crates/engine/tests/it/cascading_filter_values.rs index 45346b39a1..345c4f4da5 100644 --- a/crates/engine/tests/it/cascading_filter_values.rs +++ b/crates/engine/tests/it/cascading_filter_values.rs @@ -63,14 +63,14 @@ fn slicer_criteria_outside_the_sheet_filters_columns_are_still_applied() { #[test] fn choices_use_the_same_custom_and_statistical_criteria_as_filtering() { - for (criterion, expected) in [ - (json!({"custom": {"op": ">=", "value": 20, "op2": "<", "value2": 100}}), vec!["mid", "upper"]), - (json!({"custom": {"op": "=", "value": 10, "op2": "=", "value2": 100, "and": false}}), vec!["high", "low"]), - (json!({"custom": {"op": "=", "value": "n?*"}}), vec!["text"]), - (json!({"top": {"count": 2}}), vec!["high", "upper"]), - (json!({"top": {"count": 50, "percent": true, "bottom": true}}), vec!["low", "mid"]), - (json!({"aboveAverage": true}), vec!["high"]), - (json!({"aboveAverage": false}), vec!["low", "mid", "upper"]), + for (criterion, expected, mid_checked) in [ + (json!({"custom": {"op": ">=", "value": 20, "op2": "<", "value2": 100}}), vec!["mid", "upper"], true), + (json!({"custom": {"op": "=", "value": 10, "op2": "=", "value2": 100, "and": false}}), vec!["high", "low"], false), + (json!({"custom": {"op": "=", "value": "n?*"}}), vec!["text"], false), + (json!({"top": {"count": 2}}), vec!["high", "upper"], false), + (json!({"top": {"count": 50, "percent": true, "bottom": true}}), vec!["low", "mid"], true), + (json!({"aboveAverage": true}), vec!["high"], false), + (json!({"aboveAverage": false}), vec!["low", "mid", "upper"], true), ] { let mut s = Session::new(); s.new_workbook(); @@ -93,8 +93,8 @@ fn choices_use_the_same_custom_and_statistical_criteria_as_filtering() { assert_eq!(actual, expected, "{criterion}, with the current column filtered"); assert_eq!( filter_values(&s.doc().unwrap().wb, 0, 1), - vec![("20".into(), true)], - "the numeric column's own criterion must be excluded: {criterion}" + vec![("20".into(), mid_checked)], + "the numeric column's criterion sets checkboxes without excluding alternatives: {criterion}" ); } } @@ -220,6 +220,7 @@ fn choices_match_color_criteria_and_do_not_infer_icon_matches_from_hidden_rows() sh.autofilter.as_mut().unwrap().criteria = vec![(1, criterion)]; s.execute("data.reapply", json!({})).unwrap(); assert_eq!(filter_values(&s.doc().unwrap().wb, 0, 0), vec![("red".into(), true)]); + assert_eq!(filter_selection(&s.doc().unwrap().wb, 0, 1, &[]), vec![("1".into(), true), ("2".into(), false)]); } let sh = Arc::make_mut(&mut s.doc_mut().unwrap().wb).sheet_mut(0).unwrap(); sh.autofilter.as_mut().unwrap().criteria = vec![(1, FilterCriterion::Icon { set: "3Arrows".into(), id: Some(0) })]; @@ -283,3 +284,74 @@ fn choices_are_bounded_at_the_last_sheet_row_and_empty_for_missing_data() { s.execute("data.filterBy", json!({"column": "B", "values": ["East"]})).unwrap(); assert_eq!(filter_values(&s.doc().unwrap().wb, 0, 2), vec![("Last East".into(), true)]); } + +#[test] +fn merging_hidden_choices_preserves_the_active_criterion() { + for (criterion, checked) in [ + (json!({"values": ["7"], "blanks": true}), [false, true, false, false, true]), + (json!({"custom": {"op": ">=", "value": 7}}), [false, true, true, true, false]), + (json!({"top": {"count": 2}}), [false, false, true, true, false]), + (json!({"aboveAverage": true}), [false, false, false, true, false]), + (json!({"aboveAverage": false}), [true, true, true, false, false]), + ] { + let mut s = Session::new(); + s.new_workbook(); + s.execute( + "range.setValues", + json!({"range": "A1", "values": [["Region", "Amount"], ["East", 1], ["East", 9], ["West", 7], ["West", 20], ["West", null]]}), + ) + .unwrap(); + s.execute("home.numberFormat", json!({"range": "B2:B6", "code": "0.00"})).unwrap(); + s.execute("data.filter", json!({"range": "A1:B6"})).unwrap(); + s.execute("data.filterBy", json!({"column": "A", "values": ["East"]})).unwrap(); + let mut params = criterion.clone(); + params["column"] = json!("B"); + s.execute("data.filterBy", params).unwrap(); + let doc = s.doc().unwrap(); + let choices = filter_values(&doc.wb, 0, 1); + let selection = filter_selection(&doc.wb, 0, 1, &choices); + let expected: Vec<_> = + ["1.00", "7.00", "9.00", "20.00", "(Blanks)"].into_iter().zip(checked).map(|(label, on)| (label.to_string(), on)).collect(); + assert_eq!(selection, expected, "unchanged eligible choices must preserve hidden matches: {criterion}"); + let values: Vec<_> = selection.iter().filter(|(label, on)| *on && label != "(Blanks)").map(|(label, _)| label.clone()).collect(); + s.execute("data.filterBy", json!({"column": "B", "values": values, "blanks": checked[4]})).unwrap(); + s.execute("data.filterBy", json!({"column": "A", "clear": true})).unwrap(); + let sh = s.doc().unwrap().wb.active().unwrap(); + for (row, on) in [checked[0], checked[2], checked[1], checked[3], checked[4]].into_iter().enumerate() { + assert_eq!(!sh.is_row_hidden(row as u32 + 1), on, "row after Apply and clearing the other filter: {criterion}"); + } + } +} + +#[test] +fn large_values_criteria_preserve_ascii_case_and_blank_matching() { + use gridcraft_engine::core::RangeRef; + use gridcraft_engine::model::AutoFilter; + let mut s = Session::new(); + s.new_workbook(); + let sh = Arc::make_mut(&mut s.doc_mut().unwrap().wb).sheet_mut(0).unwrap(); + let mut selected = Vec::new(); + for row in 1..=5_000 { + sh.set_cell(CellRef::new(row, 0), Cell { value: Value::Text(format!("item-{row}").into()), ..Default::default() }); + sh.set_cell(CellRef::new(row, 1), Cell { value: Value::Number(f64::from(row)), ..Default::default() }); + selected.push(format!("ITEM-{row}")); + } + selected.extend(["ITEM-1".into(), "Ä".into()]); + for (row, value, label) in [ + (5_001, Value::Text("Ä".into()), "unicode selected"), + (5_002, Value::Text("ä".into()), "unicode excluded"), + (5_003, Value::Empty, "blank row"), + ] { + sh.set_cell(CellRef::new(row, 0), Cell { value, ..Default::default() }); + sh.set_cell(CellRef::new(row, 1), Cell { value: Value::Text(label.into()), ..Default::default() }); + } + sh.autofilter = Some(AutoFilter { + range: RangeRef::new(CellRef::new(0, 0), CellRef::new(5_003, 1)), + criteria: vec![(0, FilterCriterion::Values { values: selected, blanks: true })], + }); + let choices = filter_values(&s.doc().unwrap().wb, 0, 1); + assert_eq!(choices.len(), 5_002); + assert!(choices.contains(&("unicode selected".into(), true))); + assert!(choices.contains(&("blank row".into(), true))); + assert!(!choices.iter().any(|(label, _)| label == "unicode excluded")); +} diff --git a/docs/ui-parity.md b/docs/ui-parity.md index c94ccb7550..eb86b356e7 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -1,6 +1,6 @@ # UI parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-03 · **Change:** minor (cascading AutoFilter choices and pending popup selections per document window; form controls: buttons, sliders and spin buttons on the sheet; earlier: Highlight the active cell's row, a global preference in File › Options › General; earlier: a linked cell's menu edits, opens or removes the link; earlier: Display options for this workbook: sheet tabs and scroll bars; earlier: dragging over row or column headers in point mode extends the reference; earlier: a picture on the system clipboard pastes as a floating picture at the active cell with Cmd/Ctrl+V or Paste (#699); earlier: frozen columns keep their text, gridlines and merged borders whole while the sheet scrolls (#2544); earlier: every Paste Special option has its access key; earlier: the Draw tab's live stroke preview uses the pen's colour and thickness; earlier: copy quotes only cells with a tab or line break, as Excel does; earlier: Ctrl+. Next Corner of Selection; earlier: dragging the selection's border onto data asks before replacing it; earlier: RefEdit reference boxes in dialogs: Goal Seek, Solver and Data Analysis use them, the arrow keys select while a dialog is collapsed and F4 cycles a reference's anchors; earlier: Python cells: Python mode in the formula bar; earlier: Insert › Equation and the equation editor; earlier: every floating object selects, resizes from eight handles and deletes with the keyboard; earlier: Formulas › Error Checking › Trace Error; trace arrows stay through a zoom (#3097); earlier: Page Setup sets the page order, Down, then over or Over, then down, which printing, the print preview, Page Break Preview and Page Layout view follow; earlier: Formulas › Function Library as labelled buttons with category menus; Recently Used and the Insert Function categories; Esc leaves a File-page text field before closing the view; earlier: checkbox cells print as boxes; Ctrl+arrow and Ctrl+Shift+arrow while pointing a formula reference; editing a hyperlink loads its existing fields; AutoSum over a selected row puts its total to the right; ribbon catalog count 276 / 292) · **Target:** Microsoft Excel (Microsoft 365), Excel for Mac 16.113.4 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-04 · **Change:** minor (AutoFilter checkbox state follows the active criterion and Values lookups are prepared once per query; earlier: cascading AutoFilter choices and pending popup selections per document window; form controls: buttons, sliders and spin buttons on the sheet; earlier: Highlight the active cell's row, a global preference in File › Options › General; earlier: a linked cell's menu edits, opens or removes the link; earlier: Display options for this workbook: sheet tabs and scroll bars; earlier: dragging over row or column headers in point mode extends the reference; earlier: a picture on the system clipboard pastes as a floating picture at the active cell with Cmd/Ctrl+V or Paste (#699); earlier: frozen columns keep their text, gridlines and merged borders whole while the sheet scrolls (#2544); earlier: every Paste Special option has its access key; earlier: the Draw tab's live stroke preview uses the pen's colour and thickness; earlier: copy quotes only cells with a tab or line break, as Excel does; earlier: Ctrl+. Next Corner of Selection; earlier: dragging the selection's border onto data asks before replacing it; earlier: RefEdit reference boxes in dialogs: Goal Seek, Solver and Data Analysis use them, the arrow keys select while a dialog is collapsed and F4 cycles a reference's anchors; earlier: Python cells: Python mode in the formula bar; earlier: Insert › Equation and the equation editor; earlier: every floating object selects, resizes from eight handles and deletes with the keyboard; earlier: Formulas › Error Checking › Trace Error; trace arrows stay through a zoom (#3097); earlier: Page Setup sets the page order, Down, then over or Over, then down, which printing, the print preview, Page Break Preview and Page Layout view follow; earlier: Formulas › Function Library as labelled buttons with category menus; Recently Used and the Insert Function categories; Esc leaves a File-page text field before closing the view; earlier: checkbox cells print as boxes; Ctrl+arrow and Ctrl+Shift+arrow while pointing a formula reference; editing a hyperlink loads its existing fields; AutoSum over a selected row puts its total to the right; ribbon catalog count 276 / 292) · **Target:** Microsoft Excel (Microsoft 365), Excel for Mac 16.113.4 Interaction, controls and feel, against Excel. Part of [target-app-parity.md](target-app-parity.md). **UI/UX fidelity: ~55% ready, 50–80 h** (estimated). Ribbon command coverage is measured @@ -14,6 +14,7 @@ Sources: `crates/ui-egui/src` (ribbon, grid, editor, formula bar, dialogs, panes | Element | Excel | GridCraft | Status | |---|---|---|---| +| 2026-11-04 | minor | AutoFilter checkboxes and hidden-choice merging use the active row criterion, including raw/formatted Values, custom comparisons, Top 10, averages and colors; Values criteria use one prepared ASCII-insensitive lookup per query (#2641) | | 2026-10-14 | minor | Dialogs (Find and Replace, Go To, Format Cells, Sort and the rest) move by their title bar instead of staying pinned to the centre (#1250) | | Title bar, Quick Access Toolbar, AutoSave toggle | yes | yes | done; macOS window controls misaligned (#170), Dock icon size (#169) | | Ribbon: tabs, groups, split buttons, galleries, contextual tabs | yes | yes (Table Design, Chart Design, Format, PivotTable, Header & Footer tabs); Fill Color, Font Color and the Format Cells colour pickers end with Recent Colors and More Colors… (#928); large split buttons (Formulas › AutoSum); arrows at the card's edges scroll a tab wider than the window | done; missing contextual tabs for pictures, shapes, sparklines, slicers; groups do not collapse when narrow | @@ -86,6 +87,10 @@ this logic, with one undo step. describes additive column filters and restricting other dropdowns to the filtered range. The current column is excluded from enumeration so its unchecked alternatives remain available. The existing one-million-data-row enumeration limit and value sorting remain unchanged. +Checkbox state uses the row matcher for the active criterion, including raw and formatted +Values matches, custom comparisons, numeric thresholds and colors. Hidden choices retain +that state when Apply merges the eligible edits. Values criteria prepare ASCII-insensitive +lookup sets once per query rather than scanning every selected value for each row. This changes the population behind the pending row-count work (#1737, and its stacked Only button #1741): a future count beside a choice should count eligible rows satisfying the other @@ -287,7 +292,7 @@ scrollbar bugs 2–4 · pixel/feel pass against observed Excel 7–12. | 2026-10-31 | minor | Esc in a File-page text field leaves the field and cancels editing; the next Esc returns to the sheet (#3035) | | 2026-10-31 | minor | Recently Used lists the functions most recently entered in a formula from any source, kept with the preferences; the Insert Function dialog is titled as in Excel, its category list (Most Recently Used, All, each category) works, and its category column follows the widest name shown | | 2026-10-31 | minor | Formulas › Function Library: Insert Function, the AutoSum split button and three columns of labelled small buttons with category colours; category menus end with Insert Function…; More Functions cascades; Home › Editing shares the AutoSum menu; MR key tip for Recently Used | -| 2026-10-30 | minor | AutoFilter choices cascade across other columns while retaining current-column alternatives and blanks (#2641); Apply without search preserves selected and excluded values and blanks hidden by other filters; searched Apply excludes hidden nonmatches while retaining hidden matches; document pending counts, date grouping and table roundtrip integration; retain slicer row filtering when its criterion is outside the sheet filter columns | +| 2026-10-30 | minor | AutoFilter choices cascade across other columns while retaining current-column alternatives and blanks (#2641); Apply without search preserves selected and excluded values and blanks hidden by other filters; searched Apply excludes hidden nonmatches while retaining hidden matches; documents pending counts, date grouping and table roundtrip integration; retains slicer row filtering when its criterion is outside the sheet filter columns | | 2026-10-30 | minor | Checkbox cells print and export to PDF as boxes, as on screen: unchecked white with a grey outline, checked green with a white tick (#2972). They printed their value as TRUE or FALSE; other values in a checkbox cell still print as text | | 2026-10-29 | minor | Formula pointing from the keyboard: Ctrl+arrow (⌘arrow) moves the pointed cell to the edge of its data and Ctrl+Shift+arrow (⌘⇧arrow) extends the pointed range there, as the same keys move and extend the selection, so typing `=COUNTIF(`, clicking the top of a column and pressing ⌘⇧↓ points at the whole column of data; the keys used to move or extend by one cell. A range reaching the sheet edge is written as whole columns or rows (`A:B`). The editor reads the modifiers of the arrow's own key event, so a keystroke pressed and released within one frame (a control client's `ui.key`, an automation tool) keeps its Shift and Ctrl | | 2026-10-29 | minor | Insert Hyperlink opens with an existing link's address, display text and ScreenTip (#2876). An address-only edit preserves the cell's content and formula; Cancel leaves the link unchanged, and Undo restores the edit | From 1baac9125c76b349ef9316f6e8b43d6c13171a02 Mon Sep 17 00:00:00 2001 From: TheRenegadeDev Date: Wed, 4 Nov 2026 22:54:44 -0600 Subject: [PATCH 7/9] #2641: Put the parity revision entry in its history table Move the existing Nov4 row intact out of Window and chrome. All other lines and all production/test/dependency trees are identical to the preceding head. Structural and fmt checks pass; required aggregate CI still stops only at the unchanged Windows CLI lint. Runtime suites are not repeated for this documentation-only move. --- docs/ui-parity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ui-parity.md b/docs/ui-parity.md index eb86b356e7..568fd86479 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -14,7 +14,6 @@ Sources: `crates/ui-egui/src` (ribbon, grid, editor, formula bar, dialogs, panes | Element | Excel | GridCraft | Status | |---|---|---|---| -| 2026-11-04 | minor | AutoFilter checkboxes and hidden-choice merging use the active row criterion, including raw/formatted Values, custom comparisons, Top 10, averages and colors; Values criteria use one prepared ASCII-insensitive lookup per query (#2641) | | 2026-10-14 | minor | Dialogs (Find and Replace, Go To, Format Cells, Sort and the rest) move by their title bar instead of staying pinned to the centre (#1250) | | Title bar, Quick Access Toolbar, AutoSave toggle | yes | yes | done; macOS window controls misaligned (#170), Dock icon size (#169) | | Ribbon: tabs, groups, split buttons, galleries, contextual tabs | yes | yes (Table Design, Chart Design, Format, PivotTable, Header & Footer tabs); Fill Color, Font Color and the Format Cells colour pickers end with Recent Colors and More Colors… (#928); large split buttons (Formulas › AutoSum); arrows at the card's edges scroll a tab wider than the window | done; missing contextual tabs for pictures, shapes, sparklines, slicers; groups do not collapse when narrow | @@ -266,6 +265,7 @@ scrollbar bugs 2–4 · pixel/feel pass against observed Excel 7–12. | Date | Change | Summary | |---|---|---| +| 2026-11-04 | minor | AutoFilter checkboxes and hidden-choice merging use the active row criterion, including raw/formatted Values, custom comparisons, Top 10, averages and colors; Values criteria use one prepared ASCII-insensitive lookup per query (#2641) | | 2026-11-02 | minor | Form controls: buttons, sliders (scroll bars) and spin buttons placed, worked, selected and edited on the sheet (Insert › Controls, Assign Action, Format Control); catalog 281 / 296 | | 2026-11-03 | minor | Highlight the active cell's row: a global preference that tints the whole row, off by default | | 2026-11-03 | minor | The formula bar's bottom edge is a resize handle: dragging it sets the bar's height in whole lines, up to half the window, and dragging it to one line collapses it; expanding (the chevron, Ctrl+Shift+U) returns to the dragged height, which is kept with the UI preferences. `view.expandFormulaBar {lines}` sets it (#1246) | From f0de6913d1acbd9e4f8c96f7a5e918a282fe1013 Mon Sep 17 00:00:00 2001 From: TheRenegadeDev Date: Wed, 4 Nov 2026 23:01:12 -0600 Subject: [PATCH 8/9] #2641: Assert every large Values filter choice Strengthen the existing fixture to check the complete sorted list and checkbox states. Production, docs, manifests and lock unchanged. Engine integration113, strict engine Clippy, fmt and diff checks pass. Required aggregate CI stops only at unchanged Windows CLI check.rs281; later aggregate stages skipped. --- crates/engine/tests/it/cascading_filter_values.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/engine/tests/it/cascading_filter_values.rs b/crates/engine/tests/it/cascading_filter_values.rs index 345c4f4da5..125df8b5c6 100644 --- a/crates/engine/tests/it/cascading_filter_values.rs +++ b/crates/engine/tests/it/cascading_filter_values.rs @@ -350,8 +350,7 @@ fn large_values_criteria_preserve_ascii_case_and_blank_matching() { criteria: vec![(0, FilterCriterion::Values { values: selected, blanks: true })], }); let choices = filter_values(&s.doc().unwrap().wb, 0, 1); - assert_eq!(choices.len(), 5_002); - assert!(choices.contains(&("unicode selected".into(), true))); - assert!(choices.contains(&("blank row".into(), true))); - assert!(!choices.iter().any(|(label, _)| label == "unicode excluded")); + let mut expected: Vec<_> = (1..=5_000).map(|n| (n.to_string(), true)).collect(); + expected.extend([("blank row".into(), true), ("unicode selected".into(), true)]); + assert_eq!(choices, expected); } From 19b8009d2a45b1b96d00537f1ccea928d144f0f0 Mon Sep 17 00:00:00 2001 From: TheRenegadeDev Date: Tue, 10 Nov 2026 08:04:37 -0600 Subject: [PATCH 9/9] 2641: preserve filter choices across colors and window actions Keep a duplicate value checked when any eligible row matches the current criterion. Stop processing outgoing popup state when a form button switches the active window during grid interaction. Add regressions for fill/font color duplicates, other-column exclusion, unchanged Apply, and a real button press preserving another window's search and checkbox edits. --- crates/engine/src/cmd/data/filter.rs | 3 +- .../tests/it/cascading_filter_values.rs | 39 +++++++++++++ crates/ui-egui/src/grid/show.rs | 5 ++ .../tests/it/cascading_filter_values.rs | 56 +++++++++++++++++++ docs/ui-parity.md | 8 ++- 5 files changed, 107 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/cmd/data/filter.rs b/crates/engine/src/cmd/data/filter.rs index a94c0efcae..b9d794b56d 100644 --- a/crates/engine/src/cmd/data/filter.rs +++ b/crates/engine/src/cmd/data/filter.rs @@ -368,7 +368,8 @@ fn column_filter_values(wb: &Workbook, sheet: usize, col: u32, eligible_only: bo let t = if blank { "(Blanks)".to_string() } else { crate::display::cell_text(wb, sh, c) }; let on = selected.is_none_or(|(i, (off, crit))| matcher.criterion_matches(row, i, *off, crit)); let key = if blank { sort_key(&Value::Empty) } else { sort_key(&v) }; - seen.entry((key, t)).or_insert(on); + // One choice can represent rows with different colors; keep any matching row checked. + *seen.entry((key, t)).or_insert(false) |= on; } let mut values: Vec<_> = seen.into_iter().collect(); values.sort_by(|((a, ta), _), ((b, tb), _)| { diff --git a/crates/engine/tests/it/cascading_filter_values.rs b/crates/engine/tests/it/cascading_filter_values.rs index 125df8b5c6..afd72ef00b 100644 --- a/crates/engine/tests/it/cascading_filter_values.rs +++ b/crates/engine/tests/it/cascading_filter_values.rs @@ -233,6 +233,45 @@ fn choices_match_color_criteria_and_do_not_infer_icon_matches_from_hidden_rows() ); } +#[test] +fn duplicate_color_choices_keep_any_eligible_match() { + for font in [false, true] { + for matching_cell in ["B2", "B3"] { + let mut s = Session::new(); + s.new_workbook(); + s.execute( + "range.setValues", + json!({"range": "A1", "values": [["Company", "Color"], ["East", "Same"], ["East", "Same"], ["West", "Same"]]}), + ) + .unwrap(); + let command = if font { "home.fontColor" } else { "home.fillColor" }; + s.execute(command, json!({"range": "B4", "color": "#FF0000"})).unwrap(); + s.execute("data.filter", json!({"range": "A1:B4"})).unwrap(); + let color = if font { FilterCriterion::FontColor(Color::Rgb(0xFF0000)) } else { FilterCriterion::FillColor(Color::Rgb(0xFF0000)) }; + let sh = Arc::make_mut(&mut s.doc_mut().unwrap().wb).sheet_mut(0).unwrap(); + sh.autofilter.as_mut().unwrap().criteria = vec![(0, FilterCriterion::Values { values: vec!["East".into()], blanks: false }), (1, color)]; + s.execute("data.reapply", json!({})).unwrap(); + assert_eq!( + filter_values(&s.doc().unwrap().wb, 0, 1), + vec![("Same".into(), false)], + "an excluded red row cannot check an eligible choice" + ); + + s.execute(command, json!({"range": matching_cell, "color": "#FF0000"})).unwrap(); + s.execute("data.reapply", json!({})).unwrap(); + let choices = filter_values(&s.doc().unwrap().wb, 0, 1); + assert_eq!(choices, vec![("Same".into(), true)], "either eligible duplicate can supply the color match"); + let selected = filter_selection(&s.doc().unwrap().wb, 0, 1, &choices); + assert_eq!(selected, vec![("Same".into(), true)]); + let values: Vec<_> = selected.into_iter().filter_map(|(value, on)| on.then_some(value)).collect(); + s.execute("data.filterBy", json!({"column": "B", "values": values})).unwrap(); + let sh = s.doc().unwrap().wb.active().unwrap(); + assert!(!sh.is_row_hidden(CellRef::parse(matching_cell).unwrap().row), "unchanged Apply keeps the previously matching row"); + assert!(sh.is_row_hidden(3), "the other column still excludes West"); + } + } +} + #[test] fn querying_a_table_backed_sheet_filter_is_read_only_and_preserves_xlsx_criteria() { for table in [false, true] { diff --git a/crates/ui-egui/src/grid/show.rs b/crates/ui-egui/src/grid/show.rs index 178039abe7..13aed13989 100644 --- a/crates/ui-egui/src/grid/show.rs +++ b/crates/ui-egui/src/grid/show.rs @@ -360,6 +360,7 @@ impl Geo> ActiveCellVisibility<'_, F> { } fn show_grid_interactions(app: &mut SheetApp, ui: &mut egui::Ui, resp: &egui::Response, geo: &Geo, sh: &Sheet, wb: &Workbook) { + let window = app.session.active_window(); let previous_popups = (app.grid.filter_menu, app.grid.list_picker, app.grid.header_menu, app.grid.fill_menu); // A pan the grid never saw end (it was hidden mid-drag) must not swallow the next press. if app.grid.touch_pan && !resp.dragged() && !resp.drag_stopped() { @@ -374,6 +375,10 @@ fn show_grid_interactions(app: &mut SheetApp, ui: &mut egui::Ui, resp: &egui::Re crate::paper_view::interact(app, ui, resp, geo, sh, wb); interact(app, ui, resp, geo, sh, wb); } + // A form button can switch windows and swap GridState; the old popup and geometry belong to the outgoing window. + if app.session.active_window() != window { + return; + } if previous_popups.0 != app.grid.filter_menu && previous_popups.0.is_some() { app.grid.filter_checks = None; app.grid.filter_search.clear(); diff --git a/crates/ui-egui/tests/it/cascading_filter_values.rs b/crates/ui-egui/tests/it/cascading_filter_values.rs index ba7bc0abff..da6cc24d35 100644 --- a/crates/ui-egui/tests/it/cascading_filter_values.rs +++ b/crates/ui-egui/tests/it/cascading_filter_values.rs @@ -4,6 +4,7 @@ use egui::{Event, Key, Modifiers, PointerButton}; use egui_kittest::kittest::{NodeT, Queryable}; use gridcraft_engine::Session; use gridcraft_engine::core::CellRef; +use gridcraft_engine::model::{ObjKind, ObjRef}; use gridcraft_ui_egui::grid; use serde_json::json; @@ -134,6 +135,61 @@ fn switching_filter_columns_keeps_another_windows_pending_choices() { assert!(h.state().session.active().unwrap().wb.active().unwrap().autofilter.as_ref().unwrap().criteria.is_empty(), "no filter was applied"); } +#[test] +fn a_form_button_window_switch_keeps_the_incoming_filter_edits() { + let mut session = Session::new(); + session.new_workbook(); + session + .execute("range.setValues", json!({"range": "A1", "values": [["Company", "Job"], ["East", "Alpha"], ["East", "Beta"], ["West", "Other"]]})) + .unwrap(); + session.execute("data.filter", json!({"range": "A1:B4"})).unwrap(); + let button = session.execute("insert.button", json!({"at": "E12", "text": "Other window"})).unwrap()["control"].as_u64().unwrap() as u32; + let image = std::env::var("GRIDCRAFT_FILTER_BUTTON_WINDOW_SNAPSHOT").ok(); + let builder = common::builder().with_os(egui::os::OperatingSystem::Windows).with_size(egui::vec2(1200.0, 800.0)); + let builder = if image.is_some() { builder.wgpu() } else { builder }; + let mut h = common::harness_with(builder, common::app(session), 4); + let first = h.state().session.active_window().unwrap(); + click_filter(&mut h, "A1"); + h.state_mut().run("view.newWindow", json!({})).unwrap(); + h.run_steps(3); + let second = h.state().session.active_window().unwrap(); + h.state_mut().run("control.assign", json!({"id": button, "command": "view.switchWindows", "params": {"window": second}})).unwrap(); + click_filter(&mut h, "B1"); + h.input_mut().events.push(Event::Text("Bet".into())); + h.run_steps(2); + h.get_by_label("Beta").click(); + h.run_steps(2); + let checks = h.state().grid.filter_checks.clone(); + assert_eq!(h.state().grid.filter_search, "Bet"); + assert_eq!(h.get_by_label("Beta").accesskit_node().toggled(), Some(egui::accesskit::Toggled::False)); + if let Some(path) = &image { + h.render().unwrap().save(std::path::Path::new(path).with_extension("before.png")).unwrap(); + } + + h.state_mut().enter_window(first); + h.run_steps(2); + assert_eq!(h.state().grid.filter_menu.map(|(col, _, _)| col), Some(0)); + let app = h.state(); + let sh = app.session.doc().unwrap().wb.active().unwrap(); + let geo = grid::Geo::new(sh, app.grid.rect.unwrap(), app.view().scroll); + let at = gridcraft_ui_egui::chartview::object_rect(&geo, sh, ObjRef::new(ObjKind::Control, button)).unwrap().center(); + for pressed in [true, false] { + h.input_mut().events.push(Event::ModifiersChanged(Modifiers::NONE)); + h.input_mut().events.push(Event::PointerMoved(at)); + h.input_mut().events.push(Event::PointerButton { pos: at, button: PointerButton::Primary, pressed, modifiers: Modifiers::NONE }); + h.step(); + } + h.run_steps(3); + assert_eq!(h.state().session.active_window(), Some(second), "the real button action switches windows during grid interaction"); + assert_eq!(h.state().grid.filter_menu.map(|(col, _, _)| col), Some(1)); + assert_eq!(h.state().grid.filter_search, "Bet", "the outgoing popup must not clear the incoming search"); + assert_eq!(h.state().grid.filter_checks, checks, "the incoming window keeps its unsaved checkbox edits"); + assert_eq!(h.get_by_label("Beta").accesskit_node().toggled(), Some(egui::accesskit::Toggled::False)); + if let Some(path) = image { + h.render().unwrap().save(path).unwrap(); + } +} + #[test] fn applying_eligible_choices_preserves_values_and_blanks_hidden_by_another_filter() { for table in [false, true] { diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 1aeb561b42..e40d721fff 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -1,6 +1,6 @@ # UI parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-05 · **Change:** minor (preserve centered emoji and symbol fallback placement; earlier: preserve leading and trailing blank cell lines; earlier: align wrapped and unwrapped cells; earlier: CJK title baseline regression and mixed-script rendering validation; earlier: AutoFilter checkbox state follows the active criterion and Values lookups are prepared once per query; earlier: cascading AutoFilter choices and pending popup selections per document window; earlier: form controls: buttons, sliders and spin buttons on the sheet; earlier: Highlight the active cell's row, a global preference in File › Options › General; earlier: a linked cell's menu edits, opens or removes the link; earlier: Display options for this workbook: sheet tabs and scroll bars; earlier: dragging over row or column headers in point mode extends the reference; earlier: a picture on the system clipboard pastes as a floating picture at the active cell with Cmd/Ctrl+V or Paste (#699); earlier: frozen columns keep their text, gridlines and merged borders whole while the sheet scrolls (#2544); earlier: every Paste Special option has its access key; earlier: the Draw tab's live stroke preview uses the pen's colour and thickness; earlier: copy quotes only cells with a tab or line break, as Excel does; earlier: Ctrl+. Next Corner of Selection; earlier: dragging the selection's border onto data asks before replacing it; earlier: RefEdit reference boxes in dialogs: Goal Seek, Solver and Data Analysis use them, the arrow keys select while a dialog is collapsed and F4 cycles a reference's anchors; earlier: Python cells: Python mode in the formula bar; earlier: Insert › Equation and the equation editor; earlier: every floating object selects, resizes from eight handles and deletes with the keyboard; earlier: Formulas › Error Checking › Trace Error; trace arrows stay through a zoom (#3097); earlier: Page Setup sets the page order, Down, then over or Over, then down, which printing, the print preview, Page Break Preview and Page Layout view follow; earlier: Formulas › Function Library as labelled buttons with category menus; Recently Used and the Insert Function categories; Esc leaves a File-page text field before closing the view; earlier: checkbox cells print as boxes; Ctrl+arrow and Ctrl+Shift+arrow while pointing a formula reference; editing a hyperlink loads its existing fields; AutoSum over a selected row puts its total to the right; ribbon catalog count 276 / 292) · **Target:** Microsoft Excel (Microsoft 365), Excel for Mac 16.113.4 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-10 · **Change:** minor (retain duplicate color-filter matches and pending popup edits across form-button window switches; earlier: preserve centered emoji and symbol fallback placement; earlier: preserve leading and trailing blank cell lines; earlier: align wrapped and unwrapped cells; earlier: CJK title baseline regression and mixed-script rendering validation; earlier: AutoFilter checkbox state follows the active criterion and Values lookups are prepared once per query; earlier: cascading AutoFilter choices and pending popup selections per document window; earlier: form controls: buttons, sliders and spin buttons on the sheet; earlier: Highlight the active cell's row, a global preference in File › Options › General; earlier: a linked cell's menu edits, opens or removes the link; earlier: Display options for this workbook: sheet tabs and scroll bars; earlier: dragging over row or column headers in point mode extends the reference; earlier: a picture on the system clipboard pastes as a floating picture at the active cell with Cmd/Ctrl+V or Paste (#699); earlier: frozen columns keep their text, gridlines and merged borders whole while the sheet scrolls (#2544); earlier: every Paste Special option has its access key; earlier: the Draw tab's live stroke preview uses the pen's colour and thickness; earlier: copy quotes only cells with a tab or line break, as Excel does; earlier: Ctrl+. Next Corner of Selection; earlier: dragging the selection's border onto data asks before replacing it; earlier: RefEdit reference boxes in dialogs: Goal Seek, Solver and Data Analysis use them, the arrow keys select while a dialog is collapsed and F4 cycles a reference's anchors; earlier: Python cells: Python mode in the formula bar; earlier: Insert › Equation and the equation editor; earlier: every floating object selects, resizes from eight handles and deletes with the keyboard; earlier: Formulas › Error Checking › Trace Error; trace arrows stay through a zoom (#3097); earlier: Page Setup sets the page order, Down, then over or Over, then down, which printing, the print preview, Page Break Preview and Page Layout view follow; earlier: Formulas › Function Library as labelled buttons with category menus; Recently Used and the Insert Function categories; Esc leaves a File-page text field before closing the view; earlier: checkbox cells print as boxes; Ctrl+arrow and Ctrl+Shift+arrow while pointing a formula reference; editing a hyperlink loads its existing fields; AutoSum over a selected row puts its total to the right; ribbon catalog count 276 / 292) · **Target:** Microsoft Excel (Microsoft 365), Excel for Mac 16.113.4 Interaction, controls and feel, against Excel. Part of [target-app-parity.md](target-app-parity.md). **UI/UX fidelity: ~55% ready, 50–80 h** (estimated). Ribbon command coverage is measured @@ -87,8 +87,9 @@ describes additive column filters and restricting other dropdowns to the filtere current column is excluded from enumeration so its unchecked alternatives remain available. The existing one-million-data-row enumeration limit and value sorting remain unchanged. Checkbox state uses the row matcher for the active criterion, including raw and formatted -Values matches, custom comparisons, numeric thresholds and colors. Hidden choices retain -that state when Apply merges the eligible edits. Values criteria prepare ASCII-insensitive +Values matches, custom comparisons, numeric thresholds and colors. A duplicate choice is +checked when any eligible row matches, including when those rows have different colors. +Hidden choices retain that state when Apply merges the eligible edits. Values criteria prepare ASCII-insensitive lookup sets once per query rather than scanning every selected value for each row. This changes the population behind the pending row-count work (#1737, and its stacked Only @@ -290,6 +291,7 @@ scrollbar bugs 2–4 · pixel/feel pass against observed Excel 7–12. | Date | Change | Summary | |---|---|---| +| 2026-11-10 | minor | Keep duplicate choices checked when any eligible row matches a color filter; a form-button window switch preserves the incoming window's pending filter search and checkbox edits (#2641) | | 2026-11-05 | minor | Reconcile upstream form-control coverage with the CJK baseline and cell-alignment updates | | 2026-11-04 | minor | Keep centered emoji and symbol fallback placement when a row starts with a fallback or contains only fallbacks; use primary or baseline-aligned glyphs to anchor cell alignment | | 2026-11-04 | minor | Preserve leading and trailing blank lines in wrapped cells when calculating vertical alignment; regression covers single, multiple and all-empty lines |