Skip to content

fix(home): one-tap disable for hide-seen empty state#596

Draft
rainxchzed wants to merge 2 commits into
mainfrom
fix/hide-seen-toggle-off
Draft

fix(home): one-tap disable for hide-seen empty state#596
rainxchzed wants to merge 2 commits into
mainfrom
fix/hide-seen-toggle-off

Conversation

@rainxchzed
Copy link
Copy Markdown
Member

@rainxchzed rainxchzed commented May 14, 2026

Sprint 3 Task 11. Mirrors Search empty-state pattern. When repos.isNotEmpty() && visibleRepos.isEmpty() && isHideSeenEnabled: auto-paginate while hasMorePages; else show banner + "Disable 'Hide seen' filter" button → flips global toggle off.

Test plan

  • Android + JVM compile clean
  • 13 18.json valid
  • Real-device smoke: mark all Home repos seen → banner → tap → grid restored

Source: 九幽 email, v1.8.1 zh-CN.

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

rainxchzed has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 14, 2026

Walkthrough

This PR implements automatic page-loading when the hide-seen filter hides all results, adds two new empty-state UIs to reflect search progress, and documents the feature in release notes across 13 localized versions. The feature detects filtering conditions, triggers additional data loads, and provides a button to disable the filter when pagination is exhausted.

Changes

Hide-Seen Filter Auto-Load Feature

Layer / File(s) Summary
Hide-seen disable action type
feature/home/presentation/src/commonMain/kotlin/zed/rainxch/home/presentation/HomeAction.kt
New OnDisableHideSeenForResults variant added to sealed HomeAction interface to enable UI-triggered filter disabling.
Filter detection and auto-load effect
feature/home/presentation/src/commonMain/kotlin/zed/rainxch/home/presentation/HomeRoot.kt
MainState detects isHideSeenFilteringAll condition and automatically triggers HomeAction.LoadMore via LaunchedEffect when all loaded repos are hidden but more pages exist.
Empty-state UI rendering
feature/home/presentation/src/commonMain/kotlin/zed/rainxch/home/presentation/HomeRoot.kt
UI branches on hide-seen-filtering-all to show centered progress indicator while searching for unseen content, or hidden-results empty state with button to disable filter once pagination exhausted.
Disable-filter action handler
feature/home/presentation/src/commonMain/kotlin/zed/rainxch/home/presentation/HomeViewModel.kt
Handler for OnDisableHideSeenForResults calls tweaksRepository.setHideSeenEnabled(false) in viewModelScope coroutine.

Release Notes Localization

Layer / File(s) Summary
Localized v1.8.3 release notes
core/presentation/src/commonMain/composeResources/files/whatsnew/18.json, whatsnew/ar/18.json, whatsnew/bn/18.json, whatsnew/es/18.json, whatsnew/fr/18.json, whatsnew/hi/18.json, whatsnew/it/18.json, whatsnew/ja/18.json, whatsnew/ko/18.json, whatsnew/pl/18.json, whatsnew/ru/18.json, whatsnew/tr/18.json, whatsnew/zh-CN/18.json
New FIXED section added to each language version documenting hide-seen filter behavior: disabling from Home with one-tap reset when filter empties grid.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 A rabbit hops through filters deep,
When hidden repos hide their keep,
The page keeps loading, tap to see,
All repos shown, now filter-free!
One bound, two bounds, released at last,
The hide-seen feature's here to last! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a one-tap disable action for the hide-seen empty state, which is the core feature implemented across HomeAction, HomeViewModel, HomeRoot, and release notes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/hide-seen-toggle-off

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown
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/home/presentation/src/commonMain/kotlin/zed/rainxch/home/presentation/HomeViewModel.kt (1)

601-605: 💤 Low value

Consider adding error handling for consistency.

While this follows the pattern used for other TweaksRepository operations (e.g., line 185), repository operations targeting HiddenReposRepository and SeenReposRepository include try-catch blocks with CancellationException handling (lines 526-542, 544-554, 556-575, 577-587). If setHideSeenEnabled can throw, adding error handling would improve robustness and consistency.

🛡️ Defensive error handling pattern
 HomeAction.OnDisableHideSeenForResults -> {
     viewModelScope.launch {
-        tweaksRepository.setHideSeenEnabled(false)
+        try {
+            tweaksRepository.setHideSeenEnabled(false)
+        } catch (e: CancellationException) {
+            throw e
+        } catch (e: Throwable) {
+            logger.warn("Failed to disable hide-seen filter: ${e.message}")
+        }
     }
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@feature/home/presentation/src/commonMain/kotlin/zed/rainxch/home/presentation/HomeViewModel.kt`
around lines 601 - 605, The HomeAction.OnDisableHideSeenForResults handler
currently launches viewModelScope.launch and calls
tweaksRepository.setHideSeenEnabled(false) without error handling; wrap that
call in a try-catch like the other handlers (e.g., the
HiddenReposRepository/SeenReposRepository blocks) so CancellationException is
rethrown and other exceptions are caught and handled (log the error and update
any UI/error state as appropriate). Specifically, update the
viewModelScope.launch in the HomeAction.OnDisableHideSeenForResults branch to
try { tweaksRepository.setHideSeenEnabled(false) } catch (e:
CancellationException) { throw e } catch (e: Exception) { /* log via logger or
processLogger and surface error to UI/state */ }.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@feature/home/presentation/src/commonMain/kotlin/zed/rainxch/home/presentation/HomeViewModel.kt`:
- Around line 601-605: The HomeAction.OnDisableHideSeenForResults handler
currently launches viewModelScope.launch and calls
tweaksRepository.setHideSeenEnabled(false) without error handling; wrap that
call in a try-catch like the other handlers (e.g., the
HiddenReposRepository/SeenReposRepository blocks) so CancellationException is
rethrown and other exceptions are caught and handled (log the error and update
any UI/error state as appropriate). Specifically, update the
viewModelScope.launch in the HomeAction.OnDisableHideSeenForResults branch to
try { tweaksRepository.setHideSeenEnabled(false) } catch (e:
CancellationException) { throw e } catch (e: Exception) { /* log via logger or
processLogger and surface error to UI/state */ }.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: be6e656d-243f-47fd-903f-f462f7a26ec4

📥 Commits

Reviewing files that changed from the base of the PR and between ec584cf and dae92cf.

📒 Files selected for processing (16)
  • core/presentation/src/commonMain/composeResources/files/whatsnew/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/ar/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/bn/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/es/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/fr/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/hi/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/it/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/ja/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/ko/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/pl/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/ru/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/tr/18.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/zh-CN/18.json
  • feature/home/presentation/src/commonMain/kotlin/zed/rainxch/home/presentation/HomeAction.kt
  • feature/home/presentation/src/commonMain/kotlin/zed/rainxch/home/presentation/HomeRoot.kt
  • feature/home/presentation/src/commonMain/kotlin/zed/rainxch/home/presentation/HomeViewModel.kt

@rainxchzed rainxchzed marked this pull request as draft May 14, 2026 06:17
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