Skip to content

perf(render): migrate ExportPage to the selector store - #428

Merged
NesiciCoding merged 2 commits into
perf/selector-store-activitydashboardfrom
perf/selector-store-exportpage
Aug 18, 2026
Merged

perf(render): migrate ExportPage to the selector store#428
NesiciCoding merged 2 commits into
perf/selector-store-activitydashboardfrom
perf/selector-store-exportpage

Conversation

@NesiciCoding

@NesiciCoding NesiciCoding commented Aug 13, 2026

Copy link
Copy Markdown
Owner

What

Migrates ExportPage from seven whole-domain hooks to one useStoreSelector for its 13 data slices (students, classes, studentRubrics, rubrics, gradeScales, exportTemplates, selfAssessments, analysisResults, tests, studentTests, essayAssignments, essaySubmissions, settings) plus useStoreActions for saveStudentRubric / updateSettings.

Why

Whole-domain subscriptions re-render the page on every unrelated collection update. Selecting only rendered slices isolates it to the data it actually uses.

Notes

  • Domain-hook subscriptions drop from 7 → 0.
  • Dedicated suite routes selectors/actions through its mocked app value; the five generic page suites that render the page already covered the selector store.

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

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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: 9d7863bc-cbca-4cc6-9c1b-8575e848ebcc

📥 Commits

Reviewing files that changed from the base of the PR and between c2f39d3 and f7b1d20.

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

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


📝 Walkthrough

Walkthrough

ExportPage now consumes export data and actions through useStoreSelector and useStoreActions. It filters archived students and deleted student rubrics. The test adds a matching useStore mock.

Changes

ExportPage store migration

Layer / File(s) Summary
Store integration and test adaptation
src/pages/ExportPage.tsx, src/pages/__tests__/ExportPage.test.tsx
ExportPage replaces AppContext hooks with store selector and action hooks. The selector excludes archived students and deleted student rubrics. The test mocks the store hooks and preserves context-backed actions.

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

Merge Risk: ⚪ Minimal · up to f7b1d

This change narrows ExportPage state subscriptions without introducing a concrete user-facing correctness, security, availability, or deployment risk in the supplied evidence; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: migrating ExportPage to the selector store for improved render performance.
Description check ✅ Passed The description directly explains the ExportPage migration, its performance purpose, implementation details, and test coverage.
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 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

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:49
ExportPage subscribed to seven whole-domain hooks for thirteen data
slices and two actions. Data now comes from one useStoreSelector and
actions from the stable useStoreActions context, so the page re-renders
only when the slices it renders change.

🤖 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 archived students can't be exported and deleted student
rubrics don't surface in export lists.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
@NesiciCoding
NesiciCoding force-pushed the perf/selector-store-exportpage branch from c2f39d3 to f7b1d20 Compare August 18, 2026 06:50
@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%) 11093 / 13786
🟢 Statements 78.43% (🎯 65%) 12706 / 16199
🟢 Functions 71.08% (🎯 60%) 3976 / 5593
🟢 Branches 69.46% (🎯 58%) 9370 / 13489
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/pages/ExportPage.tsx 64.35% 62.9% 65.94% 67.88% 83, 123, 124, 127, 129, 153, 163, 172-175, 183, 212-216, 222, 230, 236-268, 279, 294-295, 308, 313, 340, 347, 357, 364, 368-369, 376, 383, 387, 398-406, 432, 434, 460-480, 498, 513-517, 519, 520, 525, 547, 573-585, 590, 600, 613-629, 674-676, 725-834, 969, 1028-1063, 1085, 1185-1202, 1314-1365, 1447-1463, 1473-1476, 1485-1488, 1510, 1604-1625
Generated in workflow #1255 for commit f7b1d20 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 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
NesiciCoding merged commit 7b57763 into main Aug 18, 2026
15 checks passed
@NesiciCoding
NesiciCoding deleted the perf/selector-store-exportpage 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