Skip to content

Conversation

@jpople
Copy link
Contributor

@jpople jpople commented Dec 16, 2025

Ticket ENG-1760

Description Of Changes

Adds a sorting menu to the new privacy request manager.

Screenshot 2025-12-16 at 16 08 33

Steps to Confirm

  1. Make some privacy requests
  2. View the new request manager
  3. Should be able to sort asc/desc by time created or due date
  4. Sort status should show in URL, and should be read from URL when linking

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Add a db-migration This indicates that a change includes a database migration label to the entry if your change includes a DB migration
    • Add a high-risk This issue suggests changes that have a high-probability of breaking existing code label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
    • Updates unreleased work already in Changelog, no new entry necessary
  • UX feedback:
    • All UX related changes have been reviewed by a designer
    • No UX review needed
  • Followup issues:
    • Followup issues created
    • No followup issues
  • Database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!
    • No migrations
  • Documentation:
    • Documentation complete, PR opened in fidesdocs
    • Documentation issue created in fidesdocs
    • If there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
    • No documentation updates required

@jpople jpople requested a review from a team as a code owner December 16, 2025 22:39
@jpople jpople requested review from speaker-ender and removed request for a team December 16, 2025 22:39
@vercel
Copy link

vercel bot commented Dec 16, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
fides-plus-nightly Ready Ready Preview, Comment Dec 17, 2025 7:56pm
1 Skipped Deployment
Project Deployment Review Updated (UTC)
fides-privacy-center Ignored Ignored Dec 17, 2025 7:56pm

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 16, 2025

Greptile Overview

Greptile Summary

Adds sorting functionality to the privacy request dashboard, allowing users to sort by time received or days left in ascending/descending order. The sort state is managed via URL query parameters and properly integrated with the existing filter system.

Critical Issue Found:

  • The sort direction mappings are inverted - "newest" is mapped to ASC instead of DESC, and "oldest" to DESC instead of ASC, which will cause the sorting to work backwards from what users expect

Implementation Details:

  • Sort state is properly synchronized with URL parameters using nuqs
  • Pagination correctly resets when sort changes (via filterQueryParams dependency)
  • Sort menu uses Ant Design dropdown with proper selection state tracking
  • Backend supports sorting on both created_at and due_date fields

Confidence Score: 1/5

  • This PR has a critical logic bug that will cause all sorting to work backwards
  • The sort direction mappings are completely inverted, meaning users clicking "newest" will get oldest first and vice versa. This is a functional bug that will confuse users and must be fixed before merge.
  • PrivacyRequestSortMenu.tsx requires immediate attention to fix the inverted sort directions

Important Files Changed

File Analysis

Filename Score Overview
clients/admin-ui/src/features/privacy-requests/dashboard/PrivacyRequestSortMenu.tsx 1/5 New sort menu component with critical bug: sort directions are reversed for all options
clients/admin-ui/src/features/privacy-requests/dashboard/PrivacyRequestFiltersBar.tsx 5/5 Adds sort menu integration to filters bar, properly passes props
clients/admin-ui/src/features/privacy-requests/dashboard/PrivacyRequestsDashboard.tsx 5/5 Integrates sort state from hook and passes to filters bar component

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

3 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Copy link
Contributor

@speaker-ender speaker-ender left a comment

Choose a reason for hiding this comment

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

Some minor code and UX requests but looks good overall!

});

return (
<AntDropdown
Copy link
Contributor

Choose a reason for hiding this comment

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

Why use a Dropdown component instead of a Select?
It would be nice to see the selected sort option without having to open the dropdown.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, I think I just tunnel-visioned on the wording on the ticket which suggested a dropdown. I've updated to a Select.

setSortState: (sortState: SortParams) => void;
}

enum SortOption {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not required in this PR, but I think in the future we should have a standard for sorting.
An enum for asc and desc could be reused, and then it could be paired with a list/table item attribute.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, agreed-- this felt a bit janky as I was putting it together. We do have a reusable enum for asc and desc already but this exact pattern with a select with two options for each attribute is new for Lists, since tables are generally sorted from the table header. Would be good to get a more robust option.

@jpople jpople added this pull request to the merge queue Dec 17, 2025
Merged via the queue into main with commit d093875 Dec 17, 2025
47 checks passed
@jpople jpople deleted the jpople/eng-1760/sort-privacy-requests branch December 17, 2025 20:49
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