Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor AppStore to Zustand #1132

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Refactor AppStore to Zustand #1132

wants to merge 7 commits into from

Conversation

vicksey
Copy link
Contributor

@vicksey vicksey commented Jan 29, 2025

Summary

Refactored the AppStore into three stores Zustand stores:
scheduleStore - Manages scheduling-related state.
snackbarStore - Handles snack bar notifications and alerts.
undoRedoStore - Tracks and manages undo/redo actions for state changes.

This will improve maintainability, reusability, and debugging in the future by breaking down our previous AppStore

Test Plan

  • Verify that ALL scheduling-related functions work as expected. Calendar/Schedule behaviours:
  • Ensure all snack bar functionality appear and behave correctly.
  • Confirm that undo/redo functionality works across relevant components.
  • Check that all functionality on AppStore hasn't been broken by the migration
  • Run full regression test on all related functionality

Issues

  • Finished updating all components that originally referenced AppStore to the new Zustand stores.
  • Still in the process of testing all functions and fixing some bugs.

Closes #1076

To Do:

  • Implement scheduleStore, snackbarStore, undoRedoStore
  • Migrate logic from AppStore to new Zustand stores
  • Update all references to of AppStore throughout the codebase
  • Verify schedule, snack bar, and undo/redo behaviours still works after migration
  • Go through merge conflicts
  • Remove unnecessary code from AppStore (or the entirety of it)
  • Clean up code
  • Run regression tests
  • Waiting until I can merge with oauth

My tests:

  • Calendar/Schedule behaviours:
  • Add a schedule
  • Delete a schedule
  • Rename a schedule
  • Copy a schedule
  • Switch between schedules
  • Add a course to calendar
  • Delete a course to calendar
  • Add custom event to calendar
  • Calendar events are being correctly updated on the Added pane
  • Finals schedule is synced with Calendar schedule
  • Calendar events can be recoloured through Calendar and Added pane
  • Clear schedule
  • Locations link to map pane
  • Map is functional
  • Download calendar functions appropriately
  • Load schedule functions appropriately
  • Save schedule functions appropriately
  • Import a schedule from study list
  • Import a schedule from ZotCourse
  • Tour functions properly
  • Snack bar behaviours:
  • Load a schedule
  • Save a schedule
  • Errors?
  • Undo/Redo behaviours:
  • Undo last action button works
  • Cntrl+Z works

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.

Refactor AppStore to Zustand
1 participant