Skip to content

Media request system for iOS, tvOS, and macOS - #44

Merged
Quick104 merged 2 commits into
mainfrom
feature/requests
Jul 2, 2026
Merged

Quick104 merged 2 commits into
mainfrom
feature/requests

Conversation

@Quick104

@Quick104 Quick104 commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Brings the server's media-request system (already live on web and Android) to the Apple clients — user-facing only; moderation stays in the web admin. The entire feature is gated on GET /api/v1/requests/status, so servers without the feature (or with it disabled, or pre-requests servers that 404 the probe) show no request UI at all.

UX

  • Request from search — the library SearchView grows an "Available to request" TMDB section below local results: request the title you just failed to find, with the query already typed (one extra row on tvOS, no second keyboard).
  • Requests hub (Route.requestsHub) — TMDB search, the user's own requests strip with status ribbons, and Trending / Crowd favorites discover carousels. Entry: profile avatar menu (iOS), profile dropdown (tvOS).
  • Request detail — slim title page with ONE server-state-computed primary action that morphs in place (Request → Requesting… → Pending); no confirmation dialog. Kept as a single Button identity so tvOS focus never drops mid-morph. Completed titles route to the real item detail.
  • My Requests — In motion / Landed in your library / Needs attention buckets (web "Yours" parity), per-quality target summaries ("1080p done · 4K downloading"), cancel for pending requests.
  • Status language — monochrome chips/ribbons with a single colored dot (amber pending / sky on-the-way / emerald in-library / rose needs-attention), identical mapping on both platforms.

Architecture

  • Typed endpoints as a ContinuumAPI extension; wire models rely on the existing snake_case decoding with unknown-tolerant enums (a new server status can never fail a whole payload).
  • Tested pure core (Screens/Requests/Core/) for status mapping, bucketing, error-token copy, TMDB image URLs, and carousel merging — mirrors Android's RequestPresentation so both clients encode identical rules.
  • RequestsFeatureStore clones the AICapabilities capability-gate pattern (generation-guarded; reset on sign-out / profile / server switch).
  • RequestsEventBus patches every visible card/ribbon in place after a create/cancel.
  • UX concepts in docs/requests/mockups.html.

Testing

  • Silo (iOS), SiloTV (tvOS), and SiloMac all build green.
  • 26 focused XCTests on the pure core (status mapping, bucketing, error copy, image URLs, carousel merge) all pass.
  • Wire shapes verified field-for-field against silo-server (internal/requests/types.go, handlers, router), including date formats and the POST /requests/ trailing-slash route.
  • Remaining before merge: smoke test against a live server with requests enabled; tvOS d-pad pass on device (dropdown row entry + detail button morph).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added a server-gated Requests experience, including hub, request detail, and “My Requests.”
    • Added request search, discovery carousels, request status chips, and request-aware routing for iOS and tvOS.
    • Added request creation, cancellation, and UI updates across hub/search/detail/my-requests.
  • Documentation
    • Added a full UX/design specification for Silo Requests (iOS + tvOS) including status language.
  • Tests
    • Added unit tests for request bucketing, UI display state, error messaging, image URL building/carousel merging, and request status behavior.

Bring the server's media-request system (already live on web and
Android) to the Apple clients, user-facing only — moderation stays in
the web admin. Everything is gated on GET /requests/status, so servers
without the feature (or with it disabled) show no request UI at all.

Entry points follow how requests actually happen:
- Library search grows an "Available to request" TMDB section below
  local results — request the thing you just failed to find, with the
  query already typed (one extra row on tvOS, no second keyboard).
- A Requests hub (profile avatar menu on iOS, profile dropdown on tvOS)
  with TMDB search, the user's own requests strip, and Trending /
  Crowd favorites discover carousels.
- Request detail: slim title page with ONE server-state-computed
  action that morphs in place (single Button identity, tvOS focus-safe)
  — no confirmation dialog. Completed titles open the real library item.
- My Requests: In motion / Landed in your library / Needs attention
  buckets, per-quality target summaries, cancel for pending requests.

Architecture:
- Typed endpoints as a ContinuumAPI extension; wire models decode via
  the existing snake_case strategy with unknown-tolerant enums.
- Tested pure core (Screens/Requests/Core/) for the five-state status
  mapping, bucketing, error-token copy, TMDB image URLs, and carousel
  merging — mirrors Android's RequestPresentation so both clients
  encode identical rules. 26 focused XCTests.
- RequestsFeatureStore mirrors the AICapabilities capability-gate
  pattern (generation-guarded, reset on sign-out/profile/server switch).
- RequestsEventBus patches every visible card/ribbon in place after a
  create/cancel instead of refetching whole screens.
- Status language: monochrome chips/ribbons with a single colored dot
  (amber pending, sky on-the-way, emerald in library, rose attention).

UX concepts in docs/requests/mockups.html.

Co-Authored-By: Claude Fable 5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 2, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c180b336-a28d-4d37-823b-29a7430e2a1e

📥 Commits

Reviewing files that changed from the base of the PR and between 2522d14 and c53f7e5.

📒 Files selected for processing (7)
  • iosApp/iosApp/Networking/ServerRegistry.swift
  • iosApp/iosApp/Screens/Requests/Components/RequestMediaCard.swift
  • iosApp/iosApp/Screens/Requests/Detail/RequestDetailView.swift
  • iosApp/iosApp/Screens/Requests/Detail/RequestDetailViewModel.swift
  • iosApp/iosApp/Screens/Requests/Hub/RequestsHubViewModel.swift
  • iosApp/iosApp/Screens/Requests/MyRequests/MyRequestsViewModel.swift
  • iosApp/iosApp/Screens/Requests/Search/RequestSearchSectionViewModel.swift
🚧 Files skipped from review as they are similar to previous changes (7)
  • iosApp/iosApp/Networking/ServerRegistry.swift
  • iosApp/iosApp/Screens/Requests/MyRequests/MyRequestsViewModel.swift
  • iosApp/iosApp/Screens/Requests/Detail/RequestDetailViewModel.swift
  • iosApp/iosApp/Screens/Requests/Hub/RequestsHubViewModel.swift
  • iosApp/iosApp/Screens/Requests/Components/RequestMediaCard.swift
  • iosApp/iosApp/Screens/Requests/Detail/RequestDetailView.swift
  • iosApp/iosApp/Screens/Requests/Search/RequestSearchSectionViewModel.swift

📝 Walkthrough

Walkthrough

This PR adds a media-requests feature across iOS and tvOS, including request models and API calls, feature gating and update propagation, request hub/detail/my-requests screens, search and menu entry points, tests, and a documentation mockup page.

Changes

Media Requests Feature

Layer / File(s) Summary
Request models and API
iosApp/iosApp/Networking/RequestsModels.swift, iosApp/iosApp/Networking/ContinuumAPI+Requests.swift
Defines request wire models and adds ContinuumAPI endpoints for status, search, discover, detail, create, mine, and cancel.
Feature gating and lifecycle resets
iosApp/iosApp/Networking/RequestsFeatureStore.swift, iosApp/iosApp/Screens/Requests/RequestsEventBus.swift, iosApp/iosApp/Networking/ServerRegistry.swift, iosApp/iosApp/Screens/Auth/AuthService.swift, iosApp/iosApp/ContentView.swift, iosApp/iosApp/Navigation/Route.swift, iosApp/iosApp/tvOS/Navigation/TVMainTabView.swift, iosApp/iosApp/tvOS/Navigation/TVTopMenuBar.swift
Adds the cached requests feature flag, mutation event bus, reset/refresh wiring, and new request routes and tvOS profile-menu handling.
Request state helpers and tests
iosApp/iosApp/Screens/Requests/Core/*.swift, iosApp/Tests/*.swift
Adds display-state mapping, bucketing, carousel merging, error copy, image URL building, state patching, and unit tests.
Request card and status UI
iosApp/iosApp/Screens/Requests/Components/*.swift, iosApp/iosApp/Theme/Colors.swift
Adds the shared rail, poster card, status chip, poster ribbon, and request status colors.
Requests hub and search
iosApp/iosApp/Screens/Requests/Hub/*.swift, iosApp/iosApp/Screens/Requests/Search/*.swift, iosApp/iosApp/Screens/Search/SearchView.swift
Adds the hub screen and search strip with debounced search, discover loading, and in-place update propagation.
Request detail screen
iosApp/iosApp/Screens/Requests/Detail/*.swift
Adds the detail screen with platform-specific layouts, submit flow, recommendations, and request-state-driven CTA behavior.
My Requests tracker
iosApp/iosApp/Screens/Requests/MyRequests/*.swift
Adds the bucketed tracker screen with cancel actions and request-update handling.
Search and top-bar entry points
iosApp/iosApp/Components/TabTopBarActions.swift, iosApp/iosApp/Screens/Browse/LibrariesTabView.swift, iosApp/iosApp/Screens/Calendar/CalendarView.swift, iosApp/iosApp/Screens/Home/HomeView.swift, iosApp/iosApp/Screens/Recommendations/RecommendationsView.swift
Wires Requests entry points into shared top-bar/profile-menu actions and screen navigation.
Requests mockup HTML page
docs/requests/mockups.html
Adds the standalone mockup document with iPhone and tvOS request-flow sections plus the status mapping table.

Estimated code review effort: 4 (Complex) | ~75 minutes

Sequence Diagram(s)

sequenceDiagram
  participant RequestDetailView
  participant RequestDetailViewModel
  participant ContinuumAPI
  participant RequestsEventBus
  RequestDetailView->>RequestDetailViewModel: submitRequest()
  RequestDetailViewModel->>ContinuumAPI: createRequest(input)
  ContinuumAPI-->>RequestDetailViewModel: MediaRequest
  RequestDetailViewModel->>RequestsEventBus: publish(record)
  RequestDetailViewModel->>ContinuumAPI: requestsDetail(mediaType, tmdbId)
  ContinuumAPI-->>RequestDetailViewModel: refreshed detail
  RequestDetailViewModel-->>RequestDetailView: updated primary action
Loading
sequenceDiagram
  participant RequestsHubView
  participant RequestsHubViewModel
  participant ContinuumAPI
  RequestsHubView->>RequestsHubViewModel: load()
  RequestsHubViewModel->>ContinuumAPI: requestsDiscover()
  RequestsHubViewModel->>ContinuumAPI: myRequests()
  ContinuumAPI-->>RequestsHubViewModel: sections + requests
  RequestsHubView->>RequestsHubViewModel: onQueryChanged()
  RequestsHubViewModel->>ContinuumAPI: requestsSearch(query)
  ContinuumAPI-->>RequestsHubViewModel: search results
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding a media request system across Apple platforms.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ 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 feature/requests

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2522d147cb

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

#else
.buttonStyle(.borderless)
#endif
.disabled(!action.isInteractive)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep the tvOS request CTA in the focus graph

On tvOS, after the user presses Request, primaryAction transitions to .submitting and then .status, making action.isInteractive false. Applying .disabled(true) removes that Button from tvOS's focus graph, so the currently focused CTA drops focus during the morph despite the stable Button identity this view is relying on. Keep the button focusable on tvOS and ignore taps for noninteractive states instead.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 (5)
iosApp/iosApp/Screens/Requests/Hub/RequestsHubView.swift (1)

41-45: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Duplicated event-bus wiring across screens.

This exact .onChange(of: RequestsEventBus.shared.lastUpdate) { _, update in if let update { viewModel.applyRequestUpdate(update) } } block is repeated verbatim in RequestDetailView.swift (lines 36-40) and MyRequestsView.swift (lines 36-40). Consider extracting a small view modifier (e.g. .onRequestBusUpdate { viewModel.applyRequestUpdate($0) }) to keep the three screens in sync if the bus contract changes.

🤖 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 `@iosApp/iosApp/Screens/Requests/Hub/RequestsHubView.swift` around lines 41 -
45, The RequestsEventBus update handler is duplicated across multiple screens,
so extract the repeated `.onChange(of: RequestsEventBus.shared.lastUpdate)`
logic into a reusable view modifier or helper (for example, an
`onRequestBusUpdate` modifier) and use it from `RequestsHubView`,
`RequestDetailView`, and `MyRequestsView` to keep the `applyRequestUpdate`
wiring centralized.
iosApp/iosApp/Screens/Requests/Detail/RequestDetailView.swift (1)

230-273: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Morph animation doesn't cover non-interactive → non-interactive transitions.

value: action.isInteractive only changes between .request/.openInLibrary and everything else. Going from .submitting to .status(.pending), or between different .status cases, won't trigger the animation, so the icon/label swap is an abrupt cut rather than the "morphs into the status in place" behavior described in the header doc comment (Lines 3-11).

💡 Proposed fix (requires RequestPrimaryAction: Equatable, already declared)
-        .animation(.easeOut(duration: 0.15), value: action.isInteractive)
+        .animation(.easeOut(duration: 0.15), value: action)
🤖 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 `@iosApp/iosApp/Screens/Requests/Detail/RequestDetailView.swift` around lines
230 - 273, The primary action button animation in RequestDetailView only tracks
action.isInteractive, so non-interactive state changes like .submitting to
.status or between different .status cases do not animate. Update
primaryActionButton to drive the animation from the full RequestPrimaryAction
value instead, and make sure RequestPrimaryAction conforms to Equatable so
SwiftUI can detect transitions and morph the icon/label changes in place.
iosApp/iosApp/Screens/Requests/Hub/RequestsHubViewModel.swift (1)

71-84: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Search failures are indistinguishable from "no results".

On a thrown error (e.g. network failure) performSearch sets searchResults = [] and hasSearched = true, which renders the "No matches / Nothing on TMDB matched that search" empty state (Line 88-96 in RequestsHubView.swift). A connectivity failure is presented identically to a genuine empty result, which can mislead users into thinking their search term doesn't exist on TMDB.

💡 Proposed fix
     private func performSearch(_ trimmed: String) async {
         isSearching = true
         do {
             let page = try await api.requestsSearch(query: trimmed)
             guard !Task.isCancelled else { return }
             searchResults = page.results.filter { $0.mediaType != .unknown }
             hasSearched = true
         } catch {
             guard !Task.isCancelled else { return }
-            searchResults = []
-            hasSearched = true
+            searchResults = []
+            hasSearched = false
+            searchError = ErrorState(error)
         }
         isSearching = false
     }
🤖 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 `@iosApp/iosApp/Screens/Requests/Hub/RequestsHubViewModel.swift` around lines
71 - 84, The search error handling in performSearch currently treats failures
the same as empty results by clearing searchResults and setting hasSearched,
which triggers the generic empty state in RequestsHubView. Update
RequestsHubViewModel.performSearch to record search failures separately from a
successful empty page, using a distinct error/loading state or flag that
RequestsHubView can check before showing “No matches,” so network or API errors
are surfaced differently from genuine no-result searches.
iosApp/iosApp/Screens/Requests/MyRequests/MyRequestsView.swift (1)

3-6: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Doc comment claims "swipe on iOS" but only long-press context menu is implemented.

The header comment describes swipe-to-cancel on iOS, but requestRow only wires .contextMenu (long-press), identical to the tvOS path. Rows are also a custom VStack/ForEach, not a List, so native .swipeActions isn't directly available here. Either update the comment to reflect the actual (long-press) interaction, or migrate rows into a List and add real swipe actions for the more discoverable iOS-idiomatic cancel gesture.

Also applies to: 112-158

🤖 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 `@iosApp/iosApp/Screens/Requests/MyRequests/MyRequestsView.swift` around lines
3 - 6, The MyRequestsView documentation is out of sync with the actual
cancellation interaction: the comment says iOS supports swipe-to-cancel, but
requestRow currently only provides a long-press context menu. Update the header
comment in MyRequestsView to describe the implemented behavior, or if you want
true iOS swipe cancellation, refactor the row rendering in requestRow into a
List-based presentation and add swipeActions while keeping the tvOS contextMenu
path.
iosApp/iosApp/Screens/Requests/Search/RequestSearchSectionViewModel.swift (1)

25-39: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

Duplicate debounce pattern across search view models.

This onQueryChanged reimplements the same 300ms-debounce/cancel/trim skeleton already present in SearchViewModel.onQueryChanged and RequestsHubViewModel.onQueryChanged. Consider extracting a small shared debouncer utility to avoid drift between the three copies (e.g., mismatched debounce durations if one is tuned later).

🤖 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 `@iosApp/iosApp/Screens/Requests/Search/RequestSearchSectionViewModel.swift`
around lines 25 - 39, The 300ms debounce/cancel logic in onQueryChanged is
duplicated across multiple search view models, which risks them drifting apart
over time. Extract the shared debounce flow into a small reusable helper used by
RequestSearchSectionViewModel.onQueryChanged, SearchViewModel.onQueryChanged,
and RequestsHubViewModel.onQueryChanged so they all call the same utility and
keep one debounce duration/source of truth.
🤖 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 `@iosApp/iosApp/Networking/ServerRegistry.swift`:
- Around line 202-206: The server switch/remove flow resets RequestsFeatureStore
but does not refresh its state, so Requests entry points can stay hidden when
router.authState remains authenticated. After the existing resets in the
ServerRegistry path, also trigger RequestsFeatureStore.shared.refresh() (or the
equivalent refresh path used elsewhere) so the feature re-evaluates immediately
after a server change, alongside AICapabilities.shared.reset() and
RequestsEventBus.shared.reset().

In `@iosApp/iosApp/Screens/Requests/Components/RequestMediaCard.swift`:
- Around line 47-68: The tvOS branch in RequestMediaCard.body defines
Button(action: onTap) with only posterImage inside it, so the accessible label
does not include the caption text. Update the tvOS button to expose an explicit
accessibility label or otherwise make caption part of the button’s label so
VoiceOver announces the request title/year, while keeping the existing VStack
layout and .buttonStyle(.card) structure intact.

In `@iosApp/iosApp/Screens/Requests/Detail/RequestDetailViewModel.swift`:
- Around line 109-117: The untracked reload in applyRequestUpdate(_:), triggered
from the bus consumer path, can overlap and let older load() results overwrite
newer ones. Update RequestDetailViewModel to keep a reference to the in-flight
reload Task and cancel/replace it before starting a new reload, so only the
latest request update can complete and apply data. Use applyRequestUpdate(_:),
load(), and the existing isSubmitting/detail guards to locate and wire the fix.

In `@iosApp/iosApp/Screens/Requests/MyRequests/MyRequestsViewModel.swift`:
- Around line 54-60: The reload logic in
`MyRequestsViewModel.applyRequestUpdate(_:)` starts a new untracked Task for
every bus event, so overlapping refreshes can race and apply out-of-order
results. Add a stored in-flight reload task (or equivalent cancellation handle)
in `MyRequestsViewModel`, cancel any existing reload before starting a new
`load()` task, and clear/reset it when the load finishes, mirroring the fix used
in `RequestDetailViewModel.applyRequestUpdate`.

In `@iosApp/iosApp/Screens/Requests/Search/RequestSearchSectionViewModel.swift`:
- Around line 41-58: `performSearch(_:)` can leave `isLoading` stuck true when
the async task is cancelled before completion. Ensure `isLoading` is always
reset on every exit path by moving the cleanup into a defer or equivalent in
`RequestSearchSectionViewModel.performSearch`, so both the success, error, and
cancellation paths clear the loading state even when `Task.isCancelled` triggers
an early return.

---

Nitpick comments:
In `@iosApp/iosApp/Screens/Requests/Detail/RequestDetailView.swift`:
- Around line 230-273: The primary action button animation in RequestDetailView
only tracks action.isInteractive, so non-interactive state changes like
.submitting to .status or between different .status cases do not animate. Update
primaryActionButton to drive the animation from the full RequestPrimaryAction
value instead, and make sure RequestPrimaryAction conforms to Equatable so
SwiftUI can detect transitions and morph the icon/label changes in place.

In `@iosApp/iosApp/Screens/Requests/Hub/RequestsHubView.swift`:
- Around line 41-45: The RequestsEventBus update handler is duplicated across
multiple screens, so extract the repeated `.onChange(of:
RequestsEventBus.shared.lastUpdate)` logic into a reusable view modifier or
helper (for example, an `onRequestBusUpdate` modifier) and use it from
`RequestsHubView`, `RequestDetailView`, and `MyRequestsView` to keep the
`applyRequestUpdate` wiring centralized.

In `@iosApp/iosApp/Screens/Requests/Hub/RequestsHubViewModel.swift`:
- Around line 71-84: The search error handling in performSearch currently treats
failures the same as empty results by clearing searchResults and setting
hasSearched, which triggers the generic empty state in RequestsHubView. Update
RequestsHubViewModel.performSearch to record search failures separately from a
successful empty page, using a distinct error/loading state or flag that
RequestsHubView can check before showing “No matches,” so network or API errors
are surfaced differently from genuine no-result searches.

In `@iosApp/iosApp/Screens/Requests/MyRequests/MyRequestsView.swift`:
- Around line 3-6: The MyRequestsView documentation is out of sync with the
actual cancellation interaction: the comment says iOS supports swipe-to-cancel,
but requestRow currently only provides a long-press context menu. Update the
header comment in MyRequestsView to describe the implemented behavior, or if you
want true iOS swipe cancellation, refactor the row rendering in requestRow into
a List-based presentation and add swipeActions while keeping the tvOS
contextMenu path.

In `@iosApp/iosApp/Screens/Requests/Search/RequestSearchSectionViewModel.swift`:
- Around line 25-39: The 300ms debounce/cancel logic in onQueryChanged is
duplicated across multiple search view models, which risks them drifting apart
over time. Extract the shared debounce flow into a small reusable helper used by
RequestSearchSectionViewModel.onQueryChanged, SearchViewModel.onQueryChanged,
and RequestsHubViewModel.onQueryChanged so they all call the same utility and
keep one debounce duration/source of truth.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6982e366-afc9-4a84-852c-6acd1928c1d3

📥 Commits

Reviewing files that changed from the base of the PR and between 41ab13c and 2522d14.

📒 Files selected for processing (39)
  • docs/requests/mockups.html
  • iosApp/Tests/MyRequestsBucketTests.swift
  • iosApp/Tests/RequestDisplayStateTests.swift
  • iosApp/Tests/RequestErrorCopyTests.swift
  • iosApp/Tests/RequestImageURLTests.swift
  • iosApp/iosApp/Components/TabTopBarActions.swift
  • iosApp/iosApp/ContentView.swift
  • iosApp/iosApp/Navigation/Route.swift
  • iosApp/iosApp/Networking/ContinuumAPI+Requests.swift
  • iosApp/iosApp/Networking/RequestsFeatureStore.swift
  • iosApp/iosApp/Networking/RequestsModels.swift
  • iosApp/iosApp/Networking/ServerRegistry.swift
  • iosApp/iosApp/Screens/Auth/AuthService.swift
  • iosApp/iosApp/Screens/Browse/LibrariesTabView.swift
  • iosApp/iosApp/Screens/Calendar/CalendarView.swift
  • iosApp/iosApp/Screens/Home/HomeView.swift
  • iosApp/iosApp/Screens/Recommendations/RecommendationsView.swift
  • iosApp/iosApp/Screens/Requests/Components/RequestCardRail.swift
  • iosApp/iosApp/Screens/Requests/Components/RequestMediaCard.swift
  • iosApp/iosApp/Screens/Requests/Components/RequestStatusChip.swift
  • iosApp/iosApp/Screens/Requests/Core/MyRequestsBucket.swift
  • iosApp/iosApp/Screens/Requests/Core/RequestCarouselMerge.swift
  • iosApp/iosApp/Screens/Requests/Core/RequestDisplayState.swift
  • iosApp/iosApp/Screens/Requests/Core/RequestErrorCopy.swift
  • iosApp/iosApp/Screens/Requests/Core/RequestImageURL.swift
  • iosApp/iosApp/Screens/Requests/Core/RequestStateSync.swift
  • iosApp/iosApp/Screens/Requests/Detail/RequestDetailView.swift
  • iosApp/iosApp/Screens/Requests/Detail/RequestDetailViewModel.swift
  • iosApp/iosApp/Screens/Requests/Hub/RequestsHubView.swift
  • iosApp/iosApp/Screens/Requests/Hub/RequestsHubViewModel.swift
  • iosApp/iosApp/Screens/Requests/MyRequests/MyRequestsView.swift
  • iosApp/iosApp/Screens/Requests/MyRequests/MyRequestsViewModel.swift
  • iosApp/iosApp/Screens/Requests/RequestsEventBus.swift
  • iosApp/iosApp/Screens/Requests/Search/RequestSearchSectionView.swift
  • iosApp/iosApp/Screens/Requests/Search/RequestSearchSectionViewModel.swift
  • iosApp/iosApp/Screens/Search/SearchView.swift
  • iosApp/iosApp/Theme/Colors.swift
  • iosApp/iosApp/tvOS/Navigation/TVMainTabView.swift
  • iosApp/iosApp/tvOS/Navigation/TVTopMenuBar.swift

- tvOS: keep the detail CTA enabled in non-interactive states — a
  disabled Button drops out of the focus graph, yanking focus mid-morph
  after submit (the exact drop the single-Button design prevents). The
  action closure already ignores presses in those states. iOS keeps
  .disabled. (Codex P2)
- Re-probe requests_enabled after server switch/remove: switching
  between signed-in servers can keep authState at .authenticated, which
  skipped the usual refresh and left entry points hidden until the next
  foreground. (CodeRabbit)
- tvOS card accessibility: explicit label (title, year, status) on the
  poster button, whose caption lives outside the .card-style label.
- Track and cancel-replace bus-triggered reloads in
  RequestDetailViewModel/MyRequestsViewModel so a slow earlier response
  can't overwrite a newer event's result.
- Clear isLoading/isSearching on the cancellation early-returns in both
  debounced searches so a mid-flight cancel can't strand the spinner.

Co-Authored-By: Claude Fable 5 <[email protected]>
@Quick104

Quick104 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Addressed all review feedback in c53f7e5:

  • tvOS CTA focus (Codex P2): .disabled() is now iOS-only — on tvOS the button stays in the focus graph through the request → submitting → pending morph and simply ignores presses in non-interactive states.
  • Server switch/remove (CodeRabbit): RequestsFeatureStore.shared.refresh() now fires after the reset in both ServerRegistry.switchTo and .remove, so entry points reappear immediately when switching between signed-in servers.
  • tvOS card VoiceOver: explicit accessibility label (title, year, status) on the poster button.
  • Reload races: bus-triggered reloads in RequestDetailViewModel and MyRequestsViewModel are now tracked and cancel-replaced.
  • Stuck spinner: cancellation early-returns clear isLoading/isSearching — also fixed the identical pattern in RequestsHubViewModel.performSearch, which the review didn't flag.

iOS + tvOS builds green; all 26 unit tests pass.

🤖 Generated with Claude Code

@Quick104
Quick104 merged commit c74b004 into main Jul 2, 2026
1 check passed
@Quick104
Quick104 deleted the feature/requests branch July 2, 2026 16: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