Add component classification filter support to debloater module#1366
Merged
Conversation
This commit implements filtering functionality for debloater components by their classification types (SHAREABLE, DEEPLINK, LAUNCHER, EXPLICIT). Changes: - Add ComponentClassification enum with four classification types - Add DebloatableComponentEntity.matchesClassifications() extension function - Update DebloaterViewModel to support component type filtering: - Add componentTypeFilter StateFlow - Add updateComponentTypeFilter() method - Update groupAndFilterDebloatableComponents() to apply type filtering with AND logic - Add comprehensive test coverage for single and multiple type filtering - Support combining text search with type filtering The implementation follows the existing codebase patterns and supports filtering by multiple classification types simultaneously. An empty filter set shows all components (default behavior). Change-Id: I8ad750113d618c8224f6ef92384d93c0e1882649
Implement UI for filtering debloatable components by type (shareable, deeplink, launcher, explicit). Filter chips use Material 3 design with proper localization for all supported languages. - Add ComponentTypeFilterChips composable with FlowRow layout - Update ViewModel to initialize with all types selected by default - Add analytics tracking for filter changes - Add string resources for 11 languages - Add screenshot tests for filter states - Update unit tests for new default behavior Change-Id: Ia0e859337d8a6fd9bb96507c89109e969084216e
Keep both filter chips implementation and new preview composables from main branch. Change-Id: Iadf86d5855aba71a6f0bcd69d467b6ac55cf60c7
- Change filter chips from FlowRow to horizontal scrollable Row to save space - Refactor ViewModel to use combine for instant client-side filtering - Load raw data once from repository and filter in memory - Add pending states mechanism for optimistic UI updates - Update StateFlow sharing strategy to Eagerly for immediate initialization This significantly improves performance by eliminating repeated data loads when users change filters or search queries. Change-Id: Ie62e107f8f73ff5f2c4fbab7a91ef7423ab92a04
…hub.com/lihenggui/blocker into feature/debloater-component-type-filter Change-Id: I8c7c7be706f99dc38c2f52eeeb4d6650111cb838
- Change filter chips from FlowRow to horizontal scrollable Row to save space - Refactor ViewModel to use combine for instant client-side filtering - Load raw data once from repository and filter in memory - Keep WhileSubscribed(5_000) sharing strategy for production efficiency - Update one test to use testScheduler.advanceUntilIdle() pattern This significantly improves performance by eliminating repeated data loads when users change filters or search queries. Change-Id: Id4620b50b7f8ad9eb41f8e150b747ad4d55daafe
Use single combine with 4 inputs (repo + search + filter + optimistic) instead of two-layer StateFlow bridge. This ensures filter changes immediately trigger UI updates while preserving optimistic updates for component control. Key changes: - Add _optimisticUpdates StateFlow to track pending component state changes - Combine it with other inputs in single reactive flow - Apply optimistic updates after filtering in combine lambda - Auto-clean synced optimistic states via init block monitoring repo changes This fixes the issue where clicking filter chips didn't refresh the UI. Change-Id: I84efe744ef0fc8b78ff27405a5be7821e5183b5b
Rename _optimisticUpdates to optimisticUpdates to comply with ktlint rule that requires backing properties (starting with _) to have matching public properties. Change-Id: Ief8c63a3d00e61d4c8f59446588be51ac2a016a4
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.
This commit implements filtering functionality for debloater components by their classification types (SHAREABLE, DEEPLINK, LAUNCHER, EXPLICIT).
Changes:
The implementation follows the existing codebase patterns and supports filtering by multiple classification types simultaneously. An empty filter set shows all components (default behavior).
Change-Id: I8ad750113d618c8224f6ef92384d93c0e1882649