Merged
Conversation
Dinoxh
approved these changes
May 7, 2025
Contributor
There was a problem hiding this comment.
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(""); |
There was a problem hiding this comment.
[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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
some small fixes
sub-optimal sorting