Skip to content

Conversation

@boyuan12
Copy link
Contributor

@boyuan12 boyuan12 commented Jun 2, 2025

Description

Added debounce and rendered all classes on db when appropriate

Screenshots/Media

Issues

Closes #178 #179

@h0ethan04 h0ethan04 requested a review from Copilot June 3, 2025 07:45
Copy link
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 PR implements bugfixes for issues #178 and #179 by adding debounce logic to the search bar and ensuring that classes and events are rendered appropriately based on tag filters. Key changes include:

  • Introducing a debounce mechanism in SearchBar to reduce unnecessary API calls.
  • Refactoring Discovery to separate API calls for classes and events and to reset filters when toggling tabs.
  • Updating Bookings to improve search behavior and UI layout consistency.

Reviewed Changes

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

File Description
client/src/components/searchbar/SearchBar.jsx Added debounce effect on search input with immediate search on Enter
client/src/components/discovery/Discovery.jsx Refactored API calls, search functions, tag filtering, and tab switching logic
client/src/components/bookings/Bookings.jsx Updated search functions, removed deprecated code, and adjusted layout for consistency
Comments suppressed due to low confidence (2)

client/src/components/bookings/Bookings.jsx:740

  • [nitpick] Use a unique key, such as classItem.id, when rendering the list to avoid potential rendering issues when the order changes.
classes.map((classItem) => {

client/src/components/bookings/Bookings.jsx:818

  • [nitpick] Consider using eventItem.id as the key instead of the index to ensure consistent rendering of event items.
events.map((eventItem, index) => {

@h0ethan04 h0ethan04 merged commit d28d5be into dev Jun 3, 2025
1 check failed
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.

[BUG] Search bar showing all items in db on empty

5 participants