Add clear cache feature and refactor proxy models#299
Conversation
- 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.
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds 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
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
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (8)
feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileAction.ktfeature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileRoot.ktfeature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileState.ktfeature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileViewModel.ktfeature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/components/sections/Appearance.ktfeature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/components/sections/Network.ktfeature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/components/sections/Others.ktfeature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/model/ProxyType.kt
...ntation/src/commonMain/kotlin/zed/rainxch/profile/presentation/components/sections/Others.kt
Show resolved
Hide resolved
...file/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileViewModel.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
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 | 🟡 MinorLocalize 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 repeated32.dpsection 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
📒 Files selected for processing (3)
feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileRoot.ktfeature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/components/sections/About.ktfeature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/components/sections/Others.kt
...ntation/src/commonMain/kotlin/zed/rainxch/profile/presentation/components/sections/Others.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
🧹 Nitpick comments (1)
feature/starred/presentation/src/commonMain/kotlin/zed/rainxch/starred/presentation/components/StarredRepositoryItem.kt (1)
61-63: Avoid redundantfillMaxWidth()when usingExpressiveCard.
ExpressiveCardalready appliesfillMaxWidth()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
📒 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`.
There was a problem hiding this comment.
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
AssistChipcomponents have no-oponClickhandlers, making them appear interactive but non-functional. This could confuse users expecting tap behavior.Consider using
enabled = falseto visually indicate non-interactivity, or evaluate whether a simpler non-clickable composable (e.g., a styledRowwith 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
📒 Files selected for processing (15)
core/presentation/src/commonMain/composeResources/values-bn/strings-bn.xmlcore/presentation/src/commonMain/composeResources/values-es/strings-es.xmlcore/presentation/src/commonMain/composeResources/values-fr/strings-fr.xmlcore/presentation/src/commonMain/composeResources/values-hi/strings-hi.xmlcore/presentation/src/commonMain/composeResources/values-it/strings-it.xmlcore/presentation/src/commonMain/composeResources/values-ja/strings-ja.xmlcore/presentation/src/commonMain/composeResources/values-ko/strings-ko.xmlcore/presentation/src/commonMain/composeResources/values-pl/strings-pl.xmlcore/presentation/src/commonMain/composeResources/values-ru/strings-ru.xmlcore/presentation/src/commonMain/composeResources/values-tr/strings-tr.xmlcore/presentation/src/commonMain/composeResources/values-zh-rCN/strings-zh-rCN.xmlcore/presentation/src/commonMain/composeResources/values/strings.xmlfeature/favourites/presentation/src/commonMain/kotlin/zed/rainxch/favourites/presentation/FavouritesRoot.ktfeature/favourites/presentation/src/commonMain/kotlin/zed/rainxch/favourites/presentation/components/FavouriteRepositoryItem.ktfeature/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
core/presentation/src/commonMain/composeResources/values-hi/strings-hi.xml
Outdated
Show resolved
Hide resolved
core/presentation/src/commonMain/composeResources/values-it/strings-it.xml
Outdated
Show resolved
Hide resolved
core/presentation/src/commonMain/composeResources/values-ja/strings-ja.xml
Outdated
Show resolved
Hide resolved
core/presentation/src/commonMain/composeResources/values-ko/strings-ko.xml
Outdated
Show resolved
Hide resolved
.../commonMain/kotlin/zed/rainxch/favourites/presentation/components/FavouriteRepositoryItem.kt
Outdated
Show resolved
Hide resolved
…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.
There was a problem hiding this comment.
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
📒 Files selected for processing (5)
core/presentation/src/commonMain/composeResources/values-hi/strings-hi.xmlcore/presentation/src/commonMain/composeResources/values-it/strings-it.xmlcore/presentation/src/commonMain/composeResources/values-ja/strings-ja.xmlcore/presentation/src/commonMain/composeResources/values-ko/strings-ko.xmlfeature/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
| AssistChip( | ||
| onClick = { /* No action */ }, | ||
| label = { |
There was a problem hiding this comment.
🧩 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 2Repository: 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 1Repository: 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 -30Repository: 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 -50Repository: 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 -40Repository: 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.
ProxyTypeenum to a newmodelpackage.cacheSizetoProfileStateandOnClearCacheClicktoProfileAction.ProfileViewModelto handle cache clearing and observe cache size.othersSectionintoProfileRoot.Appearance.ktfor better UI consistency.Summary by CodeRabbit
New Features
UI
Style
Localization