Skip to content

perf(render): migrate ActivityDashboardPage to the selector store - #427

Merged
NesiciCoding merged 2 commits into
perf/selector-store-sidebarfrom
perf/selector-store-activitydashboard
Aug 18, 2026
Merged

perf(render): migrate ActivityDashboardPage to the selector store#427
NesiciCoding merged 2 commits into
perf/selector-store-sidebarfrom
perf/selector-store-activitydashboard

Conversation

@NesiciCoding

@NesiciCoding NesiciCoding commented Aug 13, 2026

Copy link
Copy Markdown
Owner

What

Migrates ActivityDashboardPage from six whole-domain hooks to one useStoreSelector for its eight data slices (students, classes, studentRubrics, rubrics, tests, studentTests, gradingTasks, essayAssignments) plus the stable useStoreActions context for updateClass, updateRubric, updateTest, addGradingTasks, deleteGradingTask, addEssayAssignments, updateEssayGroup.

Why

Subscribing to whole domains re-renders the page on every unrelated collection update. Selecting only the slices it renders (and taking actions from the stable context) isolates it to the data it actually uses.

Notes

  • Domain-hook subscriptions drop from 6 → 0.
  • Dedicated suites and pages-phase4.a11y.test.tsx route selectors/actions through their mocked app values.

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

Summary by CodeRabbit

  • Refactor

    • Updated the Activity Dashboard to use centralized state and action handling.
    • Preserved existing dashboard behavior for managing classes, rubrics, tests, grading tasks, assignments, and groups.
  • Tests

    • Updated dashboard and accessibility test coverage to support the centralized state handling.

@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: c95cf9d3-b742-4813-b3a7-50893525aa24

📥 Commits

Reviewing files that changed from the base of the PR and between b754142 and 905ab4e.

📒 Files selected for processing (1)
  • src/pages/ActivityDashboardPage.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: 912286ee-9586-4c37-9b0f-8e8ae7fda239

📥 Commits

Reviewing files that changed from the base of the PR and between fdac1bc and b754142.

📒 Files selected for processing (4)
  • src/pages/ActivityDashboardPage.tsx
  • src/pages/__tests__/ActivityDashboardPage.extended.test.tsx
  • src/pages/__tests__/ActivityDashboardPage.test.tsx
  • src/pages/__tests__/pages-phase4.a11y.test.tsx

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


📝 Walkthrough

Walkthrough

ActivityDashboardPage now uses centralized store selector and action hooks. Its extended, standard, and accessibility tests provide matching useStore mocks backed by shared mock application state.

Changes

Activity dashboard store migration

Layer / File(s) Summary
Dashboard store integration
src/pages/ActivityDashboardPage.tsx
The page replaces separate AppContext subscriptions with one useStoreSelector call for dashboard data and one useStoreActions call for mutations.
Store-backed test mocks
src/pages/__tests__/ActivityDashboardPage*.test.tsx, src/pages/__tests__/pages-phase4.a11y.test.tsx
The tests mock useStoreSelector and useStoreActions with the shared mock application state and action handlers.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to b7541

This localized performance-oriented state-selection change has no actionable merge-blocking risk remaining and is merge-ready after normal checks and review.

Possibly related PRs

Poem

I’m a rabbit in the store,
Selecting data, hopping more.
Actions thump from page to test,
Mocked state keeps checks at rest.
useStore leads the way—
Carrots ship another day!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the migration of ActivityDashboardPage to the selector store, which is the main change.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf/selector-store-activitydashboard

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:46
The page subscribed to six whole-domain hooks to read eight data slices
and trigger seven actions. Data now comes from one useStoreSelector and
actions from the stable useStoreActions context, so the page re-renders
only when its actual slices change.

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

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 dashboard aggregates and pending-task counts.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
@NesiciCoding
NesiciCoding force-pushed the perf/selector-store-activitydashboard branch from b754142 to 905ab4e Compare August 18, 2026 06:49
@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.46% (🎯 65%) 11096 / 13789
🟢 Statements 78.43% (🎯 65%) 12704 / 16197
🟢 Functions 71.06% (🎯 60%) 3971 / 5588
🟢 Branches 69.46% (🎯 58%) 9370 / 13489
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/pages/ActivityDashboardPage.tsx 82.55% 73.43% 85.71% 84.61% 88, 97, 148, 157, 181, 189-194, 207, 223-224, 472-476, 622-624, 678, 685, 713
Generated in workflow #1254 for commit 905ab4e 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-activitydashboard 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