Jobs filtering#4992
Conversation
Task: Add filter state variables to PresubmitState Summary: Added selectedStatuses, selectedPlatforms, and jobNameFilter to PresubmitState for job filtering. Files: dashboard/lib/state/presubmit.dart, dashboard/test/state/presubmit_filter_test.dart Why: Provides the foundation for job filtering in the Presubmit Dashboard.
Task: Add methods to update filter state Summary: Added updateFilters and clearFilters methods to PresubmitState. Files: dashboard/lib/state/presubmit.dart, dashboard/test/state/presubmit_filter_test.dart Why: Allows updating and resetting the filter state in Presubmit Dashboard.
Task: Implement filtering logic in PresubmitState Summary: Implemented filteredGuardResponse getter and _updateSelectedPlatforms. Added filter reset on PR change. Files: dashboard/lib/state/presubmit.dart, dashboard/test/state/presubmit_filter_test.dart Why: Provides the actual filtering of job data based on status, platform, and name regex.
Task: Create FilterDialog widget in dashboard/lib/widgets/filter_dialog.dart Summary: Created FilterDialog with status, platform, and regex filters. Added clear all and filtered count buttons. Files: dashboard/lib/widgets/filter_dialog.dart, dashboard/test/widgets/filter_dialog_test.dart Why: Provides the UI for users to configure job filters in the Presubmit Dashboard.
Task: Phase 3: Integration and Dashboard UI Summary: Added filter button to CocoonAppBar and integrated filteredGuardResponse into _ChecksSidebar. Added isAnyFilterApplied getter to PresubmitState. Files: dashboard/lib/state/presubmit.dart, dashboard/lib/views/presubmit_view.dart, dashboard/test/views/presubmit_filter_view_test.dart Why: Completes the user-facing filtering functionality in the Presubmit Dashboard.
Task: Fix regex filter update behavior Summary: Added onChanged to regex TextField in FilterDialog to ensure job count updates immediately as user types. Updated tests. Files: dashboard/lib/widgets/filter_dialog.dart, dashboard/test/widgets/filter_dialog_test.dart Why: Ensures the 'Show N jobs' button accurately reflects the current filter state in real-time.
Task: Update number of jobs in button while typing Summary: Refactored PresubmitState to allow filtering without state updates. Updated FilterDialog to use local regex for count calculation in 'Show N jobs' button. Files: dashboard/lib/state/presubmit.dart, dashboard/lib/widgets/filter_dialog.dart Why: Provides real-time feedback on filter impact while respecting the requirement to apply regex to the dashboard only on focus loss or confirmation.
Task: Update count and sidebar while typing Summary: Updated FilterDialog to apply regex filters immediately on every keystroke, which updates both the 'Show N jobs' button and the dashboard sidebar in real-time. Files: dashboard/lib/widgets/filter_dialog.dart Why: Provides instantaneous visual feedback across the entire view as the user types.
Task: Fix Show N jobs not updating while typing Summary: Added setState to _onRegexChanged to explicitly trigger a rebuild of the dialog when the user types, ensuring the filteredCount is recalculated and displayed in the 'Show N jobs' button. Files: dashboard/lib/widgets/filter_dialog.dart Why: Ensures the dialog UI stays in sync with the applied filters during text input.
Task: Show icons when selected Summary: Updated FilterDialog to always show the status icon in the FilterChip avatar, even when the chip is selected. Files: dashboard/lib/widgets/filter_dialog.dart Why: Provides consistent visual identification of task statuses in the filter dialog.
Task: Handle selection logic on filter apply Summary: Updated PresubmitState to ensure a valid job selection remains visible after filtering. If the current selection is filtered out, the top-most visible job (based on UI sorting) is auto-selected. If no jobs remain, the selection is cleared. Updated tests to verify this behavior and fixed existing test issues. Files: dashboard/lib/state/presubmit.dart, dashboard/test/state/presubmit_test.dart, dashboard/test/state/presubmit_filter_test.dart, dashboard/test/widgets/filter_dialog_test.dart Why: Ensures the details pane always shows relevant data from the currently visible filtered jobs.
Task: Wrap up Presubmit Dashboard job filtering Summary: Cleaned up PresubmitState by using authService.isAuthenticated directly, ensuring correct notification of listeners on auth change and re-run actions. Fixed re-run functionality tests in presubmit_view_test.dart by correctly handling refresh timers. Archived the track. Files: dashboard/lib/state/presubmit.dart, dashboard/test/views/presubmit_view_test.dart, conductor/tracks/presubmit_filter_20260319/ (deleted), conductor/archive/presubmit_filter_20260319/ (added) Why: Ensures a robust, fully tested filtering and re-run experience in the Presubmit Dashboard.
|
🤖 Hi @ievdokdm, I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
There was a problem hiding this comment.
This Pull Request successfully introduces a filtering mechanism for the Presubmit Dashboard, allowing users to filter jobs by status, platform, and regular expression. The implementation is comprehensive, covering state management, UI components, and test coverage across the modified functionality.
🔍 General Feedback
- The state management effectively encapsulates the filtering logic within
PresubmitStateand cleanly updates downstream views. - The use of multi-select FilterChips in the dialog provides a great user experience for toggling specific statuses and platforms.
- The unit tests thoroughly validate the filtering behavior, including persistence and auto-selection of the topmost visible job.
- Good job gracefully handling invalid regex inputs in the filtering loop to prevent crashes.
|
autosubmit label was removed for flutter/cocoon/4992, because This PR has not met approval requirements for merging. Changes were requested by {jtmcdole}, please make the needed changes and resubmit this PR.
|
|
autosubmit label was removed for flutter/cocoon/4992, because This PR has not met approval requirements for merging. Changes were requested by {jtmcdole}, please make the needed changes and resubmit this PR.
|
|
autosubmit label was removed for flutter/cocoon/4992, because This PR has not met approval requirements for merging. Changes were requested by {jtmcdole}, please make the needed changes and resubmit this PR.
|
Implemented jobs filtering
Fix: flutter/flutter#183898