Repository navigation
Show row counts in AutoFilter dropdowns - #1737
TheRenegadeDev wants to merge 1 commit into
Conversation
|
Note for whoever reviews: #1741 builds directly on this PR's commit (unchanged) plus adds the "Only" button from the other half of #1409. I verified #1741's diff today and it includes and passes this PR's own test ( |
FredApps
left a comment
There was a problem hiding this comment.
ReviewerA — source-read COMMENT (not an approval)
I read the head of the diff: AutoFilter dropdowns show row counts. filter_values now returns each distinct display value with its checked state and a count, and the doc says the counts include all data rows in the filter range, even rows hidden by another filter. Excel's dropdown does not show counts (Excel's list shows only the values, while Google Sheets and Power Query show counts), so this is an addition beyond the oracle, which the maintainers may want or not. Counting is linear in the data rows, which is the same as building the list, so the cost is acceptable. The public function signature changes from a pair to a triple, so every caller must change. I have not run it, and no exact-head CI result exists for this head. Nothing was run.
I ran nothing and have no exact-head CI result for this PR, so this is not an approval. Where a diff was long I read its code hunks rather than every generated or documentation line.
Status: waiting_author.
Fixes #1409.
The AutoFilter dropdown now shows a dimmed, right-aligned row count beside every value, including (Blanks). Long checkbox labels truncate before the count, and searching keeps the full count for each matching value. Filter application continues through
data.filterBy.Counts include rows hidden by this column's filter or filters on other columns. This follows the existing dropdown's source list and keeps group sizes stable while changing selections. The existing one-million-data-row scan limit is retained. Counting only rows that pass other columns' filters would require changing that list's semantics as well.
Regression coverage includes repeated values, blank cells, the filter range boundary, checked state after filtering, search, long labels, and alignment of single- and double-digit counts. The dropdown was also rendered offscreen and visually inspected.
Validation:
cargo test --locked --workspace: 1,609 passed, zero failed, one existing ignored test.cargo clippy --locked -p gridcraft-engine -p gridcraft-ui-egui --all-targets --no-deps -- -D warnings: passed.cargo xtask cipasses formatting, then stops at the existing Clippy failures on main incrates/xlsx/src/xls/mod.rs:273(collapsible_match) andcrates/xlsx/src/tests/passthrough_tests.rs:480(nonminimal_bool). Those files are unchanged in this PR. All skipped gates were run separately and passed. The WASM check retains the existingModified::Unknowndead-code warning.