Skip to content

377 backend schedule logic fix#421

Merged
michelleyeoh merged 24 commits intomainfrom
377-backend-schedule-logic-fix
Mar 24, 2026
Merged

377 backend schedule logic fix#421
michelleyeoh merged 24 commits intomainfrom
377-backend-schedule-logic-fix

Conversation

@hadiafifah
Copy link
Contributor

finished updating logic to check end time and order accordingly

@hadiafifah hadiafifah linked an issue Mar 4, 2026 that may be closed by this pull request
2 tasks
@hadiafifah hadiafifah force-pushed the 377-backend-schedule-logic-fix branch from 9b304e3 to 3e534aa Compare March 4, 2026 09:22
@hadiafifah
Copy link
Contributor Author

Added #422 (branch name 391) changes to this branch because it needed fixes from this ticket to be fully finished. Feel free to disregard that PR.

On top of backend changes from this PR, and the visual changes from #422, I also refactored /schedule/page.tsx into reusable components because it was starting to get really chunky. These are the main changes:

File structure changes

  • page.tsx was reduced to mostly composition/presentation
  • Added dedicated hooks for schedule logic (useScheduleData.ts and useActiveDaySync.ts)
  • Added shared schedule modules to reduce duplication (constants.ts, types.ts, and groupedEntries.ts)
    Broke rendering into reusable components:
  • ScheduleControls.tsx
  • DayNavButtons.tsx
  • DaySection.tsx

Data/state refactor changes

  • Centralized schedule state in useScheduleData:
  1. active tab/day/filter state
  2. mobile filter drawer state
  3. grouped entries by day
  4. add/remove personal schedule handlers
  5. initial-load/error flags
  • Centralized day navigation sync in useActiveDaySync:
  1. click-to-day smooth scroll
  2. scroll-based active-day detection
  3. temporary click lock/pending-day logic to prevent highlight jitter
  • Centralized data transformation path:
  1. event data + personal data grouped by Pacific day key
  2. filter application moved to shared grouping utility
  3. deterministic sort with start-time + end-time tiebreak handling
  4. grouping by time label reused for both days

@michelleyeoh michelleyeoh linked an issue Mar 11, 2026 that may be closed by this pull request
2 tasks
Copy link

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 refactors the hacker schedule UI/data flow and updates time-based schedule logic so “next”/“live” determinations account for event end times, while also reorganizing schedule rendering into reusable hooks/components.

Changes:

  • Added shared schedule types and grouping utilities (group by day + start time, with end-time tie-breaking).
  • Reworked the schedule page to use a new useScheduleData hook and new controls/sections components (scroll-synced day nav).
  • Updated “next schedule” and schedule sneak peek logic to use end-time aware live/upcoming calculations and countdown labels.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
app/_types/schedule.ts Adds shared schedule-related TS types (EventDetails, ScheduleData, grouped entries).
app/(pages)/_hooks/useScheduleSneakPeekData.ts Changes sneak peek upcoming logic to “nearest next start-time batch” and adjusts filtering rules.
app/(pages)/_hooks/useScheduleData.ts New hook encapsulating schedule/personal data fetching, grouping, filters, and membership updates.
app/(pages)/_hooks/useNextSchedule.ts Fixes “next event” selection to include events that haven’t ended yet.
app/(pages)/_hooks/useActiveDaySync.ts New hook to sync active day tab with scroll position and smooth scroll navigation.
app/(pages)/_globals/globals.scss Fixes global selector scoping so body font-family isn’t nested under *.
app/(pages)/(hackers)/_components/Schedule/groupedEntries.ts New grouping/sorting helper with end-time tie-break logic.
app/(pages)/(hackers)/_components/Schedule/constants.ts Adds canonical DAY_KEYS / DAY_LABELS types/constants.
app/(pages)/(hackers)/_components/Schedule/ScheduleMobileControls.tsx Removes old mobile controls component (replaced by unified controls).
app/(pages)/(hackers)/_components/Schedule/ScheduleControls.tsx New unified controls for mobile + desktop (filters + day nav).
app/(pages)/(hackers)/_components/Schedule/DaySection.tsx New day section renderer (grouped by time) with empty states.
app/(pages)/(hackers)/_components/Schedule/DayNavButtons.tsx New day navigation button component with hover/focus preview.
app/(pages)/(hackers)/_components/HomeHacking/ScheduleSneakPeek.tsx Adds countdown labels and groups upcoming events by start time; removes prior upcoming empty-state UI (now commented out).
app/(pages)/(hackers)/(hub)/schedule/page.tsx Refactors schedule page to use the new hook + components and render per-day sections.

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

Copy link

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

Copilot reviewed 17 out of 18 changed files in this pull request and generated 5 comments.


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

Copy link

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

Copilot reviewed 17 out of 18 changed files in this pull request and generated 3 comments.


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

Copy link

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

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


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

Copy link

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

Copilot reviewed 17 out of 18 changed files in this pull request and generated 5 comments.


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

Copy link
Contributor

@michelleyeoh michelleyeoh left a comment

Choose a reason for hiding this comment

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

Nice job cleaning up schedule page! Pretty clean breakdown of components.
Moving forward please move hooks and types to the appropriate folder & some brief comments in the backend-related files would be nice for readability

Added:

  • schedule page & sneak peak requested fixes
  • useScheduleSharedNow for consistent seconds update

@michelleyeoh michelleyeoh deployed to development March 24, 2026 00:20 — with GitHub Actions Active
@michelleyeoh michelleyeoh merged commit 64de082 into main Mar 24, 2026
2 checks passed
@michelleyeoh michelleyeoh deleted the 377-backend-schedule-logic-fix branch March 24, 2026 00:23
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.

Schedule page fixes 2.0 Backend: Schedule logic fix

4 participants