Repository navigation
feat(xlsx): a filter by values, from a list under each header cell - #66
Alex-Citeroni wants to merge 2 commits into
Conversation
… a list under each header cell, saved - the file's <autoFilter> is read with the values of its columns (<filters>, blank cells included); a criterion of another kind (custom, top 10, dynamic, color, icon, dates by group) is kept as it is and written back, at the column it is at now, until values are chosen for its column - two sheet operations: `filter` (on over a range, its first row the header; off: every row it hid shows) and `filterBy` (the values of a column whose rows are shown, '' for blank cells; null clears). One step of Undo each, the criteria and the rows together; a protected sheet refuses them unless it allows its filter (`autoFilter`) - in a room an operation carries the rows it hid, as a sort carries its order: the same rows hide for everyone, also where someone typed in one of them at the same moment; it follows the rows and columns inserted meanwhile - `xlsx.filterValues`: the distinct values a column shows in the rows the other columns let through (10,000 at most, saying so), and those whose rows are shown - the filter follows the rows and columns inserted and deleted (a deleted column takes its criterion, the header row deleted takes the filter); SUBTOTAL and AGGREGATE are computed again when it hides or shows rows - saved as Excel saves it: <autoFilter> from the model in the order of the schema (what else it held, its sort state, stays while it is over the same cells), the rows hidden, the sheet's `_xlnm._FilterDatabase` name - the view: a Filter button in the toolbar (Ctrl/⌘+Shift+L, also in the context menu), a button in each header cell of the filter, marked where the column is filtered (Alt+Down on the cell), a card with a search, (Select all), (Blanks), OK / Cancel; a view that cannot edit shows the buttons and the marks - `XlsxToolbar` takes `filtered` and `onFilter`, both optional: without `onFilter` it has no Filter button Not here: custom, number, date and color filters set from the list, sorting from the list, filtering again when a cell changes, the filters of tables. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thank you for this one too, @Alex-Citeroni. I traced these paths and they hold:
Three things need to change before this goes in, and two smaller ones are worth a look. I read the code. I have not run it, and I have not opened a saved file in Excel. To fix before merge1. A sheet filter can be put over a table.
2. Sort and Delete act on the rows the filter hid.
Excel sorts and clears only what the filter shows. At the least, a sort over the filter's range should apply the criteria again in the same step of Undo, and a clear should leave the hidden rows as they are. 3. In a room, a
Two people who filter two columns at the same moment end with both criteria stored and only the second one's rows hidden: the same on every replica, but not what the criteria say. Dropping Smaller, not blocking
#67 changes eight of the same files, so whichever of the two lands second needs the rebase you mentioned. |
… on the rows it shows; two filters at once in a room - a sheet's filter is refused over the cells of a table - a sort, a clear and a deletion of rows leave the rows the filter hides as they are - in a room, a filter set at the same moment as another one, or as a sort, hides the rows its criteria say - the filter's hidden name counts chart sheets; line breaks in a value are kept Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thank you for the careful read. All five points are fixed in a3e8d8a. To fix before merge
Smaller
I found one more of the same kind: deleting rows selected in a filtered sheet also deleted the hidden ones between them. Now only the rows shown go. Each block of rows is its own step of Undo, so past 100 separate blocks it is refused with a message. There are new tests for these, and the unit suite passes. I still have not opened a saved file in desktop Excel. I will rebase whichever of the two lands second. |
A workbook's
<autoFilter>was kept in the file but did nothing in the editor. A sheet can now be filtered by values: turned on from the toolbar, set from a list under each header cell, and saved as Excel saves it.What it does
filter(on over a range, or off) andfilterBy(the values shown for a column). Each is one step of Undo, the criteria and the rows together. A protected sheet refuses them unless it allows its filter.<autoFilter>in the order of the schema, the hidden rows, and the sheet's_xlnm._FilterDatabasename.XlsxToolbartakesfilteredandonFilter, both optional: withoutonFilterit has no Filter button.Not in this PR
Tests
Unit tests for reading, operations, undo, collaboration and the saved XML, and an e2e spec for the card. Typecheck and the unit suite (1779) pass. The xlsx e2e suite (65, run with both PRs merged) passes. I have not opened a saved file in desktop Excel.
The strings are in English and German. A second PR adds data validation lists. The two are independent, but they touch some of the same files: I will rebase whichever lands second.
🤖 Generated with Claude Code