Skip to content

feat(discover): add detail previous and next navigation#3122

Open
u61d wants to merge 2 commits into
seerr-team:developfrom
u61d:feat/discover-detail-navigation
Open

feat(discover): add detail previous and next navigation#3122
u61d wants to merge 2 commits into
seerr-team:developfrom
u61d:feat/discover-detail-navigation

Conversation

@u61d

@u61d u61d commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Description

Adds previous and next navigation on movie and series detail pages when opened from a Discover list.

The controls use the currently loaded Discover result order, so users can browse detail pages without going back to the grid each time.

I used Codex for help and validation.

How Has This Been Tested?

  • Ran eslint, prettier check, client typecheck, build, and git diff --check
  • Manually checked direct movie detail URLs do not show previous/next controls
  • Manually checked Discover Movies previous/next navigation follows the visible grid order
  • Manually checked filtered Discover Movies previous/next navigation follows the filtered order
  • Manually checked Discover Series previous/next navigation works
  • Manually checked first and last loaded items only show the available navigation direction

Screenshots / Logs (if applicable)

discover-navigation

Checklist:

  • I have read and followed the contribution guidelines.
  • Disclosed any use of AI (see our policy)
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • Successful build pnpm build
  • Translation keys pnpm i18n:extract
  • Database migration (if required)

Summary by CodeRabbit

  • New Features

    • Added "Previous" and "Next" navigation buttons on movie and TV detail pages to move through discovery results.
    • Persistent discovery navigation context so browsing order is preserved across the session for seamless back/forward navigation.
  • Bug Fixes

    • List views now consistently hide blocklisted items when blocklist visibility is not granted.

@u61d u61d requested a review from a team as a code owner June 5, 2026 12:15
@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

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

Run ID: 68e76c30-ee63-4939-ac74-c306f8aa3408

📥 Commits

Reviewing files that changed from the base of the PR and between f2542b2 and 186e894.

📒 Files selected for processing (1)
  • src/utils/discoverNavigation.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/utils/discoverNavigation.ts

📝 Walkthrough

Walkthrough

This PR implements previous/next navigation for detail pages by storing the discovery list and current selection in sessionStorage when opening a title; detail pages show buttons that load adjacent items from that stored context.

Changes

Discover Navigation Between Detail Items

Layer / File(s) Summary
Discover Navigation Utilities
src/utils/discoverNavigation.ts
New module exports DiscoverNavigationItem, DiscoverNavigationState, and functions: getDiscoverNavigationPath, storeDiscoverNavigationContext, markDiscoverNavigationPending, and getDiscoverNavigationState with sessionStorage guards and a 5-minute pending TTL.
TitleCard onOpen Callback Props
src/components/TitleCard/index.tsx, src/components/TitleCard/TmdbTitleCard.tsx
TitleCard and TmdbTitleCard gain optional onOpen?: () => void prop; TitleCard invokes it on the media link onClick, and TmdbTitleCard forwards the prop for movie/tv branches.
Discover Navigation Buttons Component
src/components/Discover/DiscoverNavigationButtons/index.tsx
New DiscoverNavigationButtons component derives previous/next from getDiscoverNavigationState(currentItem) and renders localized tooltip-wrapped buttons that call markDiscoverNavigationPending and router.push(getDiscoverNavigationPath(...)).
ListView Navigation Wiring
src/components/Common/ListView/index.tsx
ListView computes visibleItems (respecting blocklist visibility) and derived navigationItems/plexNavigationItems, and supplies onOpen handlers that call storeDiscoverNavigationContext before navigation for TitleCard/TmdbTitleCard items.
Detail Pages: Navigation Button Placement
src/components/MovieDetails/index.tsx, src/components/TvDetails/index.tsx
MovieDetails and TvDetails import and render DiscoverNavigationButtons in the media-actions/header area, passing currentItem with the media id and mediaType ('movie' or 'tv').

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hop through lists with tidy grace,
Storing paths so you can pace,
Previous, next — a gentle glide,
No bouncing back, just seamless tide.
Session-stored trails lead the way, hooray! 🎉

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(discover): add detail previous and next navigation' accurately describes the main change, which adds navigation controls to detail pages when accessed from the Discover list.
Linked Issues check ✅ Passed The implementation fully addresses issue #3015 by adding previous/next navigation buttons on detail pages when accessed from Discover, respecting the original sort order and active filters.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing discover navigation: new utility module, button component, prop additions to existing cards, and integration into detail pages. No unrelated modifications detected.

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


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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@src/utils/discoverNavigation.ts`:
- Around line 54-55: Guard all direct sessionStorage operations in
discoverNavigation by checking for window and window.sessionStorage and wrapping
setItem/removeItem calls in try/catch; specifically update
storeDiscoverNavigationContext, markDiscoverNavigationPending, and the catch
block in getDiscoverNavigationState to perform a safe check (typeof window !==
'undefined' && window.sessionStorage) and then try { sessionStorage.setItem(...)
/ removeItem(...) } catch (e) { /* swallow or log and continue */ } so throwing
on restricted browsers won’t crash navigation; keep the existing CONTEXT_KEY
usage and ensure failure falls back to no-op behavior.
🪄 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

Run ID: e2f5b508-cd22-4ddb-86d0-a8e2f3c9f4cc

📥 Commits

Reviewing files that changed from the base of the PR and between 0a305f6 and f2542b2.

📒 Files selected for processing (7)
  • src/components/Common/ListView/index.tsx
  • src/components/Discover/DiscoverNavigationButtons/index.tsx
  • src/components/MovieDetails/index.tsx
  • src/components/TitleCard/TmdbTitleCard.tsx
  • src/components/TitleCard/index.tsx
  • src/components/TvDetails/index.tsx
  • src/utils/discoverNavigation.ts

Comment thread src/utils/discoverNavigation.ts Outdated
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.

Discovery Detail Navigate to Next/Previous

1 participant