Skip to content

perf(render): migrate ModerationQueuePage to the selector store - #431

Merged
NesiciCoding merged 2 commits into
perf/selector-store-marketplacefrom
perf/selector-store-moderationqueue
Aug 18, 2026
Merged

perf(render): migrate ModerationQueuePage to the selector store#431
NesiciCoding merged 2 commits into
perf/selector-store-marketplacefrom
perf/selector-store-moderationqueue

Conversation

@NesiciCoding

Copy link
Copy Markdown
Owner

What

Migrates ModerationQueuePage from six whole-domain hooks to one useStoreSelector for its five data slices (students, studentRubrics, rubrics, peerReviews, settings) plus useStoreActions for saveStudentRubric / deletePeerReview. usePlatform stays only for fetchSchoolMembers (not a store action).

Why

Whole-domain subscriptions re-rendered the page on every unrelated collection update; it now re-renders only when its actual slices change.

Notes

  • Domain-hook subscriptions drop from 6 → 1 (usePlatform).
  • Fixed a latent false pass in pages.admin.a11y.test.tsx: the router error boundary swallowed the page's render crash, so the suite never actually rendered the page. The suite's base mock moved to module scope and selectors/actions now route through it.

Stacked on #430 (part of the roadmap "Up Next" selector-store series).

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@NesiciCoding, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Limit details: You’ve used all 1 included review currently available under your plan.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 378d569d-bf36-45ec-9aa5-79dad8727e44

📥 Commits

Reviewing files that changed from the base of the PR and between 07c816e and 18dc76e.

📒 Files selected for processing (1)
  • src/pages/ModerationQueuePage.tsx

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 63f3a4e3-b865-4765-a80b-5e48368a72e3

📥 Commits

Reviewing files that changed from the base of the PR and between de66492 and 07c816e.

📒 Files selected for processing (3)
  • src/pages/ModerationQueuePage.tsx
  • src/pages/__tests__/ModerationQueuePage.test.tsx
  • src/pages/__tests__/pages.admin.a11y.test.tsx

Included review availability: Your plan includes up to 1 review per rolling hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

ModerationQueuePage now uses platform and store hooks for data and mutations. Related tests provide shared store-backed mocks for moderation, administration, and other page domains.

Changes

Moderation store migration

Layer / File(s) Summary
ModerationQueuePage store integration
src/pages/ModerationQueuePage.tsx
The page uses usePlatform, useStoreSelector, and useStoreActions instead of individual AppContext domain hooks.
Store-backed test mocks
src/pages/__tests__/ModerationQueuePage.test.tsx, src/pages/__tests__/pages.admin.a11y.test.tsx
Tests use shared context data with selector and action mocks. The accessibility mock includes expanded domain collections and action stubs.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 07c81

The page now subscribes only to the data slices it uses, reducing unrelated re-renders without a supplied correctness or production-impact concern; no actionable merge-blocking risk remains beyond normal checks and review.

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: migrating ModerationQueuePage to the selector store.
Description check ✅ Passed The description explains the store migration, rendering goal, test fix, and related implementation details.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

@NesiciCoding

Copy link
Copy Markdown
Owner Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

NesiciCoding and others added 2 commits August 18, 2026 08:59
Data slices (students, studentRubrics, rubrics, peerReviews, settings)
now come from one useStoreSelector and grading actions from the stable
useStoreActions context; only usePlatform remains for fetchSchoolMembers.
The admin a11y suite previously let the page's render crash be swallowed
by the router error boundary, so it now routes selectors/actions through
its shared mocked app value and genuinely renders the page.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
…ionQueuePage

The roster domain hooks filtered soft-deleted rows; the selector-store
migration read raw slices. Restore the active-student / active-rubric
filtering so archived students and deleted student rubrics don't surface
in the moderation queue.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
@NesiciCoding
NesiciCoding force-pushed the perf/selector-store-moderationqueue branch from 07c816e to 18dc76e Compare August 18, 2026 07:00
@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 80.52% (🎯 65%) 11096 / 13779
🟢 Statements 78.5% (🎯 65%) 12718 / 16201
🟢 Functions 71.17% (🎯 60%) 3987 / 5602
🟢 Branches 69.5% (🎯 58%) 9375 / 13489
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/pages/ModerationQueuePage.tsx 90.47% 51.28% 90.62% 97.87% 50, 54, 58, 70-71, 85, 96
Generated in workflow #1258 for commit 18dc76e by the Vitest Coverage Report Action

@NesiciCoding

Copy link
Copy Markdown
Owner Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@NesiciCoding
NesiciCoding merged commit 7b57763 into main Aug 18, 2026
15 checks passed
@NesiciCoding
NesiciCoding deleted the perf/selector-store-moderationqueue branch August 18, 2026 08:23
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