Skip to content

feat: sync grading table filters and selectors to URL with nuqs - #4330

Draft
RichDom2185 wants to merge 7 commits into
masterfrom
richard/nuqs-grading
Draft

feat: sync grading table filters and selectors to URL with nuqs#4330
RichDom2185 wants to merge 7 commits into
masterfrom
richard/nuqs-grading

Conversation

@RichDom2185

Copy link
Copy Markdown
Member

Description

Wires nuqs into the grading overview page so the table filters and dropdown selectors live in the URL — making a filtered/searched view shareable and reload-safe (previously all local useState, with a Redux mirror for the column filters).

  • Add the nuqs dependency and mount NuqsAdapter (nuqs/adapters/react-router/v8) in RootLayout, inside the react-router data-router tree where useSearchParams is available.
  • Dropdown selectors in Grading.tsxuseQueryState: ?showAll, ?myGroups (dynamic default !isAdmin && group !== null), ?pageSize.
  • Grading table column filters → ?filters (JSON) and the assessment-name search → ?search in GradingSubmissionsTable.tsx.
  • Make the URL the single source of truth for columnFilters and remove the now-redundant submissionsTableFilters Redux state (action / reducer / type / initial state / unit test) in its own commit.

Note: the filters parser (and its [] default) is defined at module scope so the default keeps a stable reference across renders — otherwise a fresh [] each render would spuriously change columnFilters and trigger a refetch loop.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Code quality improvements

How to test

  • yarn tsc -b — passes.
  • yarn test — full suite green (759 tests / 91 files).
  • Manual: open /courses/:courseId/grading, then
    • change the show / groups / page-size dropdowns → URL gains showAll / myGroups / pageSize;
    • type in the search box → after debounce, URL gains search;
    • enter Filter Mode and add/remove filter chips → URL filters round-trips (the progressStatus auto-strip still fires when not showing all submissions);
    • reload or open the URL in a fresh tab → all selectors, search, and filter chips restore. Defaults stay out of the URL.

Checklist

  • I have tested this code

🤖 Generated with Claude Code

@RichDom2185 RichDom2185 self-assigned this Sep 1, 2026
@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

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.

1 participant