Daily Changelog – September 2, 2025

09/02/2025

  • Kickoff: Created today’s changelog file.
  • Task: Improve readability of the “Record Sick Day” dialog overlay (busy background shows through too much). Will increase overlay opacity/blur using theme tokens only.

Notes:

  • Follow color token enforcement. No raw hex/rgb.
  • Ensure overlay uses bg-background or token-based surface + blur and higher opacity.

  • Feature: Added PTO request editing

– Employees can edit their own requests. If the edit increases time off, status flips to pending for re-approval. Reductions or cancellations apply immediately without manager approval.

– Admins can edit any request.

  • Backend

– Added PUT /api/pto-requests/[id] to update fields, recalc hours, adjust PTO balance, and rebuild weekly schedules for changed ranges.

– Ownership/role checks: admin or the owning employee only.

– Fix: If hours_requested is null, compute previous hours from dates/times to correctly detect increases vs reductions.

  • Scheduling

– When approved requests are edited and narrowed, restore schedule on removed edges.

– When extended, pending status restores schedules across the new range until re-approved.

  • UI (Admin: time-off-requests)

– Added Edit action with prefilled modal. Normalizes dates to yyyy-MM-dd and syncs calendar range.

– Shows server error messages on approval failures instead of a generic toast.

– Copy updated: “First day off” and “Last day off (inclusive)”.

  • UI (Employee: employee/time-off)

– Added Edit and Cancel actions with prefilled dates (yyyy-MM-dd normalization).

– Cancel deletes the request and restores schedules.

  • Misc

– All colors remain token-based per theme rules. No raw colors introduced.

  • Big Refactor: Employee Portal → Single-Page App (SPA)

– Left pane keeps the time clock fixed; right pane swaps content via tabs: Overview, Schedule, Time Off, PTO Bank, Profile.

– Inline Time Off experience: list existing PTO requests and submit new ones without leaving the portal.

– Schedule preview on Overview with quick open to full weekly view.

– PTO Bank summary on Overview; simple profile panel.

  • Routing/UX

– Deprecated legacy sub-pages and added client-side redirects to the portal SPA:

– /employee/schedule, /employee/time-off, /employee/clock, /employee/profile, /employee/tasks, /employee/sick-day → /employee

– Updated portal quick nav to stateful tabs (no hard navigation).

  • Visual polish (token-only)

– Added subtle header accent stripes per section using theme tokens (primary/info/success/warning) — no raw colors.

– Introduced small status “pills” (e.g., Next PTO, Week range, Clocked In/Out, task counts) for quick context.

  • Data wiring

– Time Off tab fetches only when opened; submit form posts to /api/pto-requests and refreshes inline list.

– Kept existing API contracts; no server migrations required for SPA shift.

  • Safety/consistency

– Week logic remains Monday-start per policy; all time handling continues to display in configured local time.

– Strict token usage preserved across new UI (bg-card, border-border, text-muted-foreground, info/success/warning variants).

Dev note: The portal now feels cohesive and fast — fewer page loads, more actual work done. If we want deep links later, we can sync the tab to a query param (e.g., ?tab=timeOff) without much effort.