Repository navigation
Conversation
|
Warning Review limit reached
Next review available in: 59 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds end-to-end "Not Interested" (hidden recommendations) support. A new ChangesHidden Recommendations Feature
Sequence Diagram(s)sequenceDiagram
participant User
participant MediaItemMenu
participant useToggleHidden
participant API as REST /hidden/{item_id}
participant PersonalDataHandler
participant HiddenStore as HiddenRecommendationStore
participant EventBus
participant RealtimeEventsProvider
User->>MediaItemMenu: clicks "Not Interested"
MediaItemMenu->>useToggleHidden: mutateAsync(is_hidden=false)
useToggleHidden->>useToggleHidden: optimistic cache: is_hidden=true
useToggleHidden->>API: PUT /hidden/{item_id}
API->>PersonalDataHandler: HandleAddHidden
PersonalDataHandler->>HiddenStore: AddHiddenRecommendation(profileID, itemID)
PersonalDataHandler->>EventBus: publishUserStateEvent(is_hidden=true)
API-->>useToggleHidden: 204
useToggleHidden->>useToggleHidden: invalidate hiddenKeys + mediaSurface
EventBus->>RealtimeEventsProvider: user_state.changed SSE event
RealtimeEventsProvider->>RealtimeEventsProvider: upsert user_state.is_hidden in catalog cache
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes 🚥 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 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (3)
internal/userdb/schema.go (1)
101-106: ⚡ Quick winAdd a SQLite index for hidden-list pagination.
Line 101 defines the table, but the list path orders by
hidden_at DESCper profile. Without an index on
(profile_id, hidden_at DESC), this will degrade into scan+sort as hidden rows grow.Proposed change
CREATE TABLE IF NOT EXISTS hidden_recommendations ( profile_id TEXT NOT NULL, media_item_id TEXT NOT NULL, hidden_at TEXT NOT NULL, PRIMARY KEY (profile_id, media_item_id) ); + +CREATE INDEX IF NOT EXISTS idx_hidden_recommendations_profile_hidden_at + ON hidden_recommendations(profile_id, hidden_at DESC);🤖 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 `@internal/userdb/schema.go` around lines 101 - 106, The hidden_recommendations table creation lacks a database index that is needed for efficient pagination queries. The list path queries this table ordering by hidden_at DESC per profile_id, and without an index on the (profile_id, hidden_at DESC) composite columns, queries will degrade to full table scan and sort operations as the table grows. Add a CREATE INDEX statement after the hidden_recommendations table definition to create the composite index on (profile_id, hidden_at DESC) to optimize these queries.web/src/components/MediaItemMenu.test.tsx (1)
204-210: ⚡ Quick winAdd coverage for the hidden=true label branch.
Current updates validate only the
"Not Interested"label path (is_hidden: false). Please add one case asserting"Show in Recommendations"whenis_hidden: trueto lock the toggle label behavior.Proposed test addition
+ it("shows 'Show in Recommendations' when already hidden", () => { + const labels = buildMediaItemMenuModel({ + mediaType: "movie", + userState: { + played: false, + is_favorite: false, + in_watchlist: false, + is_hidden: true, + }, + isAdmin: false, + }) + .filter((item) => item.kind === "action") + .map((item) => item.label); + + expect(labels).toContain("Show in Recommendations"); + expect(labels).not.toContain("Not Interested"); + });🤖 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 `@web/src/components/MediaItemMenu.test.tsx` around lines 204 - 210, The test in MediaItemMenu.test.tsx currently only validates the label when is_hidden is false (which shows "Not Interested"). Add a new test case that sets is_hidden to true and asserts that the labels array includes "Show in Recommendations" instead. This ensures the toggle label behavior is properly covered for both the hidden and unhidden states.internal/catalog/discovery_repo_test.go (1)
447-452: ⚡ Quick winStrengthen hidden-exclusion test assertions with viewer scoping predicates.
The test verifies subquery presence/correlation, but it should also assert
uhr.user_idanduhr.profile_idpredicates to prevent broad cross-user exclusion regressions.Proposed test hardening
t.Run(tc.name, func(t *testing.T) { if !strings.Contains(tc.query, "user_hidden_recommendations uhr") { t.Fatalf("expected hidden recommendation exclusion subquery, got:\n%s", tc.query) } if !strings.Contains(tc.query, "uhr.media_item_id = mi.content_id") { t.Fatalf("expected hidden exclusion correlated on mi.content_id, got:\n%s", tc.query) } + if !strings.Contains(tc.query, "uhr.user_id = $") { + t.Fatalf("expected hidden exclusion scoped by user_id placeholder, got:\n%s", tc.query) + } + if !strings.Contains(tc.query, "uhr.profile_id = $") { + t.Fatalf("expected hidden exclusion scoped by profile_id placeholder, got:\n%s", tc.query) + } }) } }🤖 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 `@internal/catalog/discovery_repo_test.go` around lines 447 - 452, The test assertions in the hidden-exclusion verification block are incomplete and only check for the subquery presence and correlation join. Add additional test assertions using strings.Contains to verify that the query includes both the uhr.user_id and uhr.profile_id predicates, ensuring that hidden recommendations are properly scoped to the current viewer and preventing broad cross-user exclusion regressions.
🤖 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 `@internal/recommendations/similar.go`:
- Around line 55-61: The exclusion lookup failures are being silently ignored
across three sites, allowing unwanted items to reappear in recommendations
during error conditions. In `internal/recommendations/similar.go#L55-L61`,
change the `GetWatchedItemIDSet` error handling to return the error early or
fail closed instead of continuing with an incomplete excludeIDs list when err !=
nil. In `internal/audiobooks/recommender.go#L45-L51`, apply the same fail-closed
pattern to the embedding-based audiobook similar path when its exclusion lookup
fails. In `internal/recommendations/repo.go#L1784-L1791`, propagate the
`HiddenRecommendationIDSet` error instead of silently skipping hidden IDs when
the error occurs—ensure the error is returned to the caller rather than masked
by a continue or similar construct.
In `@web/src/App.tsx`:
- Line 487: The QueryCacheManager is not clearing the hidden query cache when
users switch profiles, which causes stale hidden items from the previous profile
to display until a refetch occurs. Locate the profile switch handler (likely in
a profile context or state management function) where QueryCacheManager clears
cache entries, and add the "hidden" cache key to the list of cache keys that get
invalidated during a profile switch, ensuring profile-scoped state does not leak
between profiles.
---
Nitpick comments:
In `@internal/catalog/discovery_repo_test.go`:
- Around line 447-452: The test assertions in the hidden-exclusion verification
block are incomplete and only check for the subquery presence and correlation
join. Add additional test assertions using strings.Contains to verify that the
query includes both the uhr.user_id and uhr.profile_id predicates, ensuring that
hidden recommendations are properly scoped to the current viewer and preventing
broad cross-user exclusion regressions.
In `@internal/userdb/schema.go`:
- Around line 101-106: The hidden_recommendations table creation lacks a
database index that is needed for efficient pagination queries. The list path
queries this table ordering by hidden_at DESC per profile_id, and without an
index on the (profile_id, hidden_at DESC) composite columns, queries will
degrade to full table scan and sort operations as the table grows. Add a CREATE
INDEX statement after the hidden_recommendations table definition to create the
composite index on (profile_id, hidden_at DESC) to optimize these queries.
In `@web/src/components/MediaItemMenu.test.tsx`:
- Around line 204-210: The test in MediaItemMenu.test.tsx currently only
validates the label when is_hidden is false (which shows "Not Interested"). Add
a new test case that sets is_hidden to true and asserts that the labels array
includes "Show in Recommendations" instead. This ensures the toggle label
behavior is properly covered for both the hidden and unhidden states.
🪄 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: bfb6a46c-2362-4f4e-96f4-76eba2783be3
📒 Files selected for processing (39)
internal/api/handlers/hidden_recommendations.gointernal/api/handlers/recommendations.gointernal/api/handlers/user_state.gointernal/api/handlers/user_state_events.gointernal/api/router.gointernal/audiobooks/abs/handler.gointernal/audiobooks/abs/items_handler.gointernal/audiobooks/recommender.gointernal/catalog/discovery_repo.gointernal/catalog/discovery_repo_test.gointernal/jellycompat/handlers_items.gointernal/recommendations/repo.gointernal/recommendations/signals.gointernal/recommendations/similar.gointernal/recommendations/types.gointernal/sections/fetcher.gointernal/userdb/hidden_recommendations.gointernal/userdb/schema.gointernal/userdb/sqlitestore.gointernal/userstore/pgstore/hidden_recommendations.gointernal/userstore/pgstore/pgstore.gointernal/userstore/store.gointernal/userstore/types.gomigrations/sql/20260615120000_user_hidden_recommendations.sqlweb/src/App.tsxweb/src/api/types.tsweb/src/components/AppSidebar.tsxweb/src/components/HeroBanner.test.tsxweb/src/components/MediaItemMenu.test.tsxweb/src/components/MediaItemMenu.tsxweb/src/components/RealtimeEventsProvider.tsxweb/src/hooks/queries/favorites.tsweb/src/hooks/queries/hidden.tsweb/src/hooks/queries/keys.tsweb/src/hooks/queries/mediaSurfaceRefresh.tsweb/src/hooks/queries/watchlist.tsweb/src/pages/Hidden.tsxweb/src/pages/ItemDetail/components/EpisodeCarousel.tsxweb/src/pages/ItemDetail/components/SeasonEpisodeGrid.tsx
|
Thanks for the review — addressed in
Re-verified: |
Adds a per-profile "Not Interested" action so users can hide a movie/show from recommendations and discovery rows. Hidden items are excluded from: For You, More Like This/Similar (incl. audiobooks ABS + jellycompat), Because You Watched, Popular, Recently Added, and the discovery recipe rows (hidden_gems, critically_acclaimed, forgotten_favorites). They remain fully visible in library browsing and search, and can be managed/un-hidden from a new "Not Interested" page. Backend: new user_hidden_recommendations table (Postgres migration + SQLite schema), optional HiddenRecommendationStore interface on both stores, merged into the watched-exclusion sets, NOT EXISTS exclusion in discovery queries, profile-scoped /api/v1/hidden CRUD, is_hidden in per-item user_state, and a user_state.changed realtime event for cross-device sync. Frontend: useToggleHidden/useHiddenList hooks, a MediaItemMenu action, a Hidden management page + sidebar entry, and is_hidden wired through the realtime provider.
- Fail closed when the watched/hidden exclusion lookup errors (similar.go, audiobooks recommender, repo store-backed set) instead of silently returning items the profile hid or watched. - Clear the ["hidden"] query cache on profile switch to prevent cross-profile state bleed. - Add SQLite index on hidden_recommendations(profile_id, hidden_at DESC) for the paginated list path (parity with the Postgres migration). - Strengthen discovery exclusion test to assert user_id/profile_id scoping; add MediaItemMenu test for the already-hidden label branch. - Add doc comments to the new exported store functions.
Add doc comments to the remaining new exported/public symbols so the PR meets the docstring-coverage threshold: SQLite HiddenRecommendationStore wrappers, the useHiddenList/useToggleHidden hooks, and the Hidden page.
7cfb65e to
602074f
Compare
|
Thanks for putting this together and for exploring the feature end to end. We still think a per-profile Not interested signal is worth pursuing, but after review we do not want to continue with this implementation. The branch now conflicts with I’ve captured the intended behavior, open design questions, and acceptance criteria in #690 so the idea and the useful work here are not lost. Closing this PR in favor of that issue. |
Adds settingsManifest.playback.next_up_enabled.label and .description in every web language, from Silo-Server/silo-translations#166 applied to the pinned release 2026.11.22-d12da65. Synced with --local; re-pin to the release Silo-Server#166 publishes before this merges. Co-Authored-By: Claude Opus 5.5 <[email protected]>
What & why
Adds a per-profile "Not Interested" action so a viewer can hide a movie/show from recommendations — addressing the "you get stuck on the same recommendations unless you mark things watched" problem. Like YouTube's "Not interested" / Spotify's "don't recommend".
Hidden items are excluded from recommendation & discovery surfaces but remain fully visible in library browsing and search, and can be managed/un-hidden from a new Not Interested page.
Approach
Mirrors the existing favorites/watchlist wiring rather than introducing new patterns.
Backend
user_hidden_recommendationstable (Goose timestamped migration + matching SQLiteuserdbschema).HiddenRecommendationStoreinterface (same opt-in pattern asDeviceRegistry), implemented on both Postgres and SQLite stores — avoids touching the largeUserStoreinterface / all its mocks.SignalReader.WatchedItemIDSet(For You / engine rows + worker cache),repo.GetWatchedItemIDSet/…FromStore(Because You Watched, Popular, Recently Added, Discover),SimilarItems("More Like This", incl. jellycompat + audiobooks ABS), and aNOT EXISTSclause in the three discovery recipe queries (hidden_gems, critically_acclaimed, forgotten_favorites).is_hiddenadded to per-itemuser_state; profile-scopedGET/PUT/DELETE /api/v1/hidden(+ list); auser_state.changedrealtime event for cross-device sync. Additive-only within/api/v1.Frontend
useToggleHidden/useHiddenListhooks, a "Not Interested" / "Show in Recommendations" entry inMediaItemMenu, a Hidden management page + sidebar entry, andis_hiddenthreaded through the realtime provider.Scope note
Library browse + search are intentionally not filtered (
query_builder.gountouched) — hidden items stay searchable. Worker-cached "For You" rows refresh on the next worker pass, so there's a brief staleness window by design.I'm aware
docs/architecture/v1-scope.mdis not locked and this is a new user-facing capability — happy to convert this into a v1 capability proposal / pause for triage if you'd prefer that route. Opening the PR so the implementation is visible alongside the proposal.Testing
go build ./...,go vet,go test ./...in a libvips-capable container — green (one pre-existing flakyTempDircleanup test in jellyfin-compat, unrelated). New table-driven tests for the discovery exclusion.golangci-lint run --new-from-rev=main— 0 issues.tsc,eslint(0 errors),prettier --check,vitest(17/17).make verify-local-paths— clean.AI-use disclosure
Implemented with AI assistance (Claude). Every line was reviewed and verified by me; the change went through several self-review passes before submission.
Summary by CodeRabbit
Release Notes
New Features
Improvements