2.0 KiB
2.0 KiB
Project Plan: Global Shift Fallback & Responsive Matrix
Problem Diagnosis
- Fallback Logic Broken: The matrix correctly parses overrides inside
employee_daily_shifts, but defaults everything else toRD(Rest Day). If an employee has a defaultshift_idmapped directly on their internal profile, the engine ignores it. - Responsiveness: Broad tables with 31 columns inevitably clash against CSS layouts if the overflow boundaries aren't properly constrained.
Proposed Changes
1. Shift Engine Backend Refactor (ShiftController.php)
- Eager Loading: The
Userquery will be updated to eagerly loademployee.shift. - Inheritance Math: Inject logic into the mapping loop:
- If a specific date exists securely inside
employee_daily_shifts, USE IT. - If NOT, check if
$user->employee->shiftexists securely. USE IT. - If BOTH fail, gracefully fall back to
RD(Rest Day).
- If a specific date exists securely inside
2. Frontend React Component Constraint (calendar.tsx)
- Enhance the structural UI table wrappers to use robust flexbox width boundaries (
w-full overflow-hidden->min-w-full inline-blockortable-layout: fixedscrolling tricks). - Prevent the "sticky" left column container from accidentally swallowing internal scrollbars on mobile viewports.
Warning
Socratic Gate / Clarifying Questions
1. Weekend Rest Days: If an employee has a default
shift_id(e.g., "Morning Shift"), should I apply this shift to ALL 7 DAYS of the week, or are there standard built-in Rest Days (like Saturday/Sunday) where it should forcibly fall back toRDinstead?2. Table Behavior: For responsiveness, do you want the rightward days to shrink to an absolute minimum standard width (e.g.,
45px), providing a smooth scroll across the month? Or do you want them structurally bound inside their container?
Verification Checklist
- The table perfectly scrolls horizontally on narrow laptops securely.
- If Ana Regina has "Morning" set on her profile, standard days display
Minstead ofRD.