Commit Graph
173 Commits
Author SHA1 Message Date
popertotsandSisyphus 059c578775 feat(frontend): add name editing and GDPR export page
Add inline name editing on account page with validation, and GDPR data export page with cooldown timer.

- Inline edit first/last name with unicode-aware regex validation
- GDPR export page with countdown timer between exports (12h cooldown)
- Display referral savings instead of calculated estimate
- Add log out button in account settings section

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-20 16:59:35 +01:00
popertotsandSisyphus 1a3829b4d9 feat(frontend): add former name display, referral discount type, and refunds to bookings
Update frontend types, stores, and components to support name history display and new API fields.

- Add previousFirstName/previousLastName to User type and BookingUser type
- Add referral discount_source type and refunds array to Booking type
- Create nameDisplay.ts utility for rendering '(formerly ...)' labels
- Create booking.ts utility for booking-related helpers
- Update 25+ admin, payments, today, and account components to display
  former names on booking cards, modals, appointment views, and user lists

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-20 16:59:31 +01:00
popertotsandSisyphus 7f9c246818 refactor(frontend): remove gradient backgrounds for flat colors
Replace bg-gradient-to-* with flat bg-* on BookingFlow warning, demo card, prices CTA, and schedule divider for consistent flat design.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-19 11:34:47 +01:00
popertotsandSisyphus 895d5dd5e9 feat(frontend): redesign loyalty stamp card on account page
Restructure loyalty card: show completed-card banner above card, support multi-card display (stamps % 10), move from gradient to flat bg, update text to reflect multi-card and remaining stamps.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-19 11:34:42 +01:00
popertotsandSisyphus 0e727818e1 feat(frontend): add loyalty checkbox to admin and customer payment modals
Add loyalty stamp card checkbox UI to both payment modals. Admin modal: checkbox with card count, applies redemption via /apply-redemption before payment, adjusts amounts accordingly. Customer modal: add amount_paid === 0 guard, extract LOYALTY_DISCOUNT_RATE constant.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-19 11:34:36 +01:00
popertotsandSisyphus df6c0dece5 fix(frontend): update token refresh threshold and fix race condition
The 14-day refresh threshold was designed for the old 30-day tokens but the backend now emits 1-hour tokens. The threshold caused every page load to trigger an immediate /refresh-token call, which revoked the old JTI mid-flight while concurrent requests (profile, giftcards, bookings, etc.) were still using it, causing 401 errors.

Changes:
- Refresh threshold: 14 days -> 5 minutes (matches 1-hour token lifetime)
- Interval check: 60 min -> 2 min (must be shorter than threshold)
- Race condition: refresh now completes before profile fetch, preventing JTI invalidation during concurrent requests

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-18 16:34:35 +01:00
popertotsandSisyphus bac7cab4a0 feat(frontend): update page routes
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-18 16:27:17 +01:00
popertotsandSisyphus 05690af87e feat(frontend): update layout, UI components, stores, and API route
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-18 16:27:15 +01:00
popertotsandSisyphus fa51c6b2f9 feat(frontend): update payments and today components
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-18 16:27:04 +01:00
popertotsandSisyphus 2ad3c01a80 feat(frontend): update booking flow and account components
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-18 16:27:02 +01:00
popertotsandSisyphus b23a8b89c4 feat(frontend): update admin components
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-18 16:26:58 +01:00
popertotsandSisyphus 165d3d6c38 feat(frontend): add new UI components and utilities
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-18 16:26:56 +01:00
popertotsandSisyphus 6ace9abab8 feat(frontend): add deposit and payment warnings to cancel modal
Shows the total amount already paid in the cancellation confirmation, plus deposit-specific messaging: forfeiture warning when deposit is paid, and a note that outstanding deposit is no longer due when deposit is required but not yet paid.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-15 23:19:39 +01:00
popertotsandSisyphus 4cacb3461b feat(frontend): apply Playfair Display heading to login page
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-15 22:07:01 +01:00
popertotsandSisyphus a72a806248 feat(frontend): refine prices page layout and card styling
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-15 21:45:16 +01:00
popertotsandSisyphus 799510c934 feat(frontend): apply Playfair Display heading to admin, schedule, and today pages
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-15 21:45:12 +01:00
popertotsandSisyphus 7e1a2bdf9b feat(frontend): redesign schedule page with grouped card layout
Replace Card component with custom card design: group bookings by month, add color-coded status bars/badges/dots, fly transitions, loading skeletons, empty state with calendar icon, and improved time/date formatting. Remove dependency on shadcn Card component.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-15 21:27:39 +01:00
popertotsandSisyphus af73afe401 feat(frontend): add Playfair Display heading font to layout and pages
Load Playfair Display from Google Fonts via preconnect and stylesheet in root layout, then apply to h1 headings on BookingFlow, Account, and Contact pages for a consistent brand typography.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-15 21:27:34 +01:00
popertotsandSisyphus bf90b0fa42 feat(frontend): add done-for-day summary card to CurrentAppointment, fix schedule z-index
Replace current/next card with done-for-day summary state when all appointments are finished. Shows daily stats (payments, tips, duration, customers) and week summary when tomorrow is closed. Fix schedule grid z-index to remove stacking context that caused overlay issues.

Ultraworked with Sisyphus

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-15 20:27:47 +01:00
popertotsandSisyphus 867f86978b feat(frontend): integrate custom services across booking flow and routes
Update BookingFlow to support custom service selection, add custom_services to booking types, and link CustomServicesManagement into admin pages. Minor updates to schedules, prices, and today routes.

Ultraworked with Sisyphus (https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-15 16:58:37 +01:00
popertotsandSisyphus 8f8bf83b64 feat(frontend): add custom services management UI components
Add CustomServicesManagement component for CRUD operations on custom services. Update BookingCreateModal, WalkInCreateModal, and BookingsCard to support custom service selection. Minor improvements to ServicesManagement and ImageUpload.

Ultraworked with Sisyphus (https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-15 16:58:28 +01:00
popertots d77f330bda chore: commit pending changes before custom services implementation 2026-06-13 11:27:47 +01:00
popertotsandSisyphus 45814a4040 feat: implement portfolio carousel with swipe/nav, FLIP close button, 250ms slide
Adds a 3-slide flex-track carousel to the full-size image dialog with:\n- Swipe & button navigation\n- Dynamic close button positioning (FLIP animation, 150ms)\n- 250ms slide animation (buttons + swipe unified)\n- Preloading of adjacent images\n- Mobile button fix (touch start ignores buttons)\n- Fixed-height slides (95vh) prevent height cropping

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-13 10:41:00 +01:00
popertotsandSisyphus 18eaa00479 refactor(frontend): migrate email fields to EmailInput component
Replace raw <Input type="email"> with <EmailInput> in login (register + login), account (gift card recipient), BookingFlow (guest email), and GiftCardsManagement (admin gift card email).

Removes 30-line validateEmail() function from login page (now handled by EmailInput internally).

Removes validateEmailFormat() from BookingFlow (EmailInput handles format validation; debounced backend email check preserved via onvaluechange/onblur).

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-12 10:51:07 +01:00
popertotsandSisyphus 1cadbbe968 feat(frontend): add EmailInput component with validation
EmailInput wraps shadcn Input with built-in validation (regex + browser checkValidity), normalization (trim + lowercase on blur), and inline error display. Follows PhoneInput.svelte pattern with  value/error and onvaluechange/onerrorchange/onblur callbacks.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-12 10:51:01 +01:00
popertotsandSisyphus e7634ba187 feat(frontend): add email check and gift card support to booking flow
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-11 22:08:28 +01:00
popertotsandSisyphus 7a459a3986 feat(frontend): add gift card management UI and payment modal updates
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-11 22:08:27 +01:00
popertotsandSisyphus 1be82986a5 feat(frontend): add PhoneInput component with UK validation
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-11 22:08:26 +01:00
popertots 6756723c60 saved cards store 2026-06-07 12:38:22 +01:00
popertots 75cca8b158 fixes 2026-06-06 15:25:58 +01:00
popertots 59e7dd9fdc fixes 2026-06-06 15:23:10 +01:00
popertots 9c6eeeb426 Fixes 2026-06-06 15:18:37 +01:00
popertots b274d2c47b fixes for giftcards and phone input 2026-06-06 15:11:01 +01:00
popertots 4e174a6123 Fixes for giftcards and phone input 2026-06-06 15:10:48 +01:00
popertots 5258f90b06 Add giftcard management 2026-06-06 14:26:42 +01:00
popertots 310e6aaa80 Add giftcard management 2026-06-06 14:26:33 +01:00
popertots 44c9d423ec fix: restore cardNum definition in addCard
- Re-added 'const cardNum = newCardNumber.replace(/\s/g, '');' inside addCard
- Log actual error to console in catch block of addCard
2026-06-05 21:15:05 +01:00
popertots d2dea38b01 fix: replace crypto.randomUUID with generateIdempotencyKey
- Changed purchase flow to use generateIdempotencyKey() which uses secure
  window.crypto.getRandomValues with a math fallback, avoiding secure-context blocks on HTTP
- Log actual error to console in both Buy and Redeem catch blocks
2026-06-05 21:11:47 +01:00
popertots 883fd3076a fix: disable pay button unless full valid card is entered
- Added isBuyExpiryValid and isBuyCardValid reactive derivations
- Disabled Buy Gift Card button unless card is fully valid (Luhn checked number, future expiry, complete CVC)
- Verified clean compilation with zero warnings
2026-06-05 21:07:13 +01:00
popertots 0d4a74bd4a feat: caret preservation and Luhn validation in card inputs
- Added generic formatAndPreserveCursor() helper on frontend to track
  and restore selection caret position during dynamic input sanitization
- Applied to all card inputs, gift card code inputs, and expiry inputs
- Added Luhn validation (isValidLuhn) for saved cards and gift cards
- Rebuilt payments test DB and got 100% green tests
2026-06-05 21:05:36 +01:00
popertotsandSisyphus 69420298bd feat(frontend): add booking stats summary section to GDPR page
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-05 15:40:46 +01:00
popertotsandSisyphus 36ad38f670 feat(frontend): add /gdpr page with PDF export and JSON download
New /gdpr route: skeleton loading state, 2s polling for async export, styled report cards/tables matching /schedule and /account styling. 16 data sections with conditional rendering (empty sections hidden). VAT breakdowns hidden until any payment has non-zero VAT. Deposits Required hidden when 0. PDF export via window.print() with print CSS hiding navbar and verification banner. Raw JSON download button. Export My Data button added to Account page under Change Password. Vite worker format set to 'es' for WASM encoder compatibility.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-05 12:13:07 +01:00
popertots 6d4bc4d637 feat(loyalty-discount): implement loyalty and discount system
- Add discount campaign management and validation logic
- Update booking handlers with discount application flow
- Add customer relationship endpoints for loyalty tracking
- Update frontend modals (booking, approval, payment, reschedule)
- Add DiscountsManagement and loyalty reference documentation
- Update dev scripts and database init for discount tables
- Clean up completed plan files
2026-06-04 23:13:02 +01:00
popertotsandSisyphus f379e5c09a refactor(routes): move notifications to /admin/notifications, remove /manage
Moved /notifications to /admin/notifications to match admin-only access pattern. Updated NavBar bell icon and mobile menu links. Removed /manage route (leftover prototyping). Pre-hydration redirect already in place for admin-only guard.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-04 20:08:34 +01:00
popertotsandSisyphus 24b1823a5d fix(routes): add pre-hydration auth redirects to all protected pages
Replaced slow $effect-based auth checks with synchronous IIFE scripts in <svelte:head> that run during HTML parsing, before Svelte hydration. Covers: /today, /admin, /admin/schedule, /manage, /notifications (admin-only), and /account (auth-required). All redirect via window.location.replace() with no page flash.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-04 20:04:54 +01:00
popertotsandSisyphus 413b28b759 fix(login): redirect authenticated users before hydration
Uses a raw IIFE script in <svelte:head> that runs synchronously during HTML parsing, before Svelte hydration. Checks localStorage JWT and calls window.location.replace() for an instant redirect with no page flash.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-04 19:50:53 +01:00
popertotsandSisyphus ae1bc0f91a fix(login): redirect authenticated users before page render
Replaced -based redirect with +page.ts load function. Checks localStorage token directly and throws redirect(302) before the component mounts, preventing any flash of the login page.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-04 19:48:08 +01:00
popertotsandSisyphus f083da6345 fix(login): redirect authenticated users away from login page
Authenticated users visiting /login are immediately redirected: admins to /today, all others to /.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-04 19:46:36 +01:00
popertotsandSisyphus 6c16d65476 fix(frontend): Svelte 5 reactivity, each block keys, and path resolution
Add proper keys to #each blocks across 15+ components to fix reordering bugs. Replace new Date() with SvelteDate in reactive contexts. Use $derived for computed values (totalPages). Use resolve() from $app/paths for all internal navigation hrefs. Add ARIA labels and keyboard accessibility to NavBar mobile menu. Remove unused handleRetry from UserPaymentModal.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-04 01:08:36 +01:00
popertotsandSisyphus c76c3f52f7 feat(ui): loyalty stamp redesign and admin account restrictions
Redesigned fuchsia-themed loyalty stamp card with procedural SVG flower-petal stamps (unique shape per slot via sine-wave perturbation), star cutout mask, hover animations, and gradient background. Admin accounts now see simplified account page with History, Referral, Danger Zone tabs and loyalty stamp card hidden.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-06-04 01:07:43 +01:00