Skip to content

Add clear cache feature and refactor proxy models#299

Merged
rainxchzed merged 9 commits intomainfrom
cache-cleanup
Mar 6, 2026
Merged

Add clear cache feature and refactor proxy models#299
rainxchzed merged 9 commits intomainfrom
cache-cleanup

Conversation

@rainxchzed
Copy link
Member

@rainxchzed rainxchzed commented Mar 6, 2026

  • Relocate ProxyType enum to a new model package.
  • Introduce a "Clear Cache" section in the profile presentation layer.
  • Add cacheSize to ProfileState and OnClearCacheClick to ProfileAction.
  • Update ProfileViewModel to handle cache clearing and observe cache size.
  • Integrate othersSection into ProfileRoot.
  • Adjust vertical spacing in Appearance.kt for better UI consistency.

Summary by CodeRabbit

  • New Features

    • Added a "Storage" section in Profile showing current cache size, a Clear button, and a new Clear Cache action; profile now exposes proxy type and cache size fields.
  • UI

    • Inserted Storage between Network and About with consistent larger vertical spacing; About header unified.
    • Starred and Favourites items use refreshed expressive cards, updated action/button styles, and added chips for language/release.
  • Style

    • Adjusted spacing in Appearance and profile lists.
  • Localization

    • Added storage-related strings and fixed positional formatting across locales.

- Relocate `ProxyType` enum to a new `model` package.
- Introduce a "Clear Cache" section in the profile presentation layer.
- Add `cacheSize` to `ProfileState` and `OnClearCacheClick` to `ProfileAction`.
- Update `ProfileViewModel` to handle cache clearing and observe cache size.
- Integrate `othersSection` into `ProfileRoot`.
- Adjust vertical spacing in `Appearance.kt` for better UI consistency.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 6, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds a "Storage" section with cache-size display and a Clear button (emits ProfileAction.OnClearCacheClick); moves ProxyType to a new model enum and exposes it on ProfileState (proxyType, cacheSize); ViewModel stubs cache observation and handles the new action; UI spacing and several composable swaps updated.

Changes

Cohort / File(s) Summary
Action
feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileAction.kt
Added OnClearCacheClick variant to ProfileAction.
State & Model
feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileState.kt, feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/model/ProxyType.kt
Removed inline enum from state file; added model/ProxyType.kt; ProfileState now includes proxyType: ProxyType = ProxyType.NONE and cacheSize: String = "".
ViewModel
feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileViewModel.kt
Added observeCacheSize() call with placeholder implementation and an empty handler branch for ProfileAction.OnClearCacheClick; updated imports.
UI Composition
feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileRoot.kt, feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/components/sections/Others.kt
Inserted othersSection into profile lazy list; new othersSection renders "Storage", shows state.cacheSize, and dispatches OnClearCacheClick when "Clear" is tapped; adjusted vertical spacing to 32.dp around the section.
Sections / Styling
feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/components/sections/Appearance.kt, .../sections/Network.kt, .../sections/About.kt
Adjusted VerticalSpacer sizes in Appearance (16.dp→8.dp), updated ProxyType import path in Network, and replaced About header Text with SectionHeader.
Localization
core/presentation/src/commonMain/composeResources/values*/strings-*.xml
Added localized strings storage, clear_cache, current_size, and clear across many locales; standardized time-ago formatting to use %1$d in multiple locale files.
Other UI tweaks
feature/starred/presentation/.../StarredRepositoryItem.kt, feature/favourites/presentation/.../FavouriteRepositoryItem.kt
Replaced Card with ExpressiveCard, added shape customization and richer layout/chips in favourites item; minor modifier call simplification in FavouritesRoot.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant UI as OthersSection
  participant VM as ProfileViewModel
  participant Cache as CacheRepository

  User->>UI: Tap "Clear" button
  UI->>VM: onAction(ProfileAction.OnClearCacheClick)
  VM->>Cache: requestClearCache()
  Cache-->>VM: clearResult (new size)
  VM->>UI: update ProfileState(cacheSize)
  UI-->>User: display updated cache size
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰
I hopped through strings and spacer rows,
Found a button where the clear wind blows.
Proxy hat set tidy and neat,
Tap "Clear" — the meadow feels light on its feet. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the two main changes: adding a clear cache feature and refactoring proxy models by moving ProxyType to a new package.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cache-cleanup

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/components/sections/Others.kt`:
- Around line 58-66: Replace hardcoded UI strings in the Others composable with
localized resources: add string resources (e.g., clear_cache and
current_size_format with a placeholder like "Current size: %s") to your common
resource files, then use stringResource(...) inside the Text composables in
Others.kt (the Text that currently shows "Clear Cache" and the Text showing
"Current size: ${state.cacheSize}") to load those keys and pass state.cacheSize
into the formatted resource; repeat the same replacement for the second
occurrence around the other Texts referenced in the comment (lines 81-83).

In
`@feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileViewModel.kt`:
- Around line 60-64: observeCacheSize() and OnClearCacheClick are no-ops so the
VM never observes cache size or clears it; wire these to the cache APIs by
collecting the cache size Flow in viewModelScope (e.g., call a
repository/getCacheSizeFlow function from ProfileViewModel and collect() to
update the ViewModel state field that represents cacheSize), implement
OnClearCacheClick to call the cache clear function (e.g.,
repository.clearCache() or cacheManager.clear()) inside viewModelScope, then
refresh or re-collect the cache size after clearing and emit an event/state
update for success or error; update the empty implementations in
observeCacheSize() and the OnClearCacheClick handler (also the duplicate empty
handler at the other location) to perform these calls and update the profile
state/events accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9e14ab39-68df-4cea-bf44-d0d3e2a593da

📥 Commits

Reviewing files that changed from the base of the PR and between 9a4f7dc and d4ae624.

📒 Files selected for processing (8)
  • feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileAction.kt
  • feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileRoot.kt
  • feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileState.kt
  • feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileViewModel.kt
  • feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/components/sections/Appearance.kt
  • feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/components/sections/Network.kt
  • feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/components/sections/Others.kt
  • feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/model/ProxyType.kt

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/components/sections/Others.kt (1)

42-43: ⚠️ Potential issue | 🟡 Minor

Localize storage/cache labels instead of hardcoded literals.

"Storage", "Clear Cache", "Current size: ..." and "Clear" should be resource-backed (stringResource) for i18n consistency; uppercasing a literal also bypasses locale-safe translation flow.

🌐 Suggested update
-import zed.rainxch.githubstore.core.presentation.res.section_network
+import zed.rainxch.githubstore.core.presentation.res.clear_action
+import zed.rainxch.githubstore.core.presentation.res.clear_cache_title
+import zed.rainxch.githubstore.core.presentation.res.current_cache_size
+import zed.rainxch.githubstore.core.presentation.res.section_storage

         SectionHeader(
-            text = "Storage".uppercase()
+            text = stringResource(Res.string.section_storage)
         )
@@
                     Text(
-                        text = "Clear Cache",
+                        text = stringResource(Res.string.clear_cache_title),
                         style = MaterialTheme.typography.titleMedium,
                         color = MaterialTheme.colorScheme.onSurface
                     )

                     Text(
-                        text = "Current size: ${state.cacheSize}",
+                        text = stringResource(Res.string.current_cache_size, state.cacheSize),
                         style = MaterialTheme.typography.titleSmall,
                         color = MaterialTheme.colorScheme.onSurfaceVariant
                     )
@@
                     Text(
-                        text = "Clear",
+                        text = stringResource(Res.string.clear_action),
                         style = MaterialTheme.typography.titleMediumEmphasized,
                         fontWeight = FontWeight.Bold
                     )

Also applies to: 71-77, 94-94

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/components/sections/Others.kt`
around lines 42 - 43, Replace the hardcoded UI labels in Others.kt ("Storage",
"Clear Cache", "Current size: ...", "Clear") with resource-backed strings via
stringResource (e.g., stringResource(R.string.storage),
stringResource(R.string.clear_cache), stringResource(R.string.current_size),
stringResource(R.string.clear)), add those keys to your shared strings resource,
and remove direct .uppercase() on the literal—if you must uppercase for styling
use a locale-aware transformation (e.g., uppercase(Locale.current)) after
retrieving the stringResource. Locate the Text/label occurrences in Others.kt
where those literal values are used and swap them to use stringResource calls.
🧹 Nitpick comments (1)
feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileRoot.kt (1)

164-201: Optional: extract repeated 32.dp section spacing into one constant.

This makes future spacing adjustments simpler and reduces repeated literals.

♻️ Suggested refactor
 fun ProfileScreen(
     state: ProfileState,
     onAction: (ProfileAction) -> Unit,
     snackbarState: SnackbarHostState
 ) {
     val liquidState = LocalBottomNavigationLiquid.current
     val bottomNavHeight = LocalBottomNavigationHeight.current
+    val sectionSpacing = 32.dp
@@
             item {
-                Spacer(Modifier.height(32.dp))
+                Spacer(Modifier.height(sectionSpacing))
             }
@@
             item {
-                Spacer(Modifier.height(32.dp))
+                Spacer(Modifier.height(sectionSpacing))
             }
@@
             item {
-                Spacer(Modifier.height(32.dp))
+                Spacer(Modifier.height(sectionSpacing))
             }
@@
             item {
-                Spacer(Modifier.height(32.dp))
+                Spacer(Modifier.height(sectionSpacing))
             }
@@
             item {
-                Spacer(Modifier.height(32.dp))
+                Spacer(Modifier.height(sectionSpacing))
             }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileRoot.kt`
around lines 164 - 201, Extract the repeated 32.dp used in
Spacer(Modifier.height(32.dp)) into a single named constant (e.g.,
SECTION_SPACING or PROFILE_SECTION_SPACING) defined near ProfileRoot (top-level
in the file or companion object) and replace each occurrence around settings,
networkSection, othersSection, about and the other Spacer calls with
Spacer(Modifier.height(SECTION_SPACING)); update any references in the same file
so all repeated literals use that constant for easier maintenance.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/components/sections/Others.kt`:
- Around line 83-86: The Clear button in Others.kt dispatches
ProfileAction.OnClearCacheClick but ProfileViewModel's action handler branch for
OnClearCacheClick is empty; implement the handler in ProfileViewModel (the
method that processes ProfileAction) to call the appropriate cache-clearing API
(e.g., repository.clearCache() or cacheManager.clear()) and then emit a state
update or side-effect (e.g., show confirmation toast or update isCleared flag in
ProfileState) so the UI reflects the change; locate the empty branch handling
ProfileAction.OnClearCacheClick and replace it with the cache clear invocation,
error handling, and a state/side-effect emission using existing ViewModel
utilities.

---

Duplicate comments:
In
`@feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/components/sections/Others.kt`:
- Around line 42-43: Replace the hardcoded UI labels in Others.kt ("Storage",
"Clear Cache", "Current size: ...", "Clear") with resource-backed strings via
stringResource (e.g., stringResource(R.string.storage),
stringResource(R.string.clear_cache), stringResource(R.string.current_size),
stringResource(R.string.clear)), add those keys to your shared strings resource,
and remove direct .uppercase() on the literal—if you must uppercase for styling
use a locale-aware transformation (e.g., uppercase(Locale.current)) after
retrieving the stringResource. Locate the Text/label occurrences in Others.kt
where those literal values are used and swap them to use stringResource calls.

---

Nitpick comments:
In
`@feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileRoot.kt`:
- Around line 164-201: Extract the repeated 32.dp used in
Spacer(Modifier.height(32.dp)) into a single named constant (e.g.,
SECTION_SPACING or PROFILE_SECTION_SPACING) defined near ProfileRoot (top-level
in the file or companion object) and replace each occurrence around settings,
networkSection, othersSection, about and the other Spacer calls with
Spacer(Modifier.height(SECTION_SPACING)); update any references in the same file
so all repeated literals use that constant for easier maintenance.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 65ec83fd-f0b9-4af2-8671-73ae8a25ccd9

📥 Commits

Reviewing files that changed from the base of the PR and between d4ae624 and fddd5fa.

📒 Files selected for processing (3)
  • feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileRoot.kt
  • feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/components/sections/About.kt
  • feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/components/sections/Others.kt

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
feature/starred/presentation/src/commonMain/kotlin/zed/rainxch/starred/presentation/components/StarredRepositoryItem.kt (1)

61-63: Avoid redundant fillMaxWidth() when using ExpressiveCard.

ExpressiveCard already applies fillMaxWidth() internally, so this extra width constraint is unnecessary and slightly reduces modifier flexibility.

♻️ Proposed simplification
-    ExpressiveCard(
-        onClick = onItemClick,
-        modifier = modifier.fillMaxWidth()
-    ) {
+    ExpressiveCard(
+        onClick = onItemClick,
+        modifier = modifier
+    ) {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@feature/starred/presentation/src/commonMain/kotlin/zed/rainxch/starred/presentation/components/StarredRepositoryItem.kt`
around lines 61 - 63, The call to ExpressiveCard is passing
modifier.fillMaxWidth(), which is redundant because ExpressiveCard already
applies fillMaxWidth() internally; change the invocation to pass the raw
modifier (e.g., modifier) instead of modifier.fillMaxWidth() so the parent
modifier remains flexible—update the ExpressiveCard(...) parameter (the modifier
argument) to use modifier rather than modifier.fillMaxWidth(), leaving onClick
and other args unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@feature/starred/presentation/src/commonMain/kotlin/zed/rainxch/starred/presentation/components/StarredRepositoryItem.kt`:
- Around line 61-63: The call to ExpressiveCard is passing
modifier.fillMaxWidth(), which is redundant because ExpressiveCard already
applies fillMaxWidth() internally; change the invocation to pass the raw
modifier (e.g., modifier) instead of modifier.fillMaxWidth() so the parent
modifier remains flexible—update the ExpressiveCard(...) parameter (the modifier
argument) to use modifier rather than modifier.fillMaxWidth(), leaving onClick
and other args unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 45e97f9f-8690-4e7f-8352-a8b697adcd7a

📥 Commits

Reviewing files that changed from the base of the PR and between fddd5fa and 82f0e7c.

📒 Files selected for processing (1)
  • feature/starred/presentation/src/commonMain/kotlin/zed/rainxch/starred/presentation/components/StarredRepositoryItem.kt

- Refactor `FavouriteRepositoryItem` to use `ExpressiveCard` and `AssistChip` for displaying repository details like language, latest release, and date added.
- Update `FavouriteRepositoryItem` layout with improved spacing, typography, and a custom-shaped favorite button.
- Fix string resource formatting by changing `%d` to `%1$d` for `minutes_ago`, `hours_ago`, and `days_ago` across multiple localizations (pl, ko, hi, zh-rCN, bn, ru, tr, and default).
- Clean up imports and remove redundant `Modifier.Companion` references in `FavouritesRoot`.
- Added string resources for "storage", "clear_cache", "current_size", and "clear" across multiple languages (pl, fr, ja, ko, es, hi, zh-rCN, bn, it, ru, tr, and default).
- Refactored `Others.kt` in the profile presentation layer to use localized string resources instead of hardcoded text for the storage section.
- Cleaned up imports in `Others.kt`.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (1)
feature/favourites/presentation/src/commonMain/kotlin/zed/rainxch/favourites/presentation/components/FavouriteRepositoryItem.kt (1)

150-218: Consider using non-clickable chips for display-only metadata.

The AssistChip components have no-op onClick handlers, making them appear interactive but non-functional. This could confuse users expecting tap behavior.

Consider using enabled = false to visually indicate non-interactivity, or evaluate whether a simpler non-clickable composable (e.g., a styled Row with icon and text) would be more appropriate for display-only metadata.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@feature/favourites/presentation/src/commonMain/kotlin/zed/rainxch/favourites/presentation/components/FavouriteRepositoryItem.kt`
around lines 150 - 218, The AssistChip usages in FavouriteRepositoryItem (the
chips rendering favouriteRepository.primaryLanguage,
favouriteRepository.latestRelease, and favouriteRepository.addedAtFormatter) are
currently given no-op onClick handlers which makes them look interactive; change
each AssistChip to be non-interactive by either setting enabled = false on the
AssistChip instances or replace them with a non-clickable composable (e.g., a
Row with Icon and Text styled like the chips) so display-only metadata is
visually and functionally non-interactive.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@core/presentation/src/commonMain/composeResources/values-hi/strings-hi.xml`:
- Around line 456-459: The string resource named "storage" is left in English;
replace its value with a Hindi translation (e.g., "भंडारण" or use
transliteration "स्टोरेज" to match app style) so that <string name="storage">
uses the Hindi text; update the entry for "storage" in the same resource block
alongside "clear_cache", "current_size", and "clear".

In `@core/presentation/src/commonMain/composeResources/values-it/strings-it.xml`:
- Line 457: The string resource with name "storage" is still in English; update
its value in strings-it.xml to the Italian translation (replace <string
name="storage">Storage</string> with the Italian equivalent, e.g. use
"Archiviazione") so the locale file remains consistent.

In `@core/presentation/src/commonMain/composeResources/values-ja/strings-ja.xml`:
- Line 420: Replace the English value for the XML string element named "storage"
with the Japanese localization (e.g., "ストレージ") so the entry <string
name="storage">Storage</string> becomes localized and matches surrounding
entries in strings-ja.xml; update only the value inside the existing string
element to the appropriate Japanese text.

In `@core/presentation/src/commonMain/composeResources/values-ko/strings-ko.xml`:
- Around line 453-456: The Korean translation for the string with name="storage"
currently uses "저장소", which conflicts with existing translations for
"repository" used elsewhere; update the value for string name="storage" in
values-ko/strings-ko.xml to a distinct term such as "저장 공간" or "스토리지" (choose
one), ensuring you only change the cache/storage UI entry and leave
repository-related "저장소" translations untouched (search for other uses of string
name="storage" or repository labels to confirm).

In
`@feature/favourites/presentation/src/commonMain/kotlin/zed/rainxch/favourites/presentation/components/FavouriteRepositoryItem.kt`:
- Around line 66-70: The ripple from the Row's clickable is unbounded because
clickable is applied before clip; reorder the modifiers on the Row so
clip(RoundedCornerShape(24.dp)) comes before clickable(onClick =
onDevProfileClick) (i.e., apply clip first, then clickable) to ensure the ripple
is constrained to the rounded corners; update the Modifier chain where Row is
defined to reflect this change.

---

Nitpick comments:
In
`@feature/favourites/presentation/src/commonMain/kotlin/zed/rainxch/favourites/presentation/components/FavouriteRepositoryItem.kt`:
- Around line 150-218: The AssistChip usages in FavouriteRepositoryItem (the
chips rendering favouriteRepository.primaryLanguage,
favouriteRepository.latestRelease, and favouriteRepository.addedAtFormatter) are
currently given no-op onClick handlers which makes them look interactive; change
each AssistChip to be non-interactive by either setting enabled = false on the
AssistChip instances or replace them with a non-clickable composable (e.g., a
Row with Icon and Text styled like the chips) so display-only metadata is
visually and functionally non-interactive.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 01ac98cd-4a80-4b28-ad6e-ebc2c34e0e9c

📥 Commits

Reviewing files that changed from the base of the PR and between 82f0e7c and e705c4b.

📒 Files selected for processing (15)
  • core/presentation/src/commonMain/composeResources/values-bn/strings-bn.xml
  • core/presentation/src/commonMain/composeResources/values-es/strings-es.xml
  • core/presentation/src/commonMain/composeResources/values-fr/strings-fr.xml
  • core/presentation/src/commonMain/composeResources/values-hi/strings-hi.xml
  • core/presentation/src/commonMain/composeResources/values-it/strings-it.xml
  • core/presentation/src/commonMain/composeResources/values-ja/strings-ja.xml
  • core/presentation/src/commonMain/composeResources/values-ko/strings-ko.xml
  • core/presentation/src/commonMain/composeResources/values-pl/strings-pl.xml
  • core/presentation/src/commonMain/composeResources/values-ru/strings-ru.xml
  • core/presentation/src/commonMain/composeResources/values-tr/strings-tr.xml
  • core/presentation/src/commonMain/composeResources/values-zh-rCN/strings-zh-rCN.xml
  • core/presentation/src/commonMain/composeResources/values/strings.xml
  • feature/favourites/presentation/src/commonMain/kotlin/zed/rainxch/favourites/presentation/FavouritesRoot.kt
  • feature/favourites/presentation/src/commonMain/kotlin/zed/rainxch/favourites/presentation/components/FavouriteRepositoryItem.kt
  • feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/components/sections/Others.kt
🚧 Files skipped from review as they are similar to previous changes (1)
  • feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/components/sections/Others.kt

…itoryItem`

- Reordered modifiers in `FavouriteRepositoryItem` to apply `clip` before `clickable` to ensure the ripple effect respects the rounded corners.
- Updated the `storage` string translation for Japanese, Korean, Hindi, and Italian locales.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@feature/favourites/presentation/src/commonMain/kotlin/zed/rainxch/favourites/presentation/components/FavouriteRepositoryItem.kt`:
- Around line 159-161: In FavouriteRepositoryItem.kt the three informational
chips currently use AssistChip with no-op onClick handlers (AssistChip instances
for language, release and added date); change them to non-interactive UI by
either setting the AssistChip to disabled (e.g., set enabled = false or onClick
= null if the Composable API supports it) so the chip renders with disabled
styling, or replace each AssistChip with a simple Row that composes an Icon and
Text (preserving the existing label content) to convey read-only information and
remove the misleading clickable behavior; update the corresponding AssistChip
usages (the AssistChip calls and their label lambdas) accordingly and ensure
accessibility semantics reflect non-interactivity.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2cf825b1-83dd-4680-8cb1-73cd1aac0b22

📥 Commits

Reviewing files that changed from the base of the PR and between e705c4b and 5349a07.

📒 Files selected for processing (5)
  • core/presentation/src/commonMain/composeResources/values-hi/strings-hi.xml
  • core/presentation/src/commonMain/composeResources/values-it/strings-it.xml
  • core/presentation/src/commonMain/composeResources/values-ja/strings-ja.xml
  • core/presentation/src/commonMain/composeResources/values-ko/strings-ko.xml
  • feature/favourites/presentation/src/commonMain/kotlin/zed/rainxch/favourites/presentation/components/FavouriteRepositoryItem.kt
🚧 Files skipped from review as they are similar to previous changes (2)
  • core/presentation/src/commonMain/composeResources/values-hi/strings-hi.xml
  • core/presentation/src/commonMain/composeResources/values-ja/strings-ja.xml

Comment on lines +159 to +161
AssistChip(
onClick = { /* No action */ },
label = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# First, let's search for the no-op click pattern in Kotlin files
rg -n --type=kt 'onClick\s*=\s*\{\s*/\*\s*No action\s*\*/\s*\}' -A 2 -B 2

Repository: OpenHub-Store/GitHub-Store

Length of output: 96


🏁 Script executed:

# Also search for the specific file mentioned
fd -t f "FavouriteRepositoryItem.kt"

Repository: OpenHub-Store/GitHub-Store

Length of output: 197


🏁 Script executed:

# Get the full content of the file to examine context around the mentioned lines
cat -n feature/favourites/presentation/src/commonMain/kotlin/zed/rainxch/favourites/presentation/components/FavouriteRepositoryItem.kt | sed -n '150,215p'

Repository: OpenHub-Store/GitHub-Store

Length of output: 3472


🏁 Script executed:

# Search for no-op click handlers more broadly (without -t kt which didn't work)
rg -n 'onClick\s*=\s*\{.*No action' -A 1 -B 1

Repository: OpenHub-Store/GitHub-Store

Length of output: 1614


🏁 Script executed:

# Check if there are disabled chips used elsewhere in the project
rg -n 'enabled\s*=\s*false' --type=kt -A 1 -B 1 | head -30

Repository: OpenHub-Store/GitHub-Store

Length of output: 96


🏁 Script executed:

# Look for patterns of how AssistChip or other chips are typically used
rg -n 'AssistChip\(' -A 3 | head -50

Repository: OpenHub-Store/GitHub-Store

Length of output: 3552


🏁 Script executed:

# Search for how AssistChip is used elsewhere with actual onClick handlers
rg -n 'AssistChip' -B 1 -A 6 | grep -A 6 "onClick" | head -40

Repository: OpenHub-Store/GitHub-Store

Length of output: 5449


🏁 Script executed:

# Check the full content of the file to see if there's any pattern in how these chips should be styled
cat -n feature/favourites/presentation/src/commonMain/kotlin/zed/rainxch/favourites/presentation/components/FavouriteRepositoryItem.kt | sed -n '145,230p'

Repository: OpenHub-Store/GitHub-Store

Length of output: 4070


Replace no-op AssistChip instances with non-interactive alternatives or explicitly disabled chips.

The language, release, and date chips are visually styled and clickable but have no-op handlers. This creates confusing interaction and accessibility semantics. Since these display purely informational content (language, release version, added date), use non-clickable rendering such as disabled chips with appropriate disabled styling, or replace with a simple Row containing Icon and Text.

Occurs at lines 160, 186, and 206.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@feature/favourites/presentation/src/commonMain/kotlin/zed/rainxch/favourites/presentation/components/FavouriteRepositoryItem.kt`
around lines 159 - 161, In FavouriteRepositoryItem.kt the three informational
chips currently use AssistChip with no-op onClick handlers (AssistChip instances
for language, release and added date); change them to non-interactive UI by
either setting the AssistChip to disabled (e.g., set enabled = false or onClick
= null if the Composable API supports it) so the chip renders with disabled
styling, or replace each AssistChip with a simple Row that composes an Icon and
Text (preserving the existing label content) to convey read-only information and
remove the misleading clickable behavior; update the corresponding AssistChip
usages (the AssistChip calls and their label lambdas) accordingly and ensure
accessibility semantics reflect non-interactivity.

- Added `getCacheSizeBytes` and `clearCacheFiles` to `FileLocationsProvider` with platform-specific implementations for Android and Desktop.
- Updated `ProfileRepository` and its implementation to support cache size observation and clearing.
- Enhanced `ProfileViewModel` to format cache sizes (B, KB, MB, GB) and handle `OnClearCacheClick` actions.
- Introduced `OnCacheCleared` and `OnCacheClearError` events to `ProfileEvent` and integrated them into `ProfileRoot` for snackbar notifications.
- Added the `cache_cleared` string resource.
- Updated `SharedModule` to provide `FileLocationsProvider` to `ProfileRepositoryImpl`.
- Added the `cache_cleared` string resource and its translations across multiple languages (pl, fr, ja, ko, es, hi, zh-rCN, bn, it, ru, tr) to the core presentation module.
@rainxchzed rainxchzed merged commit 75fce10 into main Mar 6, 2026
1 check passed
@rainxchzed rainxchzed deleted the cache-cleanup branch March 6, 2026 14:45
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