Commit graph

162 commits

Author SHA1 Message Date
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
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
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
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
John Mizerek
87eb5fa1f0 Fix takeaway/pickup toggle not saving in Firefox
Wire onchange listener via JS instead of inline attribute,
matching the hiring toggle pattern. The zero-sized hidden
checkbox wasn't firing inline onchange reliably.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 18:07:54 -07:00
John Mizerek
dfe2313ec5 Add eyedropper color picker to brand color modal
Uses the native EyeDropper API (Chrome/Edge) to pick colors from
anywhere on screen. Button only shows in supported browsers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 17:29:42 -07:00
John Mizerek
717d60d6e6 Add IsInvertedGroup support for modifier groups
When enabled on a modifier group, KDS and cart only show removed
defaults (e.g., "NO Mustard") instead of listing all selected items.
Useful for groups where all options are checked by default.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 18:14:19 -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
6cdbff129f Add takeaway/pickup order support
- getOrCreateCart: only require ServicePointID for dine-in (OrderTypeID=1)
- get.cfm + items.cfm: return OrderTypes from Businesses table
- saveOrderTypes.cfm: new endpoint to save business order type config
- KDS: add PICKUP/DELIVERY badges on order cards
- Portal: add Order Types toggle card in settings (Dine-In always on, Takeaway toggle)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 10:45:06 -07:00
John Mizerek
8921b55c57 Fix header image preview to show full image with correct aspect ratio
Changed from cover/fixed-height to contain/aspect-ratio 3:1 so the
full 1200x400 header image is visible without cropping.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 15:10:12 -08: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
771f70f2f3 Add BrandColorLight to portal settings page
Updated the portal settings brand color picker to show both dark
and light colors. Light swatch shown alongside dark swatch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 15:09:30 -08:00
John Mizerek
3bd7585383 Add BrandColorLight for subtle card tinting in menu builder
New BrandColorLight column on Businesses table. Menu builder cards
(categories, subcategories, items) get a very subtle tint from the
light brand color. White when no color is set. Brand color picker
now has both dark and light fields.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 14:48:11 -08:00
John Mizerek
9c09e18833 Add sidebar navigation to station-assignment page
Station assignment was a standalone page with no sidebar. Added the
same portal sidebar so users can navigate between pages. Also added
Stations link to menu-builder sidebar.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 20:57:18 -08:00
John Mizerek
2d3634693b Add Show Modifiers toggle to menu builder outline view
Adds button in the outline modal to toggle modifier group display
under each item. Each group shows a + to expand into full options
with prices. Useful for debugging modifier assignments.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 19:57:22 -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
49e3c812c9 Fix field name mismatch in station-assignment page
API returns Name, Price, ParentItemID, CategoryID, StationID but JS
was referencing ItemName, ItemPrice, ItemParentItemID, etc. causing
all items to be filtered out and not displayed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 17:03:45 -08:00
John Mizerek
7205962873 Add Stations link to portal sidebar navigation
Links to station-assignment.html, placed after Menu link.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 16:48:00 -08:00
John Mizerek
f5ff9cdfeb Add station CRUD endpoints and wire into portal UI
New endpoints: save.cfm (combined add/update) and delete.cfm
(soft-delete with item unassignment). Registered in Application.cfm.

Portal station-assignment page now uses real API calls for add,
edit, and delete instead of client-side-only prompt(). Fixed key
naming mismatch (StationName/StationColor → Name/Color) so the
page works with real API data. Removed hardcoded demo fallbacks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 16:26:45 -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
dc5148d1b8 Fix properties panel viewport overflow
Constrain main-content to 100vh and builder-wrapper to flex: 1
so the height chain propagates correctly and the properties panel
scrolls within the viewport instead of extending off screen.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 22:25:08 -08:00
John Mizerek
195c7d8b3b Fix properties panel overflow and make header sticky
Properties panel was extending off screen due to missing min-height: 0
on flex containers. Made Properties header sticky so it floats as you
scroll through long modifier lists.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 22:22:53 -08:00
John Mizerek
2bcdcbbed7 Fix subcategory expand/collapse in visual menu editor
Subcategories shared expandedCategoryId with parent categories,
so clicking a subcategory collapsed the parent. Added separate
expandedSubCategoryId state so subcategories expand independently.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 21:58:20 -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
3ccc82c9f2 Add subcategory support (2 levels deep)
- saveCategory.cfm: Accept ParentCategoryID, enforce max 2-level nesting
- items.cfm: Include ParentCategoryID on virtual category rows for Android
- getForBuilder.cfm: Return ParentCategoryID in builder API response
- saveFromBuilder.cfm: Persist ParentCategoryID on save, track JS-to-DB id mapping
- saveWizard.cfm: Two-pass category creation (parents first, then subcategories)
- menu-builder.html: Parent category dropdown in properties, visual nesting in canvas,
  add subcategory button, renderItemCard() extracted for reuse

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 21:29:40 -08:00
John Mizerek
d1910a7d34 Add staff role system: Staff keeps cash, Manager/Admin collect for restaurant
- Create tt_StaffRoles lookup table (Staff, Manager, Admin)
- Add RoleID column to Employees table (default: Staff)
- Wire portal role dropdown to addTeamMember API
- Return RoleName in team list and RoleID to Android
- Skip worker payout ledger and cash_debit for Manager/Admin roles
  on cash task completion (they collect on behalf of the restaurant)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 11:19:22 -08:00
John Mizerek
4c0479db5c Add Open Tabs feature: tab APIs, presence tracking, shared tabs, cron, portal settings
- New api/tabs/ directory with 13 endpoints: open, close, cancel, get, getActive,
  addOrder, increaseAuth, addMember, removeMember, getPresence, approveOrder,
  rejectOrder, pendingOrders
- New api/presence/heartbeat.cfm for beacon-based user presence tracking
- New cron/expireTabs.cfm for idle tab expiry and presence cleanup
- Modified submit.cfm for tab-aware order submission (skip payment, update running total)
- Modified getOrCreateCart.cfm to auto-detect active tab and set TabID on new carts
- Modified webhook.cfm to handle tab capture events (metadata type=tab_close)
- Modified businesses/get.cfm and updateTabs.cfm with new tab config columns
- Updated portal tab settings UI with auth amounts, max members, approval toggle
- Added tab and presence endpoints to Application.cfm public allowlist

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 20:56:07 -08:00
John Mizerek
0e603b6cc9 Fix refresh button: add inline onclick and center icon
The addEventListener wasn't firing (likely cached JS). Added inline
onclick as reliable fallback and flexbox centering for the SVG icon.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-24 12:51:02 -08:00
John Mizerek
194eb4d205 Fix beacon Minor 0 not displaying in service points page
b.Minor is 0 for the first beacon which is falsy in JS.
Changed to null check so Minor: 0 displays correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-24 12:47:20 -08:00
John Mizerek
57ef40f737 Add click handler for refresh button in portal
The refresh button in the top bar had no click handler attached.
Now it reloads the current page data when clicked.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-23 14:13:47 -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