Skip to content

Conversation

@codeunia-dev
Copy link
Owner

@codeunia-dev codeunia-dev commented Dec 19, 2025

🚀 Summary

This PR introduces a Staff Schedule page along with supporting scripts to simplify managing and debugging staff shifts and leaves.

✨ What’s Included

  • 🗓️ New Staff Schedule page for viewing and managing staff schedules
  • ⚙️ Utility scripts to:
    • Manage staff shifts
    • Debug leave and shift-related data issues
  • 🧹 Improved visibility into scheduling data for easier maintenance and debugging

🧪 How to Test

  1. Open the Staff Schedule page
  2. Verify shifts and leaves are rendered correctly
  3. Run the added scripts and ensure expected outputs
  4. Check for regressions in existing staff workflows

📌 Notes

  • No breaking changes
  • Focused on developer experience and operational clarity

Authored by: @akshay0611

Summary by CodeRabbit

  • New Features
    • New staff schedule page with weekly grid view of shifts and leave requests
    • Navigate between weeks with previous/next buttons; reset to current week
    • Month/year selector for viewing different time periods
    • Visual legend indicating scheduled shifts, leaves, and weekly days off
    • Loading spinner during authentication and data fetch

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Dec 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
codeunia Ready Ready Preview, Comment Dec 19, 2025 0:22am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 19, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

A new client-side React page for viewing weekly staff schedules is introduced. It authenticates users via a local auth hook, fetches shifts and leave request data from Supabase for the current week plus buffer weeks, and renders a 7-day grid with shifts, leaves, weekly offs, and week navigation controls.

Changes

Cohort / File(s) Summary
Schedule Page Component
app/staff/schedule/page.tsx
New client page component implementing a weekly schedule view. Includes Supabase client initialization, user authentication via useAuth, data fetching for shifts and leave requests within a rolling date window, state management for currentDate/shifts/leaves/loading, and a responsive 7-day grid UI with day headers, shift/leave display, and navigation controls (prev/next week, today button). Incorporates error handling with special-case tolerance for a missing table error (42P01) during development.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Supabase query logic and error handling strategy, particularly the intentional bypass of 42P01 errors
  • Date window calculation logic and boundary conditions (previous/next week buffer)
  • State dependency chains in useEffect hooks to ensure proper data fetching on date changes
  • Leave request filtering logic for rejected statuses and date range overlaps

Poem

🐰 A schedule page takes shape with grace,
Showing shifts in time and space,
Supabase calls with auth so fine,
Seven days in perfect line,
Hippity-hop, the view's divine! ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/staff-admin-attendance-routing

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b6a4e38 and 700e547.

📒 Files selected for processing (1)
  • app/staff/schedule/page.tsx (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codeunia-dev codeunia-dev merged commit bdcd3d5 into main Dec 19, 2025
3 of 4 checks passed
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