Skip to content

fix(discover): use added sort in recent requests slider#3202

Open
fallenbagel wants to merge 1 commit into
developfrom
fix/recent-requests-slider-sort
Open

fix(discover): use added sort in recent requests slider#3202
fallenbagel wants to merge 1 commit into
developfrom
fix/recent-requests-slider-sort

Conversation

@fallenbagel

@fallenbagel fallenbagel commented Jun 26, 2026

Copy link
Copy Markdown
Member

Description

The recent requests slider on the discover page was using sort=modified, which sorts by updatedAt. Since updatedAt is an @UpdateDateColumn that gets bumped whenever a request entity is saved, scanner-driven status transitions (availability sync, bulk deletions setting media to DELETED) would silently reorder the slider by floating affected requests to the top.

This PR changes the sort to added, which uses createdAt and reflects actual submission order, consistent with what "Recent Requests" implies.

How Has This Been Tested?

(dont need to)

Screenshots / Logs (if applicable)

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

  • Bug Fixes
    • Updated the ordering of recent requests so items now appear based on when they were added, rather than when they were last modified.

@fallenbagel fallenbagel requested a review from a team as a code owner June 26, 2026 18:56
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

RecentRequestsSlider now fetches requests sorted by added instead of modified. No other rendering, state, or empty-state behavior changed.

Changes

Recent request sorting

Layer / File(s) Summary
Update request sort parameter
src/components/Discover/RecentRequestsSlider/index.tsx
The slider’s SWR request URL changes its sort query parameter from modified to added before mapping requests into items.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A bunny hopped by with a twitch of the nose,
“Added” now leads where the request stream goes.
One tiny swap, quick as a springtime dart,
Fresh carrots first — that’s the coder’s art. 🐰

🚥 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 summarizes the main change: the Recent Requests slider now uses the added sort in Discover.
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.

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.

@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/components/Discover/RecentRequestsSlider/index.tsx`:
- Line 25: The RecentRequestsSlider query is using sort=added, but the request
listing API only recognizes sort=modified and otherwise falls back to
request.id. Update the backend request sorting logic in server/routes/request.ts
(the request-listing handler) to explicitly map added to request.createdAt, and
add or extend a test covering this sort option before keeping the client change
in Discover/RecentRequestsSlider.
🪄 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: 47f99af5-2639-475f-8e0e-0ee0649a673a

📥 Commits

Reviewing files that changed from the base of the PR and between ebac489 and 46ff3e0.

📒 Files selected for processing (1)
  • src/components/Discover/RecentRequestsSlider/index.tsx

Comment thread src/components/Discover/RecentRequestsSlider/index.tsx
@fallenbagel fallenbagel marked this pull request as draft June 26, 2026 19:04
@fallenbagel fallenbagel marked this pull request as ready for review June 26, 2026 19:05
@seerr-automation-bot seerr-automation-bot added this to the v3.4.0 milestone Jun 29, 2026
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.

3 participants