A window on fixed steps now has gridMinutes; the admin picks it when
creating or generating windows, and copies keep it. Added to the
(unmerged, undeployed) time-windows migration and pb_schema.json.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hy2vMnHJYP7QGsiH21zHxW
The card shows "from" the lowest price and the range of lengths; the
slider moves into the booking panel, above the date picker.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hy2vMnHJYP7QGsiH21zHxW
Services get rows of length + price. /slots creates windows (date, hours,
services, start-times mode) and group sessions (service, length, start,
places); the day view shows free time and bookings. Generate/copy/clear
handle both kinds; windows may not overlap and can't shrink past a booking.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hy2vMnHJYP7QGsiH21zHxW
Service cards step through their lengths with a slider and the price
follows. The time picker loads bookable times for the chosen length and
the months on screen from GET /api/slots (a proxy to the shop hook in each
app), and reloads when the basket's bookings change. Checkout, emails and
the basket show each booking's own length.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hy2vMnHJYP7QGsiH21zHxW
A service now has `durations` ([{ minutes, price }]) instead of one
duration and price. A slot is either a `window` (a stretch of time with the
services that can be booked in it, start times every 30 min or only at the
edges of the free time) or a `session` (one service, fixed time, places —
the old group slot). Basket and order lines carry their own start and
minutes, so availability is computed from bookings alone.
The migration keeps paid bookings blocking their time (order lines get
minutes from their slot), then deletes the old slots — agreed: start fresh.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hy2vMnHJYP7QGsiH21zHxW
evashafik-copy.json is the current Tilda site page for page (same URLs,
verbatim text, original photos). evashafik-enhanced.json is the same
content with the events calendar, online booking/payment and a
conversion-focused structure. backups/README.md explains both and lists
the services to create after importing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qq6FzyGitv5gDZEcCHDGoo
formatPrice always formatted EUR, so the public shop, checkout, basket
and order confirmation showed € even when Stripe charged another
currency. It now takes a currency; both apps pass STRIPE_CURRENCY to the
blocks as layout data `currency` (like `timezone`), so one setting drives
what Stripe charges and every price shown.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qq6FzyGitv5gDZEcCHDGoo
Admin /customers finds a customer by name, email, phone or notes (orders and unpaid checkouts), exports everything stored as JSON, corrects details on every record, and erases them — anonymising orders (amounts, services and dates stay for the accounts) and deleting unpaid checkouts. A daily cron (and PocketBase start) deletes unpaid checkouts after N days and, when set, anonymises orders after M months, skipping orders with a booking ahead. A paid basket's copy of the details is cleared when its order is created. All writes are in pocketbase/pb_hooks/privacy (orders and baskets are superuser-only); migration 1793000000 makes orders.email optional and adds orders.anonymisedAt.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VaXE9U7AmW3dfD2w6cbLfk
Site design → Footer picks the privacy policy page; it is linked from the footer and from a short notice above Pay. The notes field asks customers not to write health details (special-category data). 'Create a privacy policy draft' makes an unpublished page describing what this software does with customer data, with gaps for the studio to fill in. No consent checkbox: booking data is processed to perform the contract. Also adds the PrivacyGlobal type used by the retention settings.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VaXE9U7AmW3dfD2w6cbLfk
Google Fonts and Stripe.js (imported from @stripe/stripe-js, which injects the script on import) sent every visitor's IP address to Google and Stripe on every page. Fonts now come from @fontsource packages bundled into each app; Stripe.js loads from the 'pure' entry point, only when the customer presses Pay.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VaXE9U7AmW3dfD2w6cbLfk
Basket changes that free or take places reload the page data, so places
removed from the basket show up in the shop again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VaXE9U7AmW3dfD2w6cbLfk
Formatting with the default locale rendered US dates (MM/DD/YYYY, 12-hour)
on the server. Everything shown to people now uses DISPLAY_LOCALE (en-GB)
and booking times use SITE_TIMEZONE. The public layout reloads on every
navigation so places left are never stale.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VaXE9U7AmW3dfD2w6cbLfk
Calendar, day panel and list show available / in a basket / booked /
full / blocked (with what blocks it) and places taken. Services, Generate
and single slots take places (default from the service); Copy keeps
them. Once any place is taken only places (not below taken) and notes
can change. All reads go through the shop hook's slot details.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VaXE9U7AmW3dfD2w6cbLfk
Group times show places left and can be added again for another place;
the listing reloads after adding, since one booking can block other
times. Checkout gets a quantity stepper for group lines.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VaXE9U7AmW3dfD2w6cbLfk
Slots get a capacity (items.capacity is the service default). Booking
state is no longer stored on the slot: slotStates() in the shop hooks
counts places from paid order lines and live basket holds (heldUntil
moves to the basket line), and a slot with any place taken blocks every
overlapping slot of any service, including get-ready time.
GET /api/shop/slots lists bookable slots (public) or full detail for a
signed-in admin. add_slot takes seats and adds to an existing line;
group lines can change quantity. Checks and writes share one
transaction. Migration moves existing holds, drops the unique index and
slot status/heldUntil/order, and makes slots signed-in only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VaXE9U7AmW3dfD2w6cbLfk
/slots?month=YYYY-MM loads only that month's grid; chips coloured by
status, service filter, a day panel with add/copy/clear, and the month's
list collapsed below. The single-slot form is enhanced so saving keeps
the month. Docs updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VaXE9U7AmW3dfD2w6cbLfk
Generate fills a date range (weekdays x opening hours) spaced by the
service's duration + get-ready time (overridable). Copy repeats a week
into the next 1-12 weeks; Clear deletes free slots in a range. Each
previews first, skips past slots and overlaps with the same service, and
never touches booked or in-basket slots. Planning is pure and DST-safe in
$shared/slots.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VaXE9U7AmW3dfD2w6cbLfk
Migration adds the field to existing databases; pb_schema.json mirrors it
in the 0.23 top-level format (min/onlyInt under "options" is ignored).
Edited next to Duration in Services & products.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VaXE9U7AmW3dfD2w6cbLfk
ORIGIN, PUBLIC_POCKETBASE_URL and PUBLIC_SITE_URL were hard-coded to
http://<sub>.${DOMAIN}:8080. Behind a TLS reverse proxy the browser's
origin is https://<sub>.<domain>, so SvelteKit rejected the admin login
form ("Cross-site POST form submissions are forbidden") and image URLs
pointed at an unreachable port. URL_SCHEME / URL_PORT now build them
(defaults unchanged). Two flat variables because podman-compose 1.5 does
not support nested ${A:-${B}} defaults.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
The public (internet-facing) app logged in as the PocketBase superuser and
held the Stripe secret key, so any bug in it could become full control of
the database. Baskets, slot holds, Stripe PaymentIntents, the webhook that
creates orders, and the payment-result lookup now run in PocketBase JS
hooks (pocketbase/pb_hooks/shop, routes under /api/shop/*, plus a cron
that releases expired holds every minute).
The public app's routes keep their URLs but only proxy to those routes and
manage the basket cookie; it has no PocketBase or Stripe secret. Booking
emails are still rendered and sent by the public app (same renderer as the
admin preview) from order data the webhook hook returns; it records the
outcome via a narrow endpoint guarded by INTERNAL_API_SECRET.
Also: slot add and order creation are now transactional; shop listings
load anonymously (already public via API rules); shop API errors always
reach the browser as JSON; the superuser client and stripe package are
removed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
order_lines had empty create/update/delete rules, so anyone could forge,
edit or delete the line items of real orders through the REST API. Writes
are now superuser-only (migration + pb_schema.json).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
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