Skip to content

feat(requests): allow users to view requester on media details page#2866

Open
danielkinahan wants to merge 5 commits into
seerr-team:developfrom
danielkinahan:develop
Open

feat(requests): allow users to view requester on media details page#2866
danielkinahan wants to merge 5 commits into
seerr-team:developfrom
danielkinahan:develop

Conversation

@danielkinahan
Copy link
Copy Markdown

@danielkinahan danielkinahan commented Apr 12, 2026

Description

This change adds the ability for a user with View Requests permission to view the requests of other users on the media details page (both TV and movies). I added it as a seperate card under the media-facts card, but I'd like feedback on the placement. I will include screenshots.

Disclaimer on AI

I used AI to search the codebase and review this code for feedback.

How Has This Been Tested?

I copied my db of my instance and ran tests with it, so I could have data. I have only run this in dev mode. I have tried this with a piece of media that has no requests, one and multiple (creates new cards for each).

Screenshots / Logs (if applicable)

One request
image

Multiple requests
image

No requests (card doesnt show)
image

Mobile view of multiple requests
image

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 a media request summary on movie and TV detail pages showing requester, request date, status badges, and 4K indicator.
    • Request visibility respects permissions: users with view/manage rights see all requests; others see only their own.
  • Documentation
    • Added localized labels for request date, requester, and status to support UI text for the new summary.

Review Change Stack

@danielkinahan danielkinahan requested a review from a team as a code owner April 12, 2026 19:01
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 12, 2026

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: de9f5bfd-d3a9-4ddc-95cf-24f01439789c

📥 Commits

Reviewing files that changed from the base of the PR and between 74b1f64 and 7c8ed9c.

📒 Files selected for processing (2)
  • src/components/MovieDetails/index.tsx
  • src/components/TvDetails/index.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/components/TvDetails/index.tsx
  • src/components/MovieDetails/index.tsx

📝 Walkthrough

Walkthrough

Adds MediaRequestSummary to MovieDetails and TvDetails; each detail page now renders the component with either the full requests list (for MANAGE_REQUESTS or REQUEST_VIEW) or a filtered list of requests by the current user, and passes currentUserId.

Changes

Media Request Integration

Layer / File(s) Summary
MovieDetails integration
src/components/MovieDetails/index.tsx
Imported MediaRequestSummary and rendered it in media-overview-right; passes requests as full data.mediaInfo?.requests when user has Permission.MANAGE_REQUESTS or Permission.REQUEST_VIEW, otherwise passes filtered requests where requestedBy.id === user?.id; also passes currentUserId={user?.id}.
TvDetails integration
src/components/TvDetails/index.tsx
Imported MediaRequestSummary and rendered it in media-overview-right; same permission-gated request prop logic as MovieDetails and currentUserId={user?.id}.

Sequence Diagram(s)

sequenceDiagram
    rect rgba(52,152,219,0.5)
    participant Browser
    end
    rect rgba(46,204,113,0.5)
    participant MovieDetails/TvDetails
    end
    rect rgba(155,89,182,0.5)
    participant MediaRequestSummary
    end
    rect rgba(241,196,15,0.5)
    participant AuthPermissions
    end
    Browser->>MovieDetails/TvDetails: navigate to media page
    MovieDetails/TvDetails->>AuthPermissions: check user permissions (MANAGE_REQUESTS / REQUEST_VIEW)
    AuthPermissions-->>MovieDetails/TvDetails: permission scope
    MovieDetails/TvDetails->>MediaRequestSummary: render with `requests` (full or filtered) and `currentUserId`
    MediaRequestSummary->>MediaRequestSummary: sort requests, map status to badges, format dates
    MediaRequestSummary-->>Browser: render requester links, avatars, badges
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • fallenbagel
  • 0xSysR3ll

Poem

🐇 I hopped through requests both near and far,
I sorted dates and polished each star,
Badges gleam and avatars peek through,
I whispered who asked — now it's clear to view.

🚥 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 accurately describes the main feature: allowing users to view the requester on media details pages.
Linked Issues check ✅ Passed The PR implements the required functionality from issue #2865: users with 'View Requests' permission can now see who requested media items on details pages.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing requester visibility on media details pages; no unrelated modifications detected.

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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/components/MediaRequestSummary/index.tsx (1)

44-70: Consolidate status mapping to prevent future drift.

statusMessage and statusBadgeType are derived from duplicate switch logic on the same enum. Centralizing this in one map/helper will keep status text and badge color in sync as statuses evolve.

♻️ Suggested refactor
+const requestStatusMeta = {
+  [MediaRequestStatus.APPROVED]: {
+    message: globalMessages.approved,
+    badgeType: 'success',
+  },
+  [MediaRequestStatus.DECLINED]: {
+    message: globalMessages.declined,
+    badgeType: 'danger',
+  },
+  [MediaRequestStatus.FAILED]: {
+    message: globalMessages.failed,
+    badgeType: 'danger',
+  },
+  [MediaRequestStatus.COMPLETED]: {
+    message: globalMessages.completed,
+    badgeType: 'success',
+  },
+  [MediaRequestStatus.PENDING]: {
+    message: globalMessages.pending,
+    badgeType: 'warning',
+  },
+} as const;
...
-        const statusMessage = (() => {
-          switch (request.status) {
-            case MediaRequestStatus.APPROVED:
-              return intl.formatMessage(globalMessages.approved);
-            case MediaRequestStatus.DECLINED:
-              return intl.formatMessage(globalMessages.declined);
-            case MediaRequestStatus.FAILED:
-              return intl.formatMessage(globalMessages.failed);
-            case MediaRequestStatus.COMPLETED:
-              return intl.formatMessage(globalMessages.completed);
-            default:
-              return intl.formatMessage(globalMessages.pending);
-          }
-        })();
-
-        const statusBadgeType = (() => {
-          switch (request.status) {
-            case MediaRequestStatus.APPROVED:
-            case MediaRequestStatus.COMPLETED:
-              return 'success';
-            case MediaRequestStatus.DECLINED:
-            case MediaRequestStatus.FAILED:
-              return 'danger';
-            default:
-              return 'warning';
-          }
-        })();
+        const statusMeta =
+          requestStatusMeta[request.status] ?? requestStatusMeta[MediaRequestStatus.PENDING];
+        const statusMessage = intl.formatMessage(statusMeta.message);
+        const statusBadgeType = statusMeta.badgeType;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/MediaRequestSummary/index.tsx` around lines 44 - 70, The
duplicate switch logic for computing statusMessage and statusBadgeType from
MediaRequestStatus should be centralized: create a single helper (e.g.,
getMediaRequestStatusInfo or STATUS_MAP) that accepts a MediaRequestStatus and
returns both the localized message (using intl + globalMessages) and the badge
type string; replace the current statusMessage and statusBadgeType computed
blocks with calls to that helper (use its .message and .badgeType), ensuring you
reference MediaRequestStatus, intl, and globalMessages inside the helper so both
values stay in sync as statuses change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/components/MediaRequestSummary/index.tsx`:
- Around line 44-70: The duplicate switch logic for computing statusMessage and
statusBadgeType from MediaRequestStatus should be centralized: create a single
helper (e.g., getMediaRequestStatusInfo or STATUS_MAP) that accepts a
MediaRequestStatus and returns both the localized message (using intl +
globalMessages) and the badge type string; replace the current statusMessage and
statusBadgeType computed blocks with calls to that helper (use its .message and
.badgeType), ensuring you reference MediaRequestStatus, intl, and globalMessages
inside the helper so both values stay in sync as statuses change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5f10119d-f175-4952-a1a5-27805527278f

📥 Commits

Reviewing files that changed from the base of the PR and between 43eff25 and d1076e6.

📒 Files selected for processing (3)
  • src/components/MediaRequestSummary/index.tsx
  • src/components/MovieDetails/index.tsx
  • src/components/TvDetails/index.tsx

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.

Add the ability to view requester on media page if user has "View Requests" permission

1 participant