Previous wsArg approach still suffered from useCallback memoisation
interacting with React batching — loadAll could fire with the render-
before-last week start. Switch to weekStartRef (written before every
loadAll call and on every render) so loadAll always reads the live
value regardless of when the memoised function was created.
Also removes unused putWarningThresholds import (added externally).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Typing a date manually (e.g. "21") fires onChange on each keystroke,
so "2" would trigger a load for the 2nd before "21" was complete.
Added a 600ms debounce on the week-start and since-date inputs so the
load only fires after the user stops typing.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
`loadAll` captured `weekStart` in a stale closure when called via
`setTimeout`. Selecting a date would show the correct value in the input
but load data for the previously-shown week. Replaced all deferred
`setTimeout(() => loadAll(true), 0)` calls with direct `loadAll(true, newDate)`
calls, passing the updated date as an explicit argument.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The /hk-planner/api/auth/ → central auth nginx block was missing, causing
logout to hit the app backend. Also corrects the logout URL and switches from
window.location.href='/' to reload(). Shows name + email in sidebar footer.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Workforce's automatic_break_length is a payroll deduction setting, not a
scheduling field — applying it when no explicit breaks are present was silently
shortening all shifts (e.g. a 2h shift showing as 1.5h). Now only deducts
explicit break records from s.breaks. Also adds BUILD_VERSION to /health and
an UpdateBanner that prompts staff to reload when a new deploy lands.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Rename 'Category Settings' to 'Settings' (nav, page title, component)
- Move Recurring General Tasks and Time Requirements editing to Settings page
- Planner still loads both for calcRequired calculations
- Add date-specific Adjustments section to Planner: per-date +/- hour
offsets keyed by YYYY-MM-DD (non-recurring); feed into Required Hours total
- Adjustments row shown in Required Hours tfoot when non-zero
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pulls HK staff shifts from Workforce.com API into the staff rota section.
Rota rows (read-only, WF badge, times+hours per day) appear above manual rows;
manual name inputs get a datalist populated from WF staff. Sync triggered via
button with stale-week detection. Dept selection stored per-app in CategorySettings.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
▲/▼ indicators relate to occupied rooms, not D/S/A breakdown,
so move them to the top of the Rooms cell in both CatRows and TotalRows.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 2px left border on Rooms th/td marks each day boundary clearly
- Saturday/Sunday columns get a subtle blue-tinted background
- Occupied number shows pickup-change context + prior week stats on hover
- '+' pickup button shows prior week line (matching original WP plugin logic)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Match the original WP plugin layout — left cell has occupied count, vac,
and pickup controls; right cell has departs/stays/arrivals stacked
vertically, right-aligned, with delta indicators above them.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Housekeeping workload and hours planning app — port of the WP hotel
housekeeping hours calculator plugin. 7-day occupancy planner with
Newbook PMS integration, staff rota, time requirements, and pickup tracking.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>