Commit graph

132 commits

Author SHA1 Message Date
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
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
40c91c82cf Fix add new business link to point to setup-wizard.html
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 21:12:02 -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
John Mizerek
0d04ae8463 Resolve merge conflict in myBusinesses.cfm - keep ActiveTaskCount 2026-02-11 22:33:44 -08:00
John Mizerek
48bdbb362e Remove task categories from portal, fix HUD color logic
- Remove Task Categories section from Task Admin page (deprecated)
- Simplify HUD getCategoryColor() to use TaskTypeColor directly

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-08 19:04:25 -08:00
John Mizerek
a318b8668f Fix cart/tax issues and add menu item thumbnails
- uploadItemPhoto: Add EXIF orientation fix, generate thumb/medium/full sizes
- getActiveCart: Disable old cart lookup (always returns no cart)
- getOrCreateCart: Always create fresh cart instead of reusing old ones
- getCart: Add IsDeleted filter, calculate subtotal/tax/total server-side
- getDetail: Remove default 8.25% tax rate (business must configure)
- menu-builder: Add lightbox for full-size images, use thumbnail URLs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-08 14:22:54 -08:00
John Mizerek
946c2ebdf0 Add modal-based photo upload for better mobile support
- Show a modal with file input and preview
- Uses alert() instead of toast for error messages (more visible on mobile)
- Preview shows selected image before upload
- Submit button with loading state
- Keeps old uploadPhoto function for compatibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-08 13:08:24 -08:00
John Mizerek
cab561a20e Fix photo upload on mobile - prevent page reload issue
- Use persistent file input instead of dynamically created one
- Store pending upload info in sessionStorage for mobile camera flow
- Use simpler accept="image/*" for better mobile compatibility
- Handle case where page context is lost after camera returns

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-08 13:06:47 -08:00
John Mizerek
9fc984bea3 Fix photo upload on mobile devices
- Add HEIC/HEIF support for iPhone camera photos
- Make frontend file type validation more permissive for mobile browsers
- Add 'capture' attribute to prefer rear camera on mobile
- Include actual file extension in error messages for debugging

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-08 12:56:50 -08:00
John Mizerek
3d59a2e5cd Fix service point delete using wrong ID field
The API returns ServicePointID but portal.js was using sp.ID which was undefined.
Changed all sp.ID references to sp.ServicePointID.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 17:32:43 -08:00
John Mizerek
2023e1b5d9 Setup wizard and tasks updates
- Setup wizard save improvements
- Call server task updates
- Task creation changes
- Portal JS updates

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 15:18:01 -08:00
John Mizerek
930394b421 Fix signup to redirect to login for business selection
Instead of auto-selecting first business, redirect to login.html
which shows the business selection dropdown for users with multiple businesses.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 14:16:43 -08:00
John Mizerek
87ff082279 Fix header preview background to white
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 20:15:20 -08:00
John Mizerek
31a89018f5 Launch prep: fix menu builder, payment flow, comment out pre-launch features
- Fix menu builder dropdown showing empty names (return MenuName instead of Name)
- Add default menu selection (setDefault action, DefaultMenuID in getForBuilder)
- Fix createPaymentIntent column names for dev schema (ID, StripeAccountID, etc.)
- Fix menu-builder favicon and remove redundant business label
- Comment out Tabs/Running Checks feature for launch (HTML + JS)
- Comment out Service Point Marketing/Grants feature for launch (HTML + JS)
- Add testMarkPaid.cfm for testing orders without Stripe webhooks
- Task API updates for worker payout ledger integration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 10:18:33 -08:00
John Mizerek
d7632c5d35 Menu builder and portal updates
- Menu builder UI improvements
- Portal CSS and JS updates
- Station assignment updates
- Add business tabs update endpoint

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 17:08:54 -08:00
John
16a3b7c9a3 Replace queryExecute with queryTimed across all endpoints for perf tracking
Converts 200+ endpoint files to use queryTimed() wrapper which tracks
DB query count and execution time. Restores perf dashboard files that
were accidentally moved to _scripts/. Includes portal UI updates.
2026-02-02 00:28:37 -08:00