Skip to content

Fixes and sorting#92

Merged
Dinoxh merged 4 commits intomainfrom
fixes-and-sorting
May 7, 2025
Merged

Fixes and sorting#92
Dinoxh merged 4 commits intomainfrom
fixes-and-sorting

Conversation

@LSKpr
Copy link
Copy Markdown
Collaborator

@LSKpr LSKpr commented May 7, 2025

some small fixes
sub-optimal sorting

@Dinoxh Dinoxh enabled auto-merge (squash) May 7, 2025 12:07
@Dinoxh Dinoxh requested review from Dinoxh and Copilot May 7, 2025 12:08
@Dinoxh Dinoxh merged commit 35a0c52 into main May 7, 2025
1 check passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request improves search functionality and refines course sorting in the application.

  • Removes unused local state for search queries in the searchbar view
  • Implements a dynamic sorting mechanism in the list view with new sort options
  • Adds a fixed footer with total credits to the favourites dropdown

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
my-app/src/views/SearchbarView.jsx Removed local state for search query and now relying on props
my-app/src/views/ListView.jsx Added sorting state/logic that affects course ordering
my-app/src/views/Components/FavouriteDropdown.jsx Updated UI for footer and adjusted copy functionality
my-app/src/presenters/SearchbarPresenter.jsx Added local state for search query passed to the search view
Comments suppressed due to low confidence (1)

my-app/src/views/ListView.jsx:67

  • The calculation for setHasMore uses displayedCourses.length from state, which may be stale after updating the courses; consider computing hasMore using the length of the newly sorted courses to ensure consistency.
setHasMore(displayedCourses.length + nextItems.length < coursesToDisplay.length);


function SearchbarView(props) {
const [searchQuery, setSearchQuery] = useState("");
// const [searchQuery, setSearchQuery] = useState("");
Copy link

Copilot AI May 7, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider removing the commented-out state declaration if it is no longer needed to reduce clutter and improve code clarity.

Suggested change
// const [searchQuery, setSearchQuery] = useState("");
// (Line removed)

Copilot uses AI. Check for mistakes.
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.

3 participants