Commit Graph

129 Commits

Author SHA1 Message Date
pavlov346346-source
298b29cd52
Expose developer promo creation with three subscription plans (#39)
Load the missing promo module, add a prominent creation button and place Promos beside Overview. Use existing AAL2-guarded server RPCs with selected plan, subscription duration and code validity; preserve form input, honest clipboard feedback and scope async responses. Full PR QA succeeded in run 35547013076. No live data, SQL, MFA or unfinished training branch changes. Preserve normal main QA and exact-asset/browser publication verification.
2026-09-21 03:30:21 +03:00
pavlov346346-source
8b25918e30
Fix reopening incomplete developer MFA setup (#38)
Recover only unverified Caterium Developer TOTP factors from the full factor list. Preserve verified MFA, reuse the in-memory QR after closing the dialog, serialize enrollment and retain correct-code/AAL2 checks. Complete pull-request QA passed in run 35518429693. Standard main QA and publication gates remain unchanged.
2026-09-20 20:08:46 +03:00
pavlov346346-source
1e644e6dfb
Fix employee sync and expose mobile profile/logout (#37)
Keep notification-read state personal to user/company, preserve server read-only sections during staff synchronization, and respect separate order-create/edit/delete rights. Add visible mobile header session actions and a sticky logout that survives profile RPC failure; scope asynchronous profile/branding to user and workspace. Targeted browser suites and isolated SQL recovery tests passed in run 35506145405, iPhone screenshots reviewed. Full main QA remains required before production promotion. Workspace branding RPC migration is included but has NOT been applied to production Supabase; older servers retain safe owner-only fallback. No live membership/business-data repair is claimed without identifying the reported employee.
2026-09-20 13:55:56 +03:00
pavlov346346-source
bc3f186992
One-page banquet menu for the client (#36)
Add a single-page A4 preview and PDF for all selected banquet dishes or a ready-menu selection, with company branding and optional costs. Preserve draft/order state and saved line prices, enforce access and tenant scope, and fail clearly rather than clipping oversized menus. Nineteen targeted browser scenarios passed twice and the generated iPhone PDF was visually checked. Full main QA must pass before the existing automatic production promotion; production verification includes the new renderer and real-asset client menu export.
2026-09-20 12:54:42 +03:00
pavlov346346-source
eab678adbe fix: harden inline handlers against id injection, fix stale version label
Some checks failed
Caterium QA / qa (push) Has been cancelled
Inline handlers built as onclick="fn('${esc(id)}')" were injectable:
esc() turns ' into ', which the browser decodes back to ' before
the JS runs, so an id like x');alert(1);// broke out of the string.
Ids can come from a restored backup file or a synced catalog. Add
SunSafe.jsArg (JSON.stringify + HTML escape) and use it in all 23
handlers in app-runtime.js and index.html. Verified in a browser: a
payload id is passed through as a plain string and nothing executes.

Also replace the Settings version label that still showed
v17.6.0 · 2026.09.07, and bump the cache-busting version of the two
changed scripts (sun-safe.js, app-runtime.js).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-20 12:28:35 +03:00
pavlov346346-source
716a79c58d
Optional per-profile training catalog with reversible example visibility (#35)
Add Settings > Учебный каталог, off by default and available on ordinary writable profiles. Load ready example boxes, photos, TTKs and linked sample inventory additively; preserve own data, saved orders and edited examples when hiding or re-enabling. Respect company/profile scope, read-only permissions, failed downloads and tenant changes. Preserve the opened recipe guide across real catalog refreshes on iPhone. Integrated feature checks and full pull-request QA passed. Standard main QA and exact-asset production UI verification remain in place.
2026-09-20 12:18:40 +03:00
pavlov346346-source
5ce7d8d353
Mobile menu editor above boxes with a matching return arrow (#34)
On phones place the existing menu editor above the catalog and add the same return-to-top control used by New Order. Preserve form nodes, unsaved values and active input focus; keep desktop/tablet layout and read-only permissions. Full QA passed, including iPhone WebKit and existing promotion focus regression. Extend real-asset production verification with a backend-blocked mobile-menu scenario.
2026-09-19 20:02:43 +03:00
pavlov346346-source
ee70c66ed8
Fix iPhone offer template flicker (#33)
Avoid rebuilding the offer template picker during the five-second maintenance pass unless the selected template or template list actually changed. Includes a regression test for repeated maintenance cycles.
2026-09-19 19:28:57 +03:00
pavlo
d7d6f6ff38 Add AI support assistant to the Help dialog
The Поддержка tab opens an assistant that answers how-to questions from
the handbook. The chat is a sandboxed iframe on the assistant's own
origin and is only loaded after an explicit click, so Help and its search
stay local and no third-party script runs inside the app.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-19 18:27:47 +03:00
pavlov346346-source
424bf8ce87
Compact clients and explicit timed menu promotions (#31)
Add compact accessible client summaries and menu discounts in percent or rubles with explicit durations. Preserve ordinary catalog prices and order line snapshots; derive current prices and expire promotions automatically without background writes. Keep fractional prices, legacy sale compatibility, and regression coverage. Full pull-request QA passed. Publication remains gated by full main QA and byte-for-byte production asset and UI verification.
2026-09-19 09:34:50 +03:00
pavlov346346-source
15ab908836
Match Help icon to native sidebar styling (#30)
Add a question-circle SVG mask to Help using the existing sidebar pseudo-element. Preserve shared icon geometry, theme colors and navigation behavior. Add full-app icon regression and correct the previous loading-recovery fixture. Production promotion remains gated by full main QA.
2026-09-19 07:52:30 +03:00
pavlov346346-source
b2bcb0f4db
Make workspace loading a calm progress-only screen (#29)
* Make workspace loading a calm progress-only screen

* Cover quiet workspace loading and error recovery on desktop and mobile

* Run workspace loading regressions in desktop, mobile and WebKit QA
2026-09-19 06:57:27 +03:00
pavlov346346-source
4f518b3663 Stabilize settings updates, auth gates and modal lifecycle 2026-09-18 21:15:26 +03:00
pavlov346346-source
47ae8df39c Remove device PIN and fit calendar to mobile screens 2026-09-18 20:43:09 +03:00
pavlov346346-source
45e77958cb Remove Map from the sidebar navigation 2026-09-18 20:27:24 +03:00
pavlov346346-source
be0fd9aee7 Hide completed import catalog entries without losing order history 2026-09-18 20:17:30 +03:00
pavlov346346-source
11e7b4bd56 Refine six client proposal layouts and transparent company logos 2026-09-18 19:55:04 +03:00
pavlov346346-source
cdb43c1653 Preserve JSON content negotiation through both proxy routes 2026-09-18 19:25:00 +03:00
pavlov346346-source
7807bf4f8f Poll workspace revision through the authorized state RPC 2026-09-18 19:17:03 +03:00
pavlov346346-source
71bc56b0cd Route cloud access through Caterium and vendor login SDK 2026-09-18 19:07:47 +03:00
pavlov346346-source
ff7fe90ccf Add searchable user guide and support area with future assistant design 2026-09-18 18:43:27 +03:00
pavlov346346-source
09bfb0fed8 Fix Safari login request bodies and raw storage uploads 2026-09-18 18:13:00 +03:00
pavlov346346-source
4d4cca2e32 Respect confirmed payment for imported orders with unknown totals 2026-09-18 16:29:44 +03:00
pavlov346346-source
f628a4a27e Remove empty mobile order gap above payment fields 2026-09-18 10:43:08 +03:00
pavlov346346-source
66decb03a5 Show mobile order totals above catalog and add return-to-top button 2026-09-18 10:36:06 +03:00
pavlov346346-source
dac1a1de72 Fill empty trial tabs with premium, drinks, tableware, extras and delivery 2026-09-18 08:26:21 +03:00
pavlov346346-source
18ff2b9c30 Add 18 trial banquet dishes with portion TTKs and additive stock seed 2026-09-18 08:11:32 +03:00
pavlov346346-source
4fe984b584 fix: remove legacy login flash during session restoration 2026-09-18 05:48:20 +03:00
pavlov346346-source
6472dba7ee fix: bound proposal loading and preserve per-order preview 2026-09-18 05:31:15 +03:00
pavlov346346-source
44d6ec9e81 Cache optimized trial photos for legacy URLs in the installed app 2026-09-18 04:59:16 +03:00
pavlov346346-source
6067c3f570 Fix transient cloud sync timeouts and optimize trial photos 2026-09-18 04:51:29 +03:00
pavlov346346-source
7e5c7c1908 Restore distinct proposal designs and improve PDF typography and pagination 2026-09-18 04:05:36 +03:00
pavlov346346-source
9539374c88 Add isolated trial demo boxes with TTK, stock and purchasing scenario 2026-09-18 03:24:43 +03:00
pavlov346346-source
d4e02cab8b Recover login from empty API responses with one authenticated session 2026-09-18 02:39:30 +03:00
pavlov346346-source
1ae56fb57b Fit nine calendar orders per day and preserve all printed events 2026-09-17 21:25:25 +03:00
pavlov346346-source
2d49563b9d Add banquet packages, dish sections and guest totals 2026-09-17 21:07:54 +03:00
pavlov346346-source
57f5807953 Require account login and isolate all company client caches 2026-09-17 20:40:24 +03:00
pavlov346346-source
c18c49770d Start new companies with empty private catalogs 2026-09-17 20:27:07 +03:00
pavlov346346-source
48ffa51748 Preserve imported order history and saved order pricing 2026-09-17 20:15:32 +03:00
pavlov346346-source
11b2bf84c9 Separate account sidebar identity from company document branding 2026-09-17 19:51:01 +03:00
pavlov346346-source
c31f868c83 Apply saved theme before first paint and prevent startup flicker 2026-09-17 19:16:19 +03:00
pavlov346346-source
da8ff042f7 Restore Caterium schema and switch production to fresh Supabase 2026-09-17 17:30:57 +03:00
pavlov346346-source
2f7b8b9ea9 feat: add banquet menu constructor tab
Add a new "Банкетное меню" catalog tab (category 6) alongside Боксы/
Премиум/Посуда for composing wedding/banquet/anniversary menus. Unlike
the other tabs, dishes here are priced and weighed per guest, grouped
by menu section (catalogSection), and clicking a checkbox doesn't add
to the order directly -- it toggles inclusion in a live summary panel
showing a running per-guest price table for the whole composed menu.

The item editor gets two new fields (menu section, weight per guest)
shown only for this category, reusing the existing generic item CRUD
(editBox/saveBox) rather than building a parallel admin UI.

Also re-bumped index.html's script cache-busting query string, which
the previous whitelist-fix commit changed the content of app-runtime.js
without updating -- the same stale-cache bug fixed earlier in the
session, now closed for directly-tagged scripts too.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 18:02:02 +03:00
pavlov346346-source
7446a551f6 fix: allow premium-dark/premium-emerald in template id whitelists
Two separate Set-based whitelists (OFFER_TEMPLATE_IDS in app-runtime.js
and TEMPLATE_IDS in ux-fixes-v1764.js) validated any explicit template
selection before persisting/rendering it, but neither had been updated
when premium-dark/premium-emerald were added. The per-order "Оформление
PDF" picker's click handler calls persistOfferTemplate(), which silently
returned false when the id failed this check -- so clicking either
premium card in an order's offer modal did nothing, no error, no toast.
Verified end-to-end against a real order: both ids now persist and the
picker shows the selected state correctly.

Also bumped performance.js's internal RELEASE tag, since it gates the
cache-busting query string used to dynamically load ux-fixes-v1764.js
and eight other core modules -- otherwise this fix would hit the same
stale-cache issue just fixed in index.html.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 13:46:15 +03:00
pavlov346346-source
5ead4a7f0c feat: add visual heading to midnight-checklist menu section
Replace the plain white "МЕНЮ" text label with a gold icon badge,
item count, and divider line, matching the icon-badge language already
used elsewhere in the template instead of a bare heading.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 13:36:09 +03:00
pavlov346346-source
37a8dd5bb3 fix: bump stale cache-busting version on core script tags
The signature-offer-pdf-v18.js script tag's ?v= query string was never
updated across ~9 content commits since the file was created, so browsers
kept serving a stale cached copy indefinitely. All other script/style tags
shared an equally stale v17.7.3 tag. Bumped every tag in index.html to a
single fresh version string so all recent fixes (template selection,
merged addon card, controlLines/extraServices wiring) actually reach users
without a manual hard refresh.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 13:33:41 +03:00
pavlov346346-source
14e3d6b45b fix: merge addon pills into one card, wire it to editable Settings
Two related fixes reported directly against live screenshots:

1. addonRow rendered each addon ("Напитки", "Чайная станция", ...) as
   its own tall bordered pill sitting side by side -- disjointed, and
   unlike the single-card "Полезные дополнения" treatment in the
   referenced design. Now draws one card with a heading
   ("Рекомендуем добавить") containing all the icon+label items,
   matching how checklistCard already works.

2. The addon list and the "Всё под контролем" checklist were hardcoded
   constants in the canvas module, completely bypassing the app's
   existing editable Client Offer Settings (Настройки → Предложение →
   "Дополнительно к заказу", textarea-backed extraServices/controlLines
   the user can already edit for the old templates). preparedSnapshot
   now attaches the resolved controlLines/extraServices/titles onto
   every snapshot; the 8 signature templates read them via a local
   shadowing const (falls back to the previous defaults when nothing
   is configured), so editing that Settings textarea now actually
   changes what shows up in these templates too, on all 8 of them from
   one change since addonRow/checklistCard are shared helpers.

Verified locally: default list (6 items) lays out cleanly in one card
with 2-line wrapping where needed; a snapshot with custom
controlLines/extraServices renders those exact custom strings instead
of the defaults, confirming the wiring actually works end to end and
isn't just falling back silently.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 11:28:18 +03:00
pavlov346346-source
44bf5e9af1 feat: add 2 new templates modeled on the referenced menu.furset.ru design
User pointed at https://menu.furset.ru/view/23855347 as a design they
like and asked for a couple more templates in that direction. Added:

- premium-dark: near-black background, warm gold accents, real
  line-drawn icon badges (calendar/people/box -- not emoji) for the
  date/guests/boxes stats, bullet-point value props under the title,
  minimal flat menu list -- closely matching that reference's visual
  language instead of the card-heavy style of the existing templates.
- premium-emerald: the same layout in an emerald-green palette, as
  the second "couple" of designs requested, sharing the cover code
  with premium-dark and only differing by PALETTES entry.

Both plug into the existing shared renderContentPages engine, so they
get proper multi-page menu + pricing pages for free, consistent with
all 6 existing signature templates. New icon-drawing helpers
(iconBadge/iconCalendar/iconPeople/iconGauge/iconBox, statBadgeRow,
bulletList) live in the shared helper section for reuse.

Verified locally: both render in <70ms combined, produce 3 pages each
for a normal order, and hold up under the same adversarial-data pass
used for the other 6 (long names, 350 guests, seven-figure price,
item with no photo/price/category) -- no overlap, no crashes, generous
ellipsis truncation throughout. Fixed one real bug found while
testing: the date value in the stat badge ("8 августа 2026 г.") was
getting ellipsis-truncated at font-size 20px; reduced to 16px so it
fits cleanly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 11:11:43 +03:00
pavlov346346-source
28fd97bcf3 fix: replace gourmet-hero's fake category tabs with real ones
Same issue as the cards just removed from cream-elegance: a hardcoded
['РЫБНЫЕ','МЯСНЫЕ','ВЕГЕТАРИАНСКИЕ','САЛАТЫ','ДЕСЕРТЫ'] tab row that
had nothing to do with what was actually in the order (an order with
zero vegetarian items still showed a "ВЕГЕТАРИАНСКИЕ" tab as if
active/relevant). Now derives the chip row from the distinct
categoryName values actually present on the order's items, and
renders nothing if that data isn't available.

Verified this pass end-to-end rather than just by inspection:
- Real "Скачать PDF" pipeline (sunClientOfferDebugPdf) produces a
  valid application/pdf blob with a correct %PDF-1.4 header, not just
  canvases.
- Confirmed Canvas text genuinely falls back through the font stack
  (measured identical metrics for an unregistered font vs. Georgia
  directly, and document.fonts.load() resolves instantly for a
  never-registered family) -- so a blocked/unreachable Google Fonts
  degrades silently to Georgia/Arial instead of hanging or erroring,
  which matters given this app already had to work around Russia
  connectivity issues elsewhere.
- Re-rendered all 6 templates against deliberately adversarial data
  (150+ word event name, 44-char client name, 350 guests, a
  million-ruble price, an item with no photo/price/category, a long
  promo code) -- no crashes, no overlap, graceful ellipsis truncation
  throughout.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 10:57:29 +03:00
pavlov346346-source
b702b4b69e fix: remove static category cards from cream-elegance cover
They were hardcoded labels (Рыбные закуски / Мясные закуски / Для
вегетарианцев / Мини-салаты) with a generic "Собрано под ваше
событие" caption that didn't reflect the actual order — confusing and
requested to be removed. The freed space now goes to a bigger 3x2
photo grid of the order's real items instead of leaving a gap.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 10:41:10 +03:00