Commit graph

66 commits

Author SHA1 Message Date
John Mizerek
fc43d2af9c Revert auto header image discovery — header is manual upload only
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 09:46:24 -07:00
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
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
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
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
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
49d724f9b2 Add Uber Eats menu import and fix header image upload step
- Parse JSON-LD structured menu data from saved Uber Eats pages
  (categories, items, prices, descriptions, business info)
- Show save-and-upload instructions when user pastes Uber Eats URL
- Always show header image upload step (was skipped for URL imports)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 11:59:40 -07:00
John Mizerek
1568686ff1 Add BrandColorLight to menu API and setup wizard
- items.cfm: return BrandColorLight in menu response
- saveWizard.cfm: save BrandColorLight during business creation
- setup-wizard.html: second color picker for light brand color

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 19:24:45 -08:00
John Mizerek
9000fc91fe Fix Show Modifiers button not rendering in template literal
Move the conditional out of the nested template literal to avoid
parsing issues with arrow functions inside backtick strings. Also
skip empty mod-groups divs on items without modifiers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 19:53:44 -08:00
John Mizerek
a67d225164 Add Show Modifiers toggle to items step in setup wizard
Outline button reveals modifier groups under each item with a +
expand button to drill into individual options and prices. Helps
debug imported menus before saving.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 19:50:46 -08:00
John Mizerek
0bb2707904 Skip header image step when no auto-detected header
For URL imports (Toast, Grubhub, etc.) there's no header image
to show, so skip straight from business info to categories
instead of showing an empty "Choose Image / Skip" prompt.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 16:39:46 -08:00
John Mizerek
1956dd08e9 Add noon/midnight clarification note above hours table
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 10:38:46 -08:00
John Mizerek
ffedc26150 Add subcategories stat row to menu summary card in setup wizard
Shows subcategory count as a separate indented row beneath categories
when subcategories are present.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:37:27 -08:00
John Mizerek
3c0311c1d5 Fix header image preview aspect ratio in setup wizard
Changed from fixed 120px height to aspect-ratio 3:1 to match the
recommended 1200x400 dimensions, preventing heavy cropping.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 10:36:00 -08:00
John Mizerek
495b03c76d Add subcategory detection to wizard URL analyzer and display
- analyzeMenuUrl.cfm: Detect subcategories from Toast subgroups and
  Claude API responses, preserve hierarchy with parentCategoryName
- setup-wizard.html: Display subcategories indented under parents
  throughout wizard flow (categories step, items review, summary, preview)
- menu-builder.html: Show subcategories nested in outline modal view

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 22:08:59 -08:00
John Mizerek
e8705287cc Fix JS syntax error: remove escaped backticks in addModifierOption
The escaped backticks (\`) were causing "invalid escape sequence" error,
breaking the entire script and making the Upload Files button non-functional.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-20 16:34:31 -08:00
John Mizerek
b360284e56 Beacon delete fix, price extraction, tax rate lookup, add modifiers form 2026-02-14 19:17:48 -08:00
John Mizerek
76f089d1b9 Auto-populate tax rate from ZIP code using API Ninjas
When business info step loads with a ZIP code, automatically looks up
the combined sales tax rate and pre-fills the field. User can still
edit if needed. Field gets light green background to indicate auto-fill.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 11:52:56 -08:00
John Mizerek
fb21b0c58d Add debug logging to showItemsStep and confirmItems 2026-02-13 09:41:35 -08:00
John Mizerek
682cb41ff1 Fix: Handle items with unmatched categories in showItemsStep
Items were being grouped only by known categories. If the category
array was empty or didn't include an item's category, those items
never got checkboxes rendered, causing confirmItems() to filter
them all out.

Now collects unassigned items and groups them by their category
name (or 'Menu' as fallback).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 09:38:53 -08:00
John Mizerek
157749060e Add debug logging and fix protocol-relative URL check
Log sample imageUrls to console to debug why upload step is shown.
Also handle protocol-relative URLs (//domain.com/...).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 09:02:32 -08:00
John Mizerek
91c34d120f Skip image upload step when items have remote image URLs
Items from Toast menus have CDN URLs (https://img.cdn4dd.com/...) which
saveWizard.cfm will download automatically. No need to prompt user
to upload images when remote URLs are already present.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 09:01:32 -08:00
John Mizerek
5cde8ce4fa ZIP upload: add file sanitization, direct file read, and temp cleanup
- uploadSavedPage.cfm: sanitize extracted files (whitelist safe extensions,
  delete symlinks) to protect against malicious content from infected sites
- analyzeMenuUrl.cfm: detect local temp URLs and read directly from disk,
  bypassing Playwright for faster processing of saved pages
- saveWizard.cfm: delete temp folder immediately after wizard completes
  instead of waiting for 1-hour auto-cleanup
- setup-wizard.html: track temp folder ID and pass to saveWizard for cleanup

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 08:02:41 -08:00
John Mizerek
3df4659830 Add debug logging for ZIP upload response
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 07:11:43 -08:00
John Mizerek
8aeca335fd Add ZIP upload for saved webpage import
For Cloudflare-protected sites, users can now:
1. Save the page from their browser (Webpage, Complete)
2. ZIP the HTML and assets folder
3. Upload the ZIP in the wizard
4. Server extracts to temp folder, Playwright scans local copy

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-13 07:02:51 -08:00
John Mizerek
f8afbb57e9 Add bulk item image upload: accept all sizes, pick best, upload after save 2026-02-12 20:56:27 -08:00
John Mizerek
04f65e3495 Fix image matching to use Toast item ID from filename, not alt text 2026-02-12 20:51:37 -08:00
John Mizerek
f882e84704 Add image type breakdown to setup wizard summary 2026-02-12 20:44:42 -08:00
John Mizerek
1a7c342ac9 Remove manual image upload step - use automatic matching 2026-02-12 20:36:43 -08:00
John Mizerek
112f343ecf Fix wizard: header preview uses cover, add image matching step after HTML import 2026-02-12 20:31:29 -08:00
John Mizerek
813628cecb Add HTML file upload option for menu import
- Backend now accepts either url or html content in request body
- Frontend adds HTML file upload option below URL input
- Useful when websites block the crawler (403 errors)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 17:13:32 -08:00
John Mizerek
f6518932db Add URL-based menu import to setup wizard 2026-02-12 16:43:37 -08:00
John Mizerek
800d1f1246 Add brand color extraction and auto-header detection to setup wizard 2026-02-12 14:20:35 -08:00