Commit Graph

60 Commits

Author SHA1 Message Date
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
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
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
pavlov346346-source
d78ca14baf feat: bring the other 4 signature templates up to the same quality bar
- Fix the price band on cream-elegance: it was a solid muddy olive
  fill that didn't read as "this is your total" (reported directly by
  the user). It's now a white card with a gold border, matching the
  rest of that template's light card language; the dark templates'
  solid-fill price band is unchanged since that already reads well
  against a dark background.
- Give emerald-circles, midnight-checklist, gourmet-hero and
  diamond-gold the same treatment as the first 2: real fonts
  (Playfair Display/Montserrat or Unbounded/Manrope depending on
  aesthetic) instead of Arial/Georgia, the same center-alignment fixes
  applied everywhere text used align:'center', and their own
  fully-styled inner pages (menu + pricing) via the shared
  renderContentPages engine instead of the old generic base renderer.
- Fix two real regressions the font swap introduced and caught by
  rendering each template locally: gourmet-hero's headline was
  overflowing width and getting ellipsis-truncated ("КЕЙТЕРИНГ..."),
  and diamond-gold's heading was wrapping to a second line that
  collided with the subtitle below it. Both fixed with size/width
  adjustments verified by direct canvas measurement.
- All 6 signature templates are selectable in Settings again.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 10:14:25 +03:00
pavlov346346-source
51e2fa4c33 feat: give cream-elegance and neon-menu their own matching inner pages
The cover for these 2 templates was fully custom, but the item-list
and pricing pages behind it still came from the old generic base
renderer (Arial, different card style, different page chrome) — so a
downloaded offer read as a nice cover stapled to a plain, differently
styled document ("два предложения").

Both templates now render their own item-list pages (photo, name,
category/weight, qty and line total, paginated ~10 rows/page) and a
matching pricing-breakdown page (base cost, discount, promo, delivery,
total, per-guest), using the same fonts, palette and card language as
the cover, with a shared footer/page-number treatment across every
page. The other 4 signature templates and the 13 classic ones are
untouched and keep using the original base renderer.

Verified locally: 8 items -> 3 pages (cover + 1 menu + pricing),
15 items -> 4 pages (cover + 2 menu + pricing), 0 items -> 3 pages,
no errors, base renderer confirmed never invoked for these 2 ids.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 09:58:07 +03:00
pavlov346346-source
c0bb18d5f7 fix: polish the 2 kept offer templates — alignment, fonts, gallery
- Fix a systemic centering bug: several canvas text() calls used
  align:'center' but passed the box's left edge as x instead of its
  midpoint, so headings, badge numbers, checkmarks and chip labels
  rendered pinned to the left instead of centered (most visible on
  cream-elegance's "МЕНЮ" heading and neon-menu's guest badge).
- Fix cream-elegance's category icons: the emoji glyph was never
  actually passed into iconCircle, so the icon circles rendered empty.
- Even out cream-elegance's bottom row (stat cards vs price band had
  mismatched heights).
- Load distinctive Cyrillic-friendly type pairs instead of default
  Arial/Georgia: Playfair Display + Montserrat for cream-elegance,
  Unbounded + Manrope for neon-menu, awaited via the Font Loading API
  before each render so text never draws in the fallback face.
- Narrow the Settings gallery to just these two templates per request
  ("остановимся на 2х пдф пока"); the other 4 signature designs and
  the original 13 classic templates stay intact and renderable for any
  order that already used one, just not offered for new ones.

Verified via a local static server (public/, http-server) with a real
uploaded box photo run through window.SunSignatureOfferPDFV18 and the
production sunClientOfferDebugPdfPages pipeline directly — 3 pages,
no duplicate cover, both fonts confirmed loaded via document.fonts.check.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 08:49:39 +03:00
pavlov346346-source
90482d0e7d fix: stop signature PDF pages from double-rendering a cover
renderOfferPdfPages routed the signature templates' inner pages back
through the classic module's own renderPages, which drew its own
extra cover page on top of the real content pages -- doubling the
render work and producing an extra page. Route straight to the plain
base renderer instead. Also await the gourmet-hero template's photo
cards instead of firing them off unawaited.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-15 18:42:32 +03:00
pavlov346346-source
b92b52e03e feat: add 6 new client-offer PDF templates, archive the old 13
New "signature" template pack (cream-elegance, neon-menu,
emerald-circles, midnight-checklist, gourmet-hero, diamond-gold)
replaces the visible template gallery in Settings. The previous 13
classic/archive templates keep rendering correctly for any existing
order that already used one, but are no longer selectable for new
orders — nothing was deleted.

Also adds a Settings option to upload a custom logo and company name
for PDF documents, replacing the hardcoded "Солнце Кейтеринг" branding
wherever a logo fails to load.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-15 18:27:23 +03:00
pavlov346346-source
79b470d03f fix: fall back to direct Supabase auth on proxy 500 2026-09-14 17:26:32 +03:00
pavlov346346-source
5b827b4e09 fix: reopen app after persisted login session 2026-09-14 16:57:45 +03:00
pavlov346346-source
77485cafca fix: keep promo onboarding server-authoritative 2026-09-14 12:23:00 +03:00
pavlov346346-source
9d38b5550b Fix company owner and employee onboarding 2026-09-14 10:57:28 +03:00
pavlov346346-source
afb502c345 feat: add trial promo management to developer console 2026-09-13 18:44:18 +03:00
pavlov346346-source
170c078998 feat: require trial promo code during Caterium signup 2026-09-13 18:43:54 +03:00
pavlov346346-source
2e2f02efc3 fix: match the early login boot placeholder to the cream login redesign
performance.js paints a full-screen boot placeholder immediately on
page load (before app-runtime.js and the real auth gate exist), so it
never got updated when login-signature-v1776.js was redesigned from a
dark two-column layout with an offer-gallery/002.jpg table photo to
the light single-column "cream login" with the Caterium SVG mark.

Result: every signed-out visitor saw the old dark/photo screen flash
for a moment, then get replaced by the new light screen once the real
gate rendered - the flicker was two genuinely different, undeployed-
in-sync designs, not a caching artifact. Rebuilt the boot placeholder's
markup and inline critical CSS to mirror login-signature-v1776.js's
current design (same background, mark, type, and copy) so the first
paint already matches what replaces it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-12 14:40:33 +03:00
pavlov346346-source
12ba761af9 Merge production (account center + login redesign) into main
production had diverged from main with 20 unreviewed direct-push
commits never merged back (account center feature, owner-only employee
roles, and a login-screen redesign - the exact "cream login" work that
replaced the old dark table-photo screen). Neither QA nor the
audit fixes on main had ever seen this code.

Conflict resolution:
- service-worker.js: kept production's newer cache-refresh mechanism
  (CRITICAL_FRESH, forceFresh, withAccountCenter, v81 cache name) and
  combined both sides' CORE asset lists (account-center-v1780.js +
  login-signature-v1776.js from production, auth-security-v1774.js +
  order-enhancements-v1775.js from main).
- deploy-timeweb.yml: kept main's version, which already independently
  verifies service-worker.js's sha256 alongside the login/logo files -
  strictly more thorough than production's version of the same check.

Also fixes fallout from production's commits never having been
QA-tested before landing: package.json was bumped to 17.8.0 with
nothing else in the codebase updated to match (reverted to 17.7.3,
matching package-lock.json/release-manifest.json/app-runtime.js, since
no other release artifact actually changed), and three tests
(static-security.mjs, edge-security-v1774.mjs, release-check.mjs) had
hardcoded strings (old PWA cache name, old employee role list) that no
longer matched the code they were checking.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-12 14:36:52 +03:00
pavlov346346-source
4106452f56 fix: stop the menu-editor button-patch interval once it succeeds
setupOldButton() polled the DOM every 4s forever after the menu editor
first opened, with no way to ever stop - the interval id was not even
kept in a variable. It now returns whether the button was found, the
interval only starts when the first attempt fails, and clears itself
on the first successful attempt (also wired into the existing
disconnect() cleanup alongside the other timers).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-12 14:09:06 +03:00
pavlov346346-source
a08633f9d0 perf: stop recomputing the full client list per client on bulk push
pushAllClients() already has every client profile from its own
listClients() call, but looped through pushClient(key) -> getClient(key)
-> listClients() again for each one - N clients meant N+1 full
order-history recomputations instead of one. pushClient now accepts an
optional already-known profile so the bulk path skips the redundant
lookup; single-key callers (scheduleServerPush's debounce) are
unaffected.

compareClientSources() had the same shape of duplicate work: it called
buildClients()/serverListClients() directly and then again inside
mergeClientSources(). mergeClientSources() now accepts already-computed
local/server arrays instead of always recomputing both.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-12 14:08:57 +03:00
pavlov346346-source
a98e636937 fix: gate production promotion on QA success; remove dead data-layer files
promote-production.yml triggered on push to main independently of
qa.yml, with no branch protection configured on the repo - a failing
QA run (npm audit, static security tests, e2e) never blocked
production. Switch it to the same workflow_run pattern deploy-timeweb.yml
already uses: only promote the exact commit QA just passed.

Also removes public/core/data-layer-v1770/1771/1772.js: only v1773 is
ever loaded (index.html, performance.js's loadDataLayer, service-worker
cache all reference v1773 only) - the older three were dead weight
shipped to every visitor.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-12 14:08:38 +03:00
pavlov346346-source
bd7995d68c fix: expose manager account and password controls 2026-09-12 10:10:25 +03:00
pavlov346346-source
5cff7135f2 feat: load Caterium account center 2026-09-12 08:48:57 +03:00
pavlov346346-source
9c868aa99b fix: lock company owner and simplify employee accounts 2026-09-12 08:48:39 +03:00
pavlov346346-source
0e1a7c98e8 feat: add owner and employee account center 2026-09-12 08:48:06 +03:00
pavlov346346-source
120bd12474 fix: use approved Caterium logo on cream login 2026-09-12 05:57:35 +03:00
pavlov346346-source
02bcc23931 feat: apply cream Caterium login visual 2026-09-12 05:54:44 +03:00
pavlov346346-source
15dbbc71af fix: show Signature auth from first frame 2026-09-12 03:42:43 +03:00
pavlov346346-source
3682b908e9 fix: make Signature the native Caterium auth screen 2026-09-12 03:41:58 +03:00
pavlov346346-source
f25232aaed feat: load Caterium Signature login screen 2026-09-11 19:19:12 +03:00
pavlov346346-source
0bf737d2ec feat: add Caterium Signature login design 2026-09-11 19:18:39 +03:00
pavlov346346-source
d73c90917f style: make order comment button compact 2026-09-11 15:28:09 +03:00
pavlov346346-source
232222c7a7 fix: remove order reminders UI and notification logic 2026-09-11 15:21:13 +03:00
pavlov346346-source
a7e95db66b fix: show comment button under every order position 2026-09-11 14:55:46 +03:00
pavlov346346-source
1e648c90ac
Fix visible comments on order positions 2026-09-11 14:37:16 +03:00
pavlov346346-source
9bf75ccf11
Add order comments, reminders, search and delivery totals
Add per-line comments, day/hour order reminders, catalog search by number/name, and delivery-inclusive financial summary. Includes static regression checks.
2026-09-11 14:27:17 +03:00
pavlov346346-source
736e551369
Security: require verified email for signup
* security: require verified email for client signups

* security: load verified-email auth guard

* test: include auth security guard in deploy checks

* test: guard verified-email signup flow

* security: remove client-controlled email autoconfirm triggers
2026-09-11 07:27:37 +03:00
pavlov346346-source
4aa66d0a56
Caterium v17.7.3 — clients server read
Server-preferred normalized client profiles with legacy fallback, canonical snapshot RPC, preserved order metrics, release metadata and tests.
2026-09-09 12:07:37 +03:00
pavlov346346-source
815cc602c5
Caterium v17.7.2 — clients foundation
Canonical client identity, client data layer, legacy loyalty/communication compatibility, normalized Supabase client RPC, release metadata and tests.
2026-09-09 10:42:14 +03:00
github-actions[bot]
b6ec42b2e2 Caterium v17.7.1 - data layer adoption 2026-09-08 23:34:45 +00:00
pavlov346346-source
f8bb0a78b4
Caterium v17.7.0 — architecture foundation
Introduce the first data layer, move order auto-completion to server cron with legacy/cloud compatibility, clean error telemetry, update PWA/versioning, and add regression coverage.
2026-09-08 13:24:34 +03:00