Commit graph

12 commits

Author SHA1 Message Date
a4c1f9bce5 Room planner: controls bar redesign + semantic filters + flat list view
- Cog button in date bar toggles controls bar visibility (persisted to localStorage)
- Controls bar: [Flat List][Categories] view toggle | [States Filter][Stats Filter] filter visibility toggles | [Reset View]
- Flat list view renders all visible rooms sorted numerically by name, no category headers
- States/stats filter bars independently show/hide based on controls bar toggles
- All view preferences (controlsVisible, viewMode, statesFilterVisible, statsFilterVisible) persist across page refreshes
- Semantic flow filters: 'arriving'/'departing' each match back-to-back rooms too; 'back-to-back' as exact match
- Filter chip counts use semantic union logic to match filter behaviour
- Guest name extraction tries guests[0].firstname+lastname (NewBook field names)
- booking_locked normalised: '0'/'1' strings handled explicitly (JS truthy fix)
- Category sort order pulled from settings global_config via internal HTTP endpoint

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-04 13:41:39 +00:00
fbe913c01c Room planner: semantic flow filters, forward arrow, padlock + guest name fixes
- Flow filter chips are now semantic: Departing = depart|B2B,
  Arriving = arrive|B2B, so B2B rooms appear in both chips. Adds
  missing Arriving filter.
- Forward → button added to date bar (right of datepicker)
- booking_locked normalised to real boolean — NewBook returns '0'/'1'
  strings which were all truthy, causing padlock on every room
- guest_name fallback: also try booking.guest_name (flat field) before
  account_for_name in case NewBook omits the guests[] array

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-04 13:07:55 +00:00
9ef047900b Room planner: fix settings scroll, checkout time to left-bracket sliver
- Settings page: add overflow-y:auto + flex:1 so content scrolls within
  page-content (which has overflow:hidden)

- Checkout time: move departure time out of B2B card stats row and into
  the left-bracket sliver, matching original plugin behaviour:
  - Only shown while prev booking status is still 'arrived' (not yet
    checked out); collapses to normal bracket once NewBook flips to
    'departed'
  - Positioned absolutely over the ::before left bracket area
  - Remove the forced 'departed' override on prev_status — let NewBook's
    real status drive bracket colour so the sliver shows correctly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-04 12:30:27 +00:00
0d14473daf Room planner: add debug-room endpoint, fix next_status null check
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-04 11:54:32 +00:00
cbfec7d591 Room planner: fix mobile layout — move top-bar inside page-content
top-bar was a sibling of page-content in the flex-row app-shell, so on
mobile it sat in the left column instead of spanning the top. Moving it
inside page-content (a flex column) makes it stack above the content on
mobile while remaining hidden on desktop.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-04 11:34:30 +00:00
b66b3a7854 Room planner: fix spans_next, night counter, and B2B booking priority
spans_next was using departure > viewDate (today), which made any 1-night
booking extend the card to the right. Fixed to departure > tomorrow so the
card only extends when it's also active tomorrow.

Night counter used Date.parse() on NewBook datetime strings, which browsers
parse as local time and shift off by hours in BST. Replaced with utcDay()
which slices the YYYY-MM-DD prefix and calls Date.UTC() — always correct.

When multiple bookings overlap today, prefer the one arriving today so an
arriving guest takes priority over a stale stopover. Also treat a co-active
non-arriving booking as the B2B departing context.

Force previous-day bracket to show as "departed" (purple) when that booking
departs today, without waiting for NewBook to update its status field.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-04 11:31:29 +00:00
00e5e684fa Room planner: rewrite card layout to match original Gantt design
Replace CSS grid with the original plugin's vertical list + 23px margin
bracket system. Each card has a 2px border coloured by booking status;
data-previous-status / data-next-status drive C-bracket pseudo-elements in
the 23px gutter; data-spans-previous/next remove the corresponding border
and collapse the margin to extend the card across days.

Card interior is restructured: header row (room number, flow badge, lock,
nights counter, site-status pill), guest info row, and stats row (time
pill, bed-type pill, task-status bordered pill). Category headers now match
the original's sticky bordered style with edge-extending pseudo-elements.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-04 10:02:44 +00:00
a7cc79a9b1 fix: serve frontend via root + slug subdir, not alias — assets 404/fallback
nginx alias + try_files resolves paths incorrectly (nginx trac #97), so
asset requests fell through to the SPA fallback and index.html was served
as the JS bundle — the app never booted. Match the proven twin-optimiser
pattern: copy dist to html/room-planner and use root with try_files.
Also node:20 → node:22 per stack convention.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-03 16:32:45 +00:00
5a2dab637c fix: AuthGate stuck on Loading — verify returns flat user object
The auth /verify endpoint returns { user_id, name, email, is_admin, caps }
directly, not wrapped in a user key, so data.user was undefined and the
gate never rendered. Also: caps come back as bare slugs when ?app= is
passed, so the prefixed room-planner:cap checks always failed — replaced
with the standard can(user, cap) helper honouring is_admin.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-03 16:25:20 +00:00
2993dfa216 room-planner: fix nginx — add missing central auth proxy block
Without /room-planner/api/auth/ → 10.10.10.101, auth verify hits the
app backend instead of the central auth service, causing infinite loading.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-03 13:29:24 +00:00
63b3e42a12 fix: correct index.html script src — Vite prepends base path, don't include it manually
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-03 13:15:30 +00:00
1e658b6a48 feat: add room-planner app — 3-day HK room view with NewBook integration
NewBook-connected daily housekeeping planner. Replaces the hotelhubmodule-housekeeping-dailylist
WordPress plugin. LXC 120 · 10.10.10.120:3080 · slug: room-planner.

- 3-day booking window (yesterday/today/tomorrow) fetched live from NewBook
- Task completion ticks back to NewBook; room status patches NewBook directly
- 23px border sliver CSS system for adjacent-day booking status
- 3-state filter cycling (off→inclusive→exclusive) for categories and flow types
- Stat filters for outstanding tasks and clean/dirty status
- Rolling 48h activity log with checkout/checkin/status/tasks events
- newbook_pings event bus for future NewBook poller integration
- Room modal with permission-gated guest/rate/notes, task checkboxes, status buttons
- Placeholder sections for future linen-count and routine-tasks modules
- Settings page: task type colours, twin/extra-bed detection, category exclusions
- Mobile-first layout (sidebar desktop, compact top bar mobile)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-03 13:07:00 +00:00