Skip to content

perf(render): migrate SettingsPage to the selector store - #437

Merged
NesiciCoding merged 2 commits into
perf/selector-store-studentlearningpathfrom
perf/selector-store-settingspage
Aug 18, 2026
Merged

perf(render): migrate SettingsPage to the selector store#437
NesiciCoding merged 2 commits into
perf/selector-store-studentlearningpathfrom
perf/selector-store-settingspage

Conversation

@NesiciCoding

Copy link
Copy Markdown
Owner

What

Migrates SettingsPage from seven whole-domain hooks to one useStoreSelector for its nine data slices (students, classes, studentRubrics, gradeScales, commentBank, exportTemplates, rubrics, standardMasteryTargets, settings) plus useStoreActions for its seven actions. usePlatform stays only for importBackup (not a store action).

Why

Whole-domain subscriptions re-rendered the page on every unrelated collection update; it now re-renders only when one of the slices it renders changes.

Notes

  • Domain-hook subscriptions drop from 7 → 1 (usePlatform).
  • Dedicated suites route selectors/actions through their mocked app values.

Stacked on #436 (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: 95cb1b06-48af-4dbd-9d57-8b430a416465

📥 Commits

Reviewing files that changed from the base of the PR and between 04199a0 and 38599f2.

📒 Files selected for processing (1)
  • src/pages/SettingsPage.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: f6a14ee3-7b2e-4bd7-be46-149730bc226b

📥 Commits

Reviewing files that changed from the base of the PR and between ae981f8 and 04199a0.

📒 Files selected for processing (3)
  • src/pages/SettingsPage.tsx
  • src/pages/__tests__/SettingsPage.extended.test.tsx
  • src/pages/__tests__/SettingsPage.test.tsx

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


📝 Walkthrough

Walkthrough

SettingsPage now reads settings state through centralized store selectors and performs mutations through store actions. Its tests add store mocks backed by the existing mocked application state.

Changes

Settings store migration

Layer / File(s) Summary
Centralized SettingsPage state access
src/pages/SettingsPage.tsx
SettingsPage replaces domain-specific context hooks with useStoreSelector and useStoreActions for settings-related state and mutations.
Store-backed test mocks
src/pages/__tests__/SettingsPage.extended.test.tsx, src/pages/__tests__/SettingsPage.test.tsx
Both test suites add useStore mocks that connect selectors and actions to the existing mocked application state.

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

Merge Risk: ⚪ Minimal · up to 04199

This localized change narrows SettingsPage subscriptions while updating its tests; 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 identifies the main change: migrating SettingsPage to the selector store.
Description check ✅ Passed The description directly explains the SettingsPage migration, its performance goal, and the related test updates.
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 17, 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 09:09
Nine data slices now come from one useStoreSelector and seven actions
from the stable useStoreActions context; only usePlatform remains for
importBackup (a platform action not exposed by the store). Whole-domain
subscriptions previously re-rendered the page on unrelated updates.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
The roster domain hooks filtered soft-deleted rows; the selector-store
migration read raw slices. Restore the active-student / active-rubric
filtering so backup/export counts and lists exclude archived students
and deleted student rubrics.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
@NesiciCoding
NesiciCoding force-pushed the perf/selector-store-settingspage branch from 04199a0 to 38599f2 Compare August 18, 2026 07:10
@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.5% (🎯 65%) 11083 / 13767
🟢 Statements 78.5% (🎯 65%) 12728 / 16213
🟢 Functions 71.27% (🎯 60%) 4010 / 5626
🟢 Branches 69.5% (🎯 58%) 9375 / 13489
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/pages/SettingsPage.tsx 72.37% 71.34% 62.8% 74.8% 184, 202, 260-261, 271, 303, 314-315, 327, 330, 334, 341, 347, 353, 366, 381, 470-471, 541, 576-634, 702-751, 829-998, 1131, 1211-1262, 1347-1553, 1749, 1878-1893, 2018-2121, 2144, 2169-2171
Generated in workflow #1264 for commit 38599f2 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-settingspage 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