Skip to content

Comments

Development#23

Open
ufebri wants to merge 2 commits intomasterfrom
development
Open

Development#23
ufebri wants to merge 2 commits intomasterfrom
development

Conversation

@ufebri
Copy link
Owner

@ufebri ufebri commented Feb 17, 2026

No description provided.

This commit introduces a new feature allowing users to view and clear the application's cache from the Profile screen.

### Features
- **Profile Screen**:
    - Added a "Clear Cache" option under the "Settings" section.
    - It displays the current cache size and allows users to clear it.
    - A confirmation dialog is shown before clearing the cache to prevent accidental data loss.

### Implementation
- **Cache Management**:
    - Created `CacheRepository` and `CacheRepositoryImpl` to handle cache size calculation and clearing logic for both internal and external cache directories.
- **Use Cases**:
    - `GetCacheSizeUseCase`: Fetches the total size of the cache in bytes.
    - `ClearCacheUseCase`: Deletes the contents of the cache directories.
- **ViewModel Integration**:
    - `ProfileViewModel` is updated to use the new use cases to fetch the cache size and trigger the clearing process.
    - Manages UI state for cache size, loading indicators, and the confirmation dialog.
- **Dependency Injection**:
    - The new repository and use cases are integrated into the Hilt dependency graph via `SettingsModule`.

### Testing
- **Unit Tests**:
    - Added tests to `ProfileViewModelTest` to verify the logic for fetching cache size and clearing the cache, ensuring the UI state is updated correctly.

### Chore
- Added new string resources for the cache management feature.
@ufebri ufebri self-assigned this Feb 17, 2026
@ufebri ufebri added the enhancement New feature or request label Feb 17, 2026
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
2 Security Hotspots
28.7% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant