Commit graph

557 commits

Author SHA1 Message Date
John Mizerek
390f409cf8 Use discovered header image URL in setup wizard
- Store headerImageUrl from discovery response
- Show preview of discovered header in header image step
- Download header via server-side downloadImages.php when no file uploaded
- Remove outdated Lucee comment

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 09:36:47 -07:00
John Mizerek
8537c78fe2 Add debug log: count items with imageUrl before platform images step
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 01:14:34 -07:00
John Mizerek
f10ebb8ba6 Debug platform image matching — log keys and item names for mismatch diagnosis
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 00:55:14 -07:00
John Mizerek
092d04291e Fix extraction progress: accumulate completed menus inside single message
Use getElementById for progressDiv/spinnerDiv inside an addMessage bubble
so completed lines persist as each menu finishes extracting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 00:53:02 -07:00
John Mizerek
af1e252f1b Add debug logging for platform image URL detection
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 00:39:40 -07:00
John Mizerek
5f2c9f4df9 Fix menu extraction progress: show each completed menu as persistent line
Previously each extraction step cleared the conversation and only showed
the latest result. Now completed menus accumulate as checkmarked lines
while the spinner updates in place for the current extraction.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 23:10:13 -07:00
John Mizerek
35f1f57f92 Fix toFixed crash when price is a string from PHP API
PHP returns prices as strings (e.g. "0.000000000"). Wrap in parseFloat()
before calling .toFixed(2) to prevent render crash.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 21:26:10 -07:00
John Mizerek
6a73752136 Fix empty categories disappearing in unified schema menu builder
The unified schema query used INNER JOIN to children, which excluded
categories with no items. Changed to direct query with NOT EXISTS
template filter so empty categories persist after save+reload.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 20:47:19 -07:00
John Mizerek
6d157b44f7 Add "Start from Scratch" option to setup wizard for new businesses
New users without an existing menu to import can now click "Start from Scratch"
to enter their business info and get redirected to the Menu Builder.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 20:35:47 -07:00
John Mizerek
2d1618dc1c Fetch food photos from ordering platform after menu extraction
- Pass platform URLs from discovery to extraction phase
- Call platform_images mode with stealth Playwright
- Fuzzy match platform images to extracted items by name
- Show progress during image fetching

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 20:22:15 -07:00
John Mizerek
baf0d5dfc9 Fix item ID mismatch dropping 200+ items at confirmation
- showItemsStep rendered per-category index as data-item-id
- confirmItems filtered by global index, causing massive mismatch
- Now assigns unique 'item_N' IDs to all items before rendering
- Also preserves menuName in category confirmation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 19:39:31 -07:00
John Mizerek
dc3cdf98a0 Debug menus array + preserve menuName in category confirmation
- Add console.log to showFinalStep for menus debugging
- Preserve menuName property when rebuilding categories in confirmCategories

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 19:15:42 -07:00
John Mizerek
5fb7710344 Capture per-menu schedules and compute business hours
- Store schedule per menu from Claude extraction
- Show schedule in progress messages
- Compute combined business hours from all menu schedules
- Display schedule summary in final result

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 17:45:12 -07:00
John Mizerek
bc1f8d4f4b Use discovered business info in multi-page extract flow
- Store businessInfo from discovery phase
- Pre-populate from JSON-LD/meta before sub-page extraction
- Only fill gaps from sub-page Claude responses

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 17:35:01 -07:00
John Mizerek
a181c1b90a Setup wizard: interactive menu discovery before extraction
- Phase 1: Quick scan shows detected menu pages with checkboxes
- User confirms which pages are actual menus
- Phase 2: Each page extracted individually through Claude
- Shows progress for each page being processed
- Falls back to single-page extract if no sub-pages found
- Optional extra URL field for manual addition

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 17:03:58 -07:00
John Mizerek
715d947e4b Strip country suffix before address parsing in wizard
Handles "United States/USA" at end of address string that
was blocking ZIP and state regex extraction.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 16:46:45 -07:00
John Mizerek
6862d97350 Show multi-menu UI when Claude detects separate menus
When the import detects multiple menus (Brunch, Lunch, Dinner, etc.),
shows checkboxes for each menu instead of a single menu name input.
Passes selectedMenus array to saveWizard for separate menu creation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 16:29:49 -07:00
John Mizerek
0578d7ed88 Switch quickTasks and scheduledTasks API refs from .cfm to .php
Portal and quick-tasks page now point to PHP API endpoints.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 15:57:32 -07:00
John Mizerek
98163f3842 Switch all API endpoint references from .cfm to .php
PHP API is now deployed on both dev and biz servers with PHP-FPM.
Admin endpoints (quickTasks, scheduledTasks) remain .cfm as they
haven't been ported yet.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 15:21:45 -07:00
John Mizerek
14f0662ba0 Fix 404s: revert premature .cfm → .php endpoint rename in portal/KDS/HUD
Another tab doing the PHP migration renamed all API endpoint references
from .cfm to .php, but the PHP endpoints aren't deployed yet. Reverted
all references back to .cfm so the wizard and portal work again.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 14:00:43 -07:00
John Mizerek
5985a3732f Fix timeout: strip HTML tags, bump Claude API timeout to 300s
Combined HTML from multiple sub-pages was too large. Now strips all HTML
tags and keeps only text content for Claude extraction. Also strips
nav/header/footer from sub-pages to remove duplication. Bumped Claude
API timeout from 120s to 300s. Updated wizard message to say 1-3 minutes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 13:53:31 -07:00
John Mizerek
37caa7c9bc Auto-detect ordering platform links for food photos
Playwright now follows menu sub-page links (brunch, lunch, dinner, etc.)
AND detects ordering platform links (order.online, toasttab, grubhub, etc.)
on restaurant websites. Visits ordering pages to scrape item-image pairs,
then fuzzy-matches them to menu items extracted from the main site.

This gives us complete menus from the restaurant's own website plus
food photos from their ordering platform — best of both worlds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 13:37:40 -07:00
John Mizerek
1d0e4ee616 Fix crash when Claude returns hours as object instead of string
parseHoursString expected a string but Claude AI sometimes returns
structured hours data as an object. Now normalizes to string first.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 13:01:22 -07:00
John Mizerek
977f2bf98e Clean up restaurant name and city from Toast/order.online imports
Strip common suffixes like "Order pickup and delivery" and embedded
street addresses from business names. Clean city field when it contains
state/zip/country (e.g. "Santa Monica, CA 90405, USA" → "Santa Monica").
Fixes applied in both CFML parser and JS frontend as safety net.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 12:43:39 -07:00
John Mizerek
28c0de9f09 Remove IsInvertedGroup feature from all APIs, KDS, and portal
Feature cancelled — modifier wording handles the use case instead.
Removes IsInvertedGroup from SELECTs, JSON responses, RemovedDefaults
computation, and KDS/portal display logic. DB column left in place.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 17:53:09 -07:00
John Mizerek
bace74aa23 Remove Uber Eats JSON-LD fast path — let Claude extract modifiers
The JSON-LD fast path only got items/categories/prices but no modifiers.
Removing it lets Uber Eats pages fall through to Claude AI extraction
which handles modifiers like every other platform.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 00:08:57 -07:00
John Mizerek
6cb0eefb5f Add ad blocker warning and platform labels to setup wizard
- Warning to disable ad blockers before saving pages for import
- Listed supported platforms with what each extracts (Toast, Grubhub,
  DoorDash, Uber Eats, and fallback AI extraction)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 19:28:51 -07:00
John Mizerek
01ac523f91 KDS: brighten order header, info, elapsed time, and quantity text
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 12:11:33 -07:00
John Mizerek
c00c4b08a2 KDS: brighten modifier, remark, and badge text for visibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 12:09:55 -07:00
John Mizerek
c5b1913e28 KDS: show modifier name only, drop parent group breadcrumb
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 12:07:29 -07:00
John Mizerek
657bd33849 Document modifier template system, virtual IDs, and clean API key names in CLAUDE.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 11:51:32 -07:00
John Mizerek
f5223e5636 Fix KDS: only show pointer cursor on items with modifiers
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 11:32:11 -07:00
John Mizerek
f64a321afd Add expandable modifiers to KDS order items
Modifiers and remarks are now collapsed by default with a count badge.
Tap to expand/collapse. Matches the Works Android behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 11:29:00 -07:00
John Mizerek
4a13bd7583 Remove Inverted Display toggle; fix template modifier name not saving
- Removed IsInvertedGroup toggle and badge from menu builder UI
- Fixed saveFromBuilder.cfm not updating Name for template modifiers
  (only selection rules were saved, name changes were silently lost)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 17:40:42 -07:00
John Mizerek
75de1ab999 Revert "Fix inverted modifier groups auto-adding unchecked defaults"
This reverts commit 8440888024.
2026-03-11 17:31:09 -07:00
John Mizerek
8440888024 Fix inverted modifier groups auto-adding unchecked defaults
attachDefaultChildren now detects IsInvertedGroup=1 on parent items
and skips auto-adding defaults. The Android client explicitly sends
only the modifiers the user kept checked, so auto-adding was
re-inserting items the user had unchecked (e.g., Mustard).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 17:15:25 -07:00
John Mizerek
a8257b2509 Fix inverted modifier groups in KDS
The inverted group header item isn't always an order line item itself,
so RemovedDefaults was never computed. Now detects inverted groups
via children's ParentIsInvertedGroup flag and attaches RemovedDefaults
to the first child as a proxy. KDS JS handles both patterns.

Also skips showing default modifiers from inverted groups since those
are represented by "NO removed-item" instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 17:06:18 -07:00
John Mizerek
c6767eb2c4 KDS: show all selected modifiers including defaults
Was filtering out IsCheckedByDefault modifiers, which hid all
toppings/options on orders where the customer kept the defaults
(e.g. Bay Cities sandwiches). Inverted groups still handled
separately with "NO" prefix for removed defaults.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 16:57:17 -07:00
John Mizerek
6c41dedd5d Bump business list limit from 20 to 50
23 businesses were being cut to 20 when sorted alphabetically (no location),
hiding Win~Dow Venice and other names near end of alphabet.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 14:32:52 -07:00
John Mizerek
5328fda65b Add DINE-IN badge to KDS order cards for consistency
Pickup and Delivery had colored badges but Dine-In did not. Added
blue DINE-IN badge matching the existing badge style.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 13:39:23 -07:00
John Mizerek
800471f249 KDS: show items with no station assignment in every station filter
Items with NULL StationID now appear in all station views instead of
being hidden when a specific station is selected.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 12:19:52 -07:00
John Mizerek
d80d4bd4c4 Reset KDS station filter on business change, add default Kitchen station
KDS was keeping the station filter from a previous business in
localStorage, causing orders to be hidden when switching businesses.
Now tracks businessId and resets station selection on change.

New businesses also get a default "Kitchen" station so the KDS works
out of the box.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 12:17:51 -07:00
John Mizerek
c79a750a50 Show full order total on receipt, payment method below
Grand total now always shows the actual order amount. Balance and
payment method shown as informational lines underneath instead of
subtracting balance from the total.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 12:08:18 -07:00
John Mizerek
acdb28a0d0 Fix receipt for balance-only payments and add tip display
Receipt was treating balance-only orders as card payments, adding
Stripe processing fees that inflated the total. Now checks
PaymentFromCreditCard to determine if card fees apply. Also adds
tip line and includes TipAmount in total calculation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 12:05:42 -07:00
John Mizerek
15e76c7170 Fix timezone display: append Z suffix to UTC dates in API responses
JS new Date() was parsing dates without Z as local time, showing UTC
values as-is. Adding Z suffix tells JS the dates are UTC so it converts
to the user's local timezone automatically.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 11:59:43 -07:00
John Mizerek
214c65adb2 Fix receipt page: Payments PK is PaymentID not ID
Payments table still uses old prefixed column names.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 11:51:25 -07:00
John Mizerek
bc52a0242f Fix saveOrderTypes: add X-Business-ID header for auth
Application.cfm requires request.BusinessID from session or header.
The fetch was only sending it in the POST body which the auth layer
doesn't read.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 20:28:17 -07:00
John Mizerek
b57cef8838 Guard saveOrderTypes against missing businessId
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 20:11:54 -07:00
John Mizerek
30e192e738 Fix saveOrderTypes: wrong method name and onchange firing during load
- showToast → toast (correct method name) across all settings methods
- Clear onchange before setting .checked to prevent save during load

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 20:07:44 -07:00
John Mizerek
d947685bbc Bump portal.js cache version to v14
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 19:52:51 -07:00