feat(discover): add detail previous and next navigation#3122
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis 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. ChangesDiscover Navigation Between Detail Items
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ 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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (7)
src/components/Common/ListView/index.tsxsrc/components/Discover/DiscoverNavigationButtons/index.tsxsrc/components/MovieDetails/index.tsxsrc/components/TitleCard/TmdbTitleCard.tsxsrc/components/TitleCard/index.tsxsrc/components/TvDetails/index.tsxsrc/utils/discoverNavigation.ts
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?
git diff --checkScreenshots / Logs (if applicable)
Checklist:
pnpm buildpnpm i18n:extractSummary by CodeRabbit
New Features
Bug Fixes