Skip to content

Refactor Code for Desktop Compatability - #54

Merged
mirmirmirr merged 83 commits into
main-previewfrom
51-adjust-semester-block-for-desktop
Oct 28, 2025
Merged

Refactor Code for Desktop Compatability#54
mirmirmirr merged 83 commits into
main-previewfrom
51-adjust-semester-block-for-desktop

Conversation

@mirmirmirr

Copy link
Copy Markdown
Contributor

This pull request introduces a major refactor of the application's state management and component structure, especially around course management and drag-and-drop functionality. The core logic for managing courses, filters, and drag-and-drop interactions has been moved from the App.tsx file into dedicated context providers and custom hooks. Additionally, course-related components have been modularized and specialized for different views (Catalog, Planner, Toolbox), resulting in a more maintainable and scalable codebase.

Key changes include:

State Management & Architecture

  • Refactored global state management for courses and filters out of App.tsx, replacing prop drilling with CourseWorkspaceProvider and FilterProvider context providers, and encapsulated drag-and-drop logic in the useCourseWorkspace hook. This simplifies component props and centralizes state logic.

Component Modularization

  • Split the generic Course component into specialized components for each context:
    • CatalogCourse for catalog display and adding to toolbox
    • PlannerCourse for planner view with right-click context menu and course manipulation options
    • ToolboxCourse for toolbox view with drag-and-drop styling
  • Removed the old generic Course component, consolidating its logic into the new specialized components.

Dependency Updates

  • Added the tailwind-scrollbar package to package.json for improved custom scrollbar styling.

References:
[1] [2] [3] [4] [5] [6]

@mirmirmirr
mirmirmirr marked this pull request as ready for review October 28, 2025 17:21
@mirmirmirr mirmirmirr self-assigned this Oct 28, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@mirmirmirr
mirmirmirr requested a review from Copilot October 28, 2025 18:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 43 out of 45 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/components/Course/PlannerCourse.tsx
Comment thread src/hooks/usePlannerCourseOptions.ts
Comment thread src/pages/Planner.tsx
Comment thread src/components/SearchBar/FilterPanel/FilterPanelPopup.tsx
Comment thread src/components/PlannerComponents/PlannerOptionsPopup.tsx
Comment thread src/components/Department-Filters.tsx
Comment thread src/components/SearchBar/SeachBar.tsx Outdated

@ccheung777 ccheung777 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💅🏻

@mirmirmirr
mirmirmirr merged commit 436923d into main-preview Oct 28, 2025
1 check passed
@mirmirmirr
mirmirmirr deleted the 51-adjust-semester-block-for-desktop branch October 28, 2025 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants