feat: search in favourites + starred (#562)#581
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughSearch is added to Starred and Favourites: new OnSearchChange actions, searchQuery in state, view-model handlers, UI search bars, and case-insensitive filtering (name, owner, description, language). Release notes updated. ChangesSearch in Starred and Favourites
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Greptile Summary
Confidence Score: 5/5Safe to merge; all findings are P2 UX suggestions with no runtime errors or data-loss risk. Both previously-flagged P1 issues (missing isNotEmpty guard on Starred search bar; stale query on refresh) are resolved in this revision. Remaining comments are P2 quality-of-life gaps that do not affect correctness or data integrity. No files require special attention beyond the two P2 UX gaps noted in FavouritesRoot.kt and StarredReposRoot.kt. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User types in SearchBar] --> B[OnSearchChange dispatched]
B --> C[ViewModel updates searchQuery in state]
C --> D{favouriteRepositories / starredRepositories non-empty?}
D -- Yes --> E[remember recomputes filteredRepositories]
D -- No --> F[Search bar hidden, stale query persists in state]
E --> G{query blank?}
G -- Yes --> H[Show full list]
G -- No --> I[Filter: name / owner / description / language]
I --> J{filteredRepositories empty?}
J -- Yes --> K[Empty grid shown — no feedback ⚠️]
J -- No --> L[Render LazyVerticalStaggeredGrid]
F --> M[New favourite added later]
M --> N[Search bar reappears with stale query ⚠️]
Reviews (2): Last reviewed commit: "fix(starred): guard search bar + clear q..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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.
Inline comments:
In
`@feature/favourites/presentation/src/commonMain/kotlin/zed/rainxch/favourites/presentation/FavouritesRoot.kt`:
- Line 161: The code references Modifier.animateItem() in FavouritesRoot (the
composable using Modifier.animateItem()), but the extension import is missing;
add the import androidx.compose.foundation.lazy.staggeredgrid.animateItem to the
top of FavouritesRoot.kt (the imports section) so Modifier.animateItem()
resolves correctly.
In
`@feature/starred/presentation/src/commonMain/kotlin/zed/rainxch/starred/presentation/StarredReposRoot.kt`:
- Around line 155-159: StarredSearchBar is always rendered inside the Column
even when isSyncing && starredRepositories.isEmpty(), but the UI should only
show the search bar when the repository list is non-empty; update the
composition to conditionally render StarredSearchBar only when
starredRepositories.isNotEmpty() (or inverse check starredRepositories.isEmpty()
== false), keeping the same props (query = state.searchQuery and onQueryChange =
{ onAction(StarredReposAction.OnSearchChange(it)) }); ensure the condition uses
the same state/source where isSyncing and starredRepositories are defined so the
search bar is omitted during the empty-syncing state.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6ba95b50-5531-472e-ad8c-139b9c2748ba
📒 Files selected for processing (9)
core/presentation/src/commonMain/composeResources/files/whatsnew/17.jsonfeature/favourites/presentation/src/commonMain/kotlin/zed/rainxch/favourites/presentation/FavouritesAction.ktfeature/favourites/presentation/src/commonMain/kotlin/zed/rainxch/favourites/presentation/FavouritesRoot.ktfeature/favourites/presentation/src/commonMain/kotlin/zed/rainxch/favourites/presentation/FavouritesState.ktfeature/favourites/presentation/src/commonMain/kotlin/zed/rainxch/favourites/presentation/FavouritesViewModel.ktfeature/starred/presentation/src/commonMain/kotlin/zed/rainxch/starred/presentation/StarredReposAction.ktfeature/starred/presentation/src/commonMain/kotlin/zed/rainxch/starred/presentation/StarredReposRoot.ktfeature/starred/presentation/src/commonMain/kotlin/zed/rainxch/starred/presentation/StarredReposState.ktfeature/starred/presentation/src/commonMain/kotlin/zed/rainxch/starred/presentation/StarredReposViewModel.kt
| onDevProfileClick = { | ||
| onAction(FavouritesAction.OnDeveloperProfileClick(repo.repoOwner)) | ||
| }, | ||
| modifier = Modifier.animateItem(), |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify animateItem usage/import consistency in Kotlin sources
rg -n --type=kt '\banimateItem\s*\('
rg -n --type=kt 'import\s+androidx\.compose\.foundation\.lazy\.staggeredgrid\.animateItem'Repository: OpenHub-Store/GitHub-Store
Length of output: 124
🏁 Script executed:
#!/bin/bash
# Find the target file
fd "FavouritesRoot.kt" -type f
# If file exists, check its imports and content around line 161
if [ -f "feature/favourites/presentation/src/commonMain/kotlin/zed/rainxch/favourites/presentation/FavouritesRoot.kt" ]; then
echo "=== File found. Checking imports and line 161 ==="
echo "--- Imports section ---"
head -50 "feature/favourites/presentation/src/commonMain/kotlin/zed/rainxch/favourites/presentation/FavouritesRoot.kt" | grep -n "import"
echo ""
echo "--- Around line 161 ---"
sed -n '155,170p' "feature/favourites/presentation/src/commonMain/kotlin/zed/rainxch/favourites/presentation/FavouritesRoot.kt"
fiRepository: OpenHub-Store/GitHub-Store
Length of output: 3764
🏁 Script executed:
#!/bin/bash
# Search for all animateItem usages in kotlin files
rg "animateItem\s*\(" --glob="*.kt" -n
# Search for imports of animateItem from any source
rg "import.*animateItem" --glob="*.kt" -n
# Check if animateItem is defined anywhere in the project
rg "fun.*animateItem" --glob="*.kt" -n
rg "extension.*animateItem" --glob="*.kt" -nRepository: OpenHub-Store/GitHub-Store
Length of output: 1489
🏁 Script executed:
#!/bin/bash
# Check imports in one other file that uses animateItem
echo "=== Checking SearchRoot.kt imports ==="
head -60 "feature/search/presentation/src/commonMain/kotlin/zed/rainxch/search/presentation/SearchRoot.kt" | grep "import.*staggeredgrid"Repository: OpenHub-Store/GitHub-Store
Length of output: 407
Add missing import for animateItem() extension function.
Line 161 uses Modifier.animateItem() without importing the extension from androidx.compose.foundation.lazy.staggeredgrid, which will cause an unresolved reference compile error.
Proposed fix
import androidx.compose.foundation.lazy.staggeredgrid.LazyVerticalStaggeredGrid
import androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridCells
+import androidx.compose.foundation.lazy.staggeredgrid.animateItem
import androidx.compose.foundation.lazy.staggeredgrid.items
import androidx.compose.foundation.lazy.staggeredgrid.rememberLazyStaggeredGridState🤖 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/favourites/presentation/src/commonMain/kotlin/zed/rainxch/favourites/presentation/FavouritesRoot.kt`
at line 161, The code references Modifier.animateItem() in FavouritesRoot (the
composable using Modifier.animateItem()), but the extension import is missing;
add the import androidx.compose.foundation.lazy.staggeredgrid.animateItem to the
top of FavouritesRoot.kt (the imports section) so Modifier.animateItem()
resolves correctly.
Add inline search bar to Favourites and Starred screens, matching the existing Apps-screen search pattern. Filter is case-insensitive across repo name, owner, description, and primary language. Closes #562.
UX: search bar appears above the grid only when the underlying list is non-empty (no clutter on empty state). Clear-X trailing icon resets the query.
remember-cached filter recomputes only when list or query changes.Note: ~/.gradle was unmounted during this session — no local compile-verify. Visual review only. Please compile-check before merge:
:feature:favourites:presentationand:feature:starred:presentation(both Android + JVM targets).Summary by CodeRabbit