Repository navigation
feat: let apps customize the filter popup's value list (#353) - #504
Open
michaelstonis wants to merge 4 commits into
Open
michaelstonis wants to merge 4 commits into
michaelstonis wants to merge 4 commits into
Conversation
…work, keep the value list (#353)
This was referenced Nov 30, 2026
Comment on lines
+57
to
+59
| foreach (var value in e.Values) | ||
| if (StateNames.TryGetValue(value.Value, out var name)) | ||
| value.DisplayText = name; |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #353.
Changes
Apps can now change the filter popup's value list. Replacing the popup content per column is held back (see below).
KumikoSource.GetFilterValues(column)builds the list the popup shows: the distinct display values (GetUniqueColumnValues, so the other columns' filters still apply) asKumikoFilterValues, then raisesKumikoSource.FilterValuesLoadingonce, then sorts by display text under the source's culture (blank entry first) unless the handler setsKeepOrder. With no handler the list is exactly what it was.DrawnFilterPopuploads its items from it: selection, the OK result and the existing-filter check state useValue; drawing and search useDisplayText(an empty display text shows the blanks label). Entries no row has can be added. Bucketed entries need a matching condition or aSetFilterpredicate (documented on the event args and in the README); aKumikoFilterValue.Predicateis a possible follow-up.FilterValuesLoadingis forwarded on the MAUI and UnoKumikoDataGrid(KumikoDataGrid.Options.cs). Nothing undersrc/KumikoUI.Core/Inputis changed.Public API added (
PublicAPI.Unshipped.txtfor Core, Maui, Uno):KumikoFilterValue,KumikoFilterValuesLoadingEventArgs,KumikoSource.FilterValuesLoading,KumikoSource.GetFilterValues,DrawnFilterPopup.VisibleDisplayTexts, andKumikoDataGrid.FilterValuesLoadingon both hosts.Docs and samples. README ("Customizing the filter popup", events list, feature table), CHANGELOG entry, and a Filter Popup page in both sample apps (shared logic in
samples/Shared/FilterPopupDemo.cs): State codes relabeled as names, and Status with Active first and Internal hidden.Acceptance criteria
FilterValuesLoadingcan add, remove, reorder and relabel values; selection and search useValueandDisplayText; no handler means today's list.FilterPopupFactoryreplaces the popup content, applies a filter through the context and closes; focus and keyboard work. Held, see below.tests/KumikoUI.Core.Testsfor the value list, ordering and selection round trip (custom content open/apply/close is held).FilterValuesLoading(FilterPopupShownis held).PublicAPI.Unshipped.txtupdated (the update script left the Core file empty in this environment, so lines were taken from the RS0016 diagnostics and merged sorted; additions only).VisibleDisplayTextsexposes it); it has no separate accessibility tree.DrawnFilterPopupdrawing is unchanged.Held for Foundations #445 (popup manager)
Showing a column's own component as the filter popup needs changes in
KumikoInputController(ShowFilterPopup,CloseFilterPopup, popup-close routing,ActiveTextInput,WouldHandleTab) while the popup manager and input work in #445 / #448 is in flight, so this half was removed from the branch (it exists in commits 65368e7 and 45f7532 of this branch's history). Removed:KumikoColumn.FilterPopupFactory,KumikoFilterPopupContext(Column,Source,Style,ActiveFilter,Apply,Close),KumikoFilterPopupEventArgs,KumikoInputController.FilterPopupShown, and theFilterPopupShownevent on bothKumikoDataGrids.FilterPopupFactoryreplacing the content with focus and keyboard working; the typed popup-opened event; custom content open/apply/close tests; the custom range filter in the samples.FilterPopupOpened/FilterPopupClosedraised for it too;FilterPopupShownraised afterFilterPopupOpenedfor both popup kinds.Verification
dotnet build src/KumikoUI.Core,src/KumikoUI.SkiaSharp,src/KumikoUI.Maui -f net10.0-maccatalyst,src/KumikoUI.Uno -f net10.0-desktop: 0 warnings, 0 errors.samples/SampleApp.Maui -f net10.0-maccatalyst -p:KumikoDevFlow=falseandsamples/SampleApp.Uno -f net10.0-desktop: 0 errors (the default Debug MAUI sample build fails on an existing DevFlow package-version downgrade, NU1605).dotnet test tests/KumikoUI.Core.Tests: 4372 passed, 5 skipped.dotnet test tests/KumikoUI.Maui.Tests: 451 passed.dotnet test tests/KumikoUI.Uno.Tests: 321 passed.FilterValuesLoadingsnippet declaresstateNamesand uses the column name, so both documentation snippet projects (tests/KumikoUI.Docs.Snippets.Maui,.Uno) build with 0 errors.