Repository navigation
fix(search): stop listing in-library titles under Available to request - #773
Conversation
Search showed a title the library already has twice: once in the library results and again in the Available to request row, marked "In library". Phone, tablet, and TV filtered that row only by media type. Drop results the server marks availability "available" from the row on phone and TV, the way the Apple and Roku clients do. When every match is in the library, hide the row instead of saying no requestable matches. Fixes #405 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Findings
|
| Layer / File(s) | Summary |
|---|---|
Shared filtering and search-screen behavior shared/src/commonMain/kotlin/org/siloserver/silo/model/request/RequestPresentation.kt, androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/search/RequestSearchSection.kt, androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/search/TvSearchScreen.kt |
Added withoutLibraryTitles() to exclude results marked RequestAvailability.Available. Android phone, tablet, and TV search use it to filter request results. If all matches are library titles, a submitted query alone no longer shows the section; loading and error states can still show it. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Low
Possibly related PRs
- Silo-Server/silo-android#736: Changes Android TV focus behavior for cards in the “Available to request” row. The set of visible cards can affect that focus path.
Suggested labels: bug, priority: P2, impact: usability, evidence-required, size/M
Suggested reviewers: rxwatcher
Merge Risk: 
Low · up to 9cb28
-
Some in-library titles can still appear in Available to request, causing duplicate request results in a narrow case.
Pre-merge checks: 
3 · 
2
-
Failed checks: 2 warnings Passed checks: 3 passed-
Full details: Out of Scope Changes check
-
Explanation
The diff changes the shared request-row filtering policy and its two Android consumers: the phone/tablet search section and the TV search screen. The changes directly support issue
#405. No unrelated product area or build change is present.
-
Full details: Linked Issues check
-
Explanation
Issue
#405requires the request row to exclude results withavailability: "available"or alibrary_content_id, and to hide the row when no requestable result remains. The sharedwithoutLibraryTitles()helper excludes onlyRequestAvailability.Available. The Android phone/tablet and TV screens correctly use the helper and suppress the no-requestable message when all filtered matches are library titles. Thelibrary_content_idcondition is not implemented. No linked issue requires a separate automated test change.Resolution
Update
withoutLibraryTitles()to exclude a result when its availability isRequestAvailability.Availableor itslibraryContentIdis present. Add focused automated coverage for both exclusion conditions and for retaining the no-match message when the result list is empty.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 3 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
3611aec4-1db5-4db9-9d71-7350217c912c
Files selected for processing: 3-
androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/search/RequestSearchSection.ktandroidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/search/TvSearchScreen.ktshared/src/commonMain/kotlin/org/siloserver/silo/model/request/RequestPresentation.kt
Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.
-
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (gpt-6.1-sol, reviewed 9cb28a8)
One verified source-level finding: F1 (P2). The 60 existing resolver and search-projection tests pass. I traced the coroutine, called the compiled resolver, and checked Compose focus-detachment behavior; I did not reproduce the timing on a device.
A return to a request card refreshes the row in place, and the effect re-ran while the old row was still showing. It matched the card there, took focus, and disarmed the return; when the refresh then dropped that card (a title that reached the library now leaves the row), focus went with it. Leave the row out of resolution while that refresh is in flight, so the target waits as pending under the existing bounds. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Problem
Closes #405
Validation tasks: none known. The issue came up while retesting #317 and #318 (C3); I couldn't read the validation board from this token.
Searching for a title the library already has shows it twice: in the library results, and again as the first card under Available to request, marked "In library". This happens on phone, tablet, foldable, and Android TV. The server already marks these results
availability: "available", but both search screens filtered that row only by media type.Approach
Search's request row now drops results the server marks
available, through one shared helper (withoutLibraryTitles()inRequestPresentation.kt) used by the phone and TV search screens. When every match is already in the library, the row is hidden instead of reading "No requestable matches found." A query with no matches at all still shows that message.On TV, a return to a request card now waits for the row's in-place refresh before restoring focus. Before, it could focus a card from the old row that the refresh then dropped, which this change makes possible when a title reaches the library while its detail page is open.
Apple (iOS, iPadOS, tvOS, macOS) and Roku already filter the row this way, so neither needs a change. Discover rows and the Requests page are unchanged and still show in-library titles with their status.
Validation
testDebugUnitTest: passes except one run whereProgressiveDirectPlayResumeIntegrationTest(android-shared playback, untouched here) failed. It passed onmain, passed three reruns on this branch, and the full:android-shared:testDebugUnitTest --rerunpassed.assembleDebugfor both apps pass. The two supply-chain scripts could not run on the build host becauserubyis missing; the change touches no build files.Evidence: https://evidence.siloserver.org/r/silo-android/issue-405/
Risks and follow-ups
AI disclosure
🤖 Generated with Claude Code