Hero, Shop, Checkout, checkout-return and the header logo fallback used
white text on the site Primary; on a light Primary that was unreadable.
They now use primary-content (auto-contrast, see $shared/theme).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
The URL slug was interpolated into the filter string, so a crafted URL
could rewrite the query (e.g. make any path serve a page). API rules
still limited it to published pages, so no drafts leaked.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
The admin preview never received items/slots/events, so Shop and Upcoming
calendar blocks were empty there. loadShopData() (shared) now feeds both
the public layout and a new /preview loader.
A Shop block with nothing to show (no active items, a filter matching
none, or commerce data unavailable because POCKETBASE_ADMIN_* is unset)
now says so instead of rendering an empty section.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
Below md the header hid its nav links with nothing in their place, so
phones had no way to navigate. A ☰ button now opens a drawer from the
right (native modal <dialog>: focus trap, Escape, inert page) with the
links, basket and booking button. It closes on backdrop tap, Escape and
navigation; the current page is marked in both menus.
The booking button now uses --color-primary-content, so a light brand
colour gets dark text instead of unreadable white.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
- Admin primary/secondary now follow the site's Primary/Accent colours
(owner's request), replacing the fixed admin sage. Text on them is picked
automatically (white or dark, whichever contrasts more), which keeps the
earlier low-contrast problem from coming back with light brand colours;
brand colour is no longer used as text (active nav item, placeholders).
- New $shared/theme renders the colours as a <style> in <head> during
SSR. The public site used to apply them in onMount, so every page load
flashed the default colours first.
- DaisyUI `secondary` now maps to the site Accent everywhere — the
button block's "Secondary" variant was DaisyUI's default pink.
- Colours are admin-entered text placed inside <style>, so only plain
colour values are accepted (hex, named, rgb()/hsl()/oklch()…); anything
else falls back to the default.
- Saving colours in Site design refreshes the admin theme immediately.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
The Delete label in each block row is `relative z-10` (to sit above its
hold-to-delete fill) — the same z-index as the dropdown, and later in the
DOM, so it painted on top of the open menu. Each row is now `isolate`
(its z-indexed layers stay inside it) and the dropdowns in the page and
email editors sit at z-20.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
`spectado/pocketbase:latest` meant any rebuild could silently jump
versions, while pb_schema.json and the JS migrations target 0.23's format
and API. 0.23.12 is the image `latest` currently resolves to (same image
id), so this changes nothing at runtime.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
Agreed with the site owner:
- Grouped sidebar (Website / Bookings / Settings) instead of a flat top
bar that overflowed on phones; a drawer with a hamburger below lg.
Signed-in email and Log out at the bottom.
- Labels: Globals → Site design, Items → Services & products,
Calendar → Events, Export/Import → Backup (URLs unchanged); page headings
and cross-references updated to match.
- Export/import moved from a navbar dropdown to a /backup page that says
what is and isn't included.
- Admin event calendar starts weeks on Monday (createCalendarMonth gains an
optional weekStartsOn; the public block is unchanged).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
Security:
- PocketBase's default `users` collection allows anonymous sign-up, and
every CMS rule only checks "signed in" (the admin login also accepts
`users`). Anyone could register via the public API and edit the site,
read orders/customer details, or log into the admin. Sign-up is now
superuser-only.
- orders.create, baskets.create/update and basket_lines.create/update/
delete were open to anonymous requests, allowing forged "paid" orders in
the admin and basket tampering. The public app performs all of these
server-side with the admin client, so they are now superuser-only
(basket add-item/add-slot verified still working).
Data:
- created/updated autodate fields on all app collections; orders are now
listed newest-first by date (ids are random, '-id' was not chronological).
- Unique indexes on pages.slug and globals.key (skipped with a log line if
existing data has duplicates, so PocketBase still starts).
Delivered as a JS migration in pocketbase/pb_migrations, mounted into the
container (the image already passes --migrationsDir=/pb_migrations), so it
applies once on the next start. pb_schema.json carries the same changes for
fresh installs, where the migration runs before the schema is imported.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
- Migrate all DaisyUI 4 form markup (form-control, label-text, *-bordered —
removed in v5) to v5 fieldset/legend; labels sat inline beside inputs
and inputs fell back to a fixed 20rem width.
- One Modal component (native <dialog>: Escape, focus trap) for page,
event, item and slot editors; destructive actions confirmed everywhere.
The page Delete confirm was ignored — returning false from onsubmit
doesn't cancel — so Cancel still deleted the page.
- Block editor follows the background-picker style throughout:
SegmentedControl rows (title-cased options, clearer selected state) and
a new ColorField row with reset; image position is Left/Right like the
alignment controls.
- Globals keep their layout; readable field labels, save feedback without
reload, hints wrap.
- Pages list: fixed broken Preview link (VITE_PUBLIC_SITE_URL was
undefined → "undefined/slug"), shown for published pages only; action
column no longer breaks row alignment; empty states on all tables.
- Items: image picker instead of a raw media-id field, upload errors shown
(were swallowed), prices in the shop currency instead of hard-coded EUR.
- Slots/orders/calendar: times shown in the site timezone with a fixed
locale (server and browser render the same text).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
- Saving no longer reloads the page: a validation error (empty title,
duplicate slug) used to re-render from the server and silently discard
every unsaved block edit. Shows saving/saved/error feedback like the
email editor, an "Unsaved changes" badge, and warns before leaving.
- Status shown in the header; on a published page "Save draft" was
misleading (changes go live immediately), so it now says so and the
button reads "Save". Publish is a named submit (no DOM mutation).
- Block list: selected block is visible again (Tailwind v4's default
border colour is currentColor, so every item had a heavy black border);
drag & drop works in Firefox (needs dataTransfer data) with a drop
indicator; Alt+↑/↓ keyboard reorder; hold-to-delete works from the
keyboard, is cancelled on pointercancel/unmount, and no longer selects
the wrong neighbour afterwards.
- Shared warnOnUnsavedChanges helper; the email editor uses it too
(confirm() is ignored on tab close — cancel() triggers the browser prompt).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
- An image URL used more than once in the same string (e.g. rich text) was
only replaced once, leaving broken __IMG__ placeholders after import.
- Images that failed to export were still replaced by placeholders that the
import could never resolve; keep the original URL instead.
- Validate the uploaded file's shape and JSON (was a 500 on bad input).
- Build lookup filters with pb.filter so names/slugs with quotes don't
create duplicates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
- Slot and timed-event times were parsed in the server's zone (UTC in the
container) while the form sent the admin's local wall-clock time, so every
save shifted them by the UTC offset (10:00 → 12:00 in Oslo, again on each
save). Inputs are now interpreted in SITE_TIMEZONE (shared helpers with
DST handling), the same setting the booking emails use.
- PocketBase failures in actions (duplicate, validation, relation in use,
DB down) now return a readable `fail()` instead of a 500 page.
- Pages: 404 for unknown slugs, slug filters built with pb.filter (quotes
broke them), duplicate-slug check on create/rename (no unique index),
invalid block JSON rejected instead of throwing; save returns a result so
the editor can stay on the page.
- Globals: only create a missing record on 404 — any other error (DB
hiccup) used to create duplicates; save reports success/failure.
- Slots: status is never taken from the form; re-read before update so a
slot booked or held since the page loaded isn't overwritten; don't delete
actively held slots.
- Orders: load all order lines in one request instead of one per order.
- Layout exposes site timezone and shop currency for display.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
- /login and /preview no longer render the admin navbar (the login page
showed Pages/Export/Logout to signed-out users; the page preview iframe
showed the whole admin shell above the draft).
- Site colours from Globals were written onto --color-primary/--color-accent
of the admin document, which are DaisyUI's theme variables — so the brand
colour restyled every admin button (low-contrast white-on-sage) and flashed
after hydration. Apply them only inside /preview; give the admin its own
sage primary at ~5:1 contrast.
- Login page redesigned with DaisyUI 5 markup (full-width inputs, labels
above), autocomplete hints, pending state.
- Navbar: active-route highlight, consistent button sizes, wraps instead of
overflowing on narrow screens.
- Import: confirm before overwriting, show per-item errors instead of
auto-reloading them away, friendly message for invalid JSON.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
- Auth cookie was always exported with the SDK default `Secure` flag, so
browsers dropped it over plain HTTP (CADDY_SCHEME=http) and login
looped back to /login. Set `secure` from the real request scheme.
- Logout never ran: the hook redirected every authenticated request to
/login (including POST /login?/logout) back to /pages. Only redirect GET.
- Refresh the token per request so revoked tokens log the user out instead
of surfacing as 500s, and sessions slide instead of expiring mid-edit.
- Use `_superusers` instead of the deprecated `pb.admins` alias; keep the
entered email on a failed login.
- docker-compose: fully-qualified image names (podman rejects short names).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv