Skip to content

Add component classification filter support to debloater module#1366

Merged
lihenggui merged 9 commits into
mainfrom
feature/debloater-component-type-filter
Nov 7, 2025
Merged

Add component classification filter support to debloater module#1366
lihenggui merged 9 commits into
mainfrom
feature/debloater-component-type-filter

Conversation

@lihenggui

Copy link
Copy Markdown
Owner

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

lihenggui and others added 9 commits November 6, 2025 12:06
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
@lihenggui lihenggui merged commit fd2bac7 into main Nov 7, 2025
4 checks passed
@lihenggui lihenggui deleted the feature/debloater-component-type-filter branch November 7, 2025 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant