For recurring jobs that repeat identically across many locations (e.g.
clean AC filter in every room), one task_templates row per location is
still required — schedule/completion tracking is per-location, which
matters especially for floating mode — but creating and organising
that many rows by hand didn't scale.
- New template_groups table (id, unique name) + task_templates.group_id.
POST /api/template-groups upserts by name so picking an existing
group from the UI never creates a duplicate folder.
- Recurring template form: optional group name (datalist-autocompleted
from existing groups) plus a "create for multiple locations" toggle
that reveals a checkbox list of locations; saving loops one
createTemplate() call per selected location, all sharing the
resolved group_id.
- Duplicate button on each template row pre-fills the New Template
form from that row (location/asset/next-due cleared for repicking),
landing in the same group automatically — the lightweight path for
adding one more room later without the bulk picker.
- Recurring.tsx list now groups rows under a collapsible folder header
per group_name; ungrouped templates render as flat rows as before.
Fixed mode keeps the existing behavior: next_due always advances from
the previous scheduled date, regardless of when a task is actually
completed. Floating mode instead computes the next occurrence from
the completion date of the current task, so early/late completion
shifts the whole schedule.
- task_templates gains schedule_mode ('fixed'|'floating', default
'fixed') and pending_task_id, tracking the open task spawned from a
floating template so the hourly sweep doesn't respawn duplicates
before it's resolved.
- scheduler.js: floating templates set pending_task_id instead of
advancing next_due at spawn time.
- tasks.js /resolve: floating templates recompute next_due from
completed_at once the task is marked fixed (not temporary_fix,
since that isn't really done yet); pending_task_id is always
cleared on fixed resolution so a stale flag can't wedge the
template if the mode changed mid-cycle.
- addInterval/isoDate pulled out of scheduler.js into a shared
lib/recurrence.js used by both the scheduler and the resolve route.
- Recurring.tsx: schedule mode toggle in the template form, and the
list shows "awaiting completion" instead of a stale next-due date
for floating templates with an open occurrence.
- Photos open in a full-screen lightbox overlay instead of navigating to a new tab (fixes PWA back-button issue)
- DB migration adds photo_id to task_events; photo upload logs the reference so activity timeline can show a clickable thumbnail for each 'Photo added' event
- Edit and Delete buttons moved to a quiet ghost-button footer at the bottom-right of the modal
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Buffer upload → auto-rotate (EXIF) → resize to 1800px max → JPEG 82% progressive. Typical phone photo drops from 4-8 MB to ~200-400 KB. sharp prebuilt binaries include libvips so no Alpine package changes needed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Edit button (update cap): inline form for title, description, priority, unusable flag, due date. Delete button (admin only): hard delete with confirm step, cascades photos/events and cleans files from disk. Backend adds DELETE /api/tasks/:id route.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When a task is created or reassigned to a staff member, a push notification
is sent to any devices they have subscribed on. Keys are auto-generated on
first boot and stored in the config table (no manual VAPID setup needed).
- Backend: web-push dep, push_subscriptions table, lib/push.js (VAPID +
send), routes/push.js (vapid-key / subscribe / unsubscribe endpoints),
push notify wired into task-core createTask and tasks PATCH reassignment
- Frontend: switched vite-plugin-pwa to injectManifest strategy, custom
sw.js handles precache + push event + notificationclick, usePushSubscription
hook requests permission and registers subscription on login
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Wire up vite-plugin-pwa so Docker builds generate the web manifest
and service worker (was missing, causing installs to show portal icon).
Adds UpdateBanner with version-based polling via health endpoint.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
A confirmed booking for today that hasn't checked in yet is accessible —
staff can get in before the guest arrives. Previously it was lumped with
in-room guests and greyed out.
Backend: classifyBookingStatus() splits NewBook 'staying' bookings by
status string (normalised). Statuses containing 'arriv', 'inhouse' or
'checkedin' → occupied; everything else → arriving. /api/occupancy now
returns both occupied_site_ids and arriving_site_ids.
Frontend:
- Occupied rooms: greyed out + 'Occupied' badge (guest physically in room)
- Arriving today: normal display + amber 'Arrival today' badge (access now,
prioritise before guest checks in)
- Chip label shows 'Rooms (X free • Y arriving • Z occupied)' breakdown
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- #2#5: Replace plain <select> location pickers in NewTask and Assets with
SearchSelect combobox — full-text search across name and category group
- #3: Add "Unknown" checkbox on asset install date — disables the field and
saves null instead of leaving an ambiguous blank
- #4: Add inline "Add service task" form in asset detail modal — creates a
recurring template pre-linked to the asset without leaving the page
- #6: Fix unoccupied rooms filter — was always empty because (a) list_type
was 'all' instead of 'staying' and (b) only checked b.site_id but NewBook
returns booking_site_id on most account configs
- #8: Add open-task count badges to category filter chips on Summary page
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Unsellable flag is in-app visibility only; staff mark rooms out of
order in NewBook through their own process. NewBook use is now
read-only (room sync + occupancy filter).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>