Repository navigation
Fix class filter selection in WebUI - #854
Merged
Merged
Conversation
The tests describe the expected behaviour of the class filter dialog: each checkbox toggles only its own class, an unchanged partial selection is applied as is, and without a selection all classes are checked. They fail until the dialog is fixed in the next commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dialog never rendered its checkboxes, bound every checkbox to the last class created in the loop and always started from all classes, so "Apply" also passed classes that were not selected. Move the dialog into FilterClassificationForm, which derives its state from the current class filter selection (all classes if there is none, as in the customtkinter GUI), binds each checkbox to its own class and evaluates the checkbox value instead of toggling. Buttons are built in a dedicated method so further buttons can be added easily. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The class filter dialog now offers a Reset button that resets the class filter via the view model and closes the dialog, as in the customtkinter GUI. Apply and Reset take their labels from the ResourceManager. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
schubsen
requested changes
Oct 14, 2026
Add reset to class filter dialog in WebUI
briemla
enabled auto-merge
October 15, 2026 07:20
schubsen
approved these changes
Oct 15, 2026
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.
OP#10513
Problem
The class filter dialog of the WebUI (
visualization_filters_form/container.py,open_classification_dialog) did not work:on_value_changelambda bound the loop variable late, so every checkbox toggled the last class.get_class_filter_selection()). With a partial selection, "Apply" also passed classes whose checkbox was not checked.Solution
FilterClassificationForm(analogous toFilterDateRangeForm).None), all classes are selected, as in the customtkinter GUI. An empty selection ([]) now shows no class checked, which also matches the customtkinter GUI (previously it was treated like "all").get_classes(), and closes the dialog._build_buttons, so a follow-up PR can add the reset button there (PR 6,webui/06-class-filter-reset, builds on this branch). The "Apply" label is still hard-coded; PR 6 moves it to theResourceManager.Tests
tests/unit/OTAnalytics/plugin_ui/nicegui_gui/pages/visualization_filters_form/test_container.py(NiceGUIUserfixture):main(5 of 6) and pass with this change.pytest tests/unit/OTAnalytics/plugin_ui: 220 passed, 5 skippedpre-commit run --all-files: flake8, black, isort and mypy pass🤖 Generated with Claude Code