Commit Graph

2403 Commits

Author SHA1 Message Date
Jakub Zych
67f7164302 feat(cabana): mail templates list grouped by template with per-locale status
Gap G-35-1 (supersedes D-05; D-06 reset and D-07 drift per locale):
- the templates list keeps one row per template (the base row, or the
  lowest variant when only variants ship) with a Customized locales
  column (Default, then locale codes, at most three then +N);
- row states and the status filter aggregate over the template's
  locale versions; the locale filter is removed;
- a not-customized locale without a file shows the base row's current
  subject, body and layout; its info partial says so, its file version
  compares with the base file, and Reset returns it to the base file
  (postcard.ResetOverride accepts a fallback-locale code);
- copy: mail.template.customized_locales, mail.info_locale_default,
  mail.info_locale_fallback (en/pl);
- tests: TestMailScreensSmoke/locales_list, templates and drift updated,
  TestMailDrift on the grouped row, TestMailTemplateFilterScopes.
2026-11-13 20:39:45 +01:00
Jakub Zych
52c9c7eb18 feat(mail): one admin record per mail template with a locale switcher
Gap G-35-1 (supersedes D-05), tracer slice:
- postcard: migration 202611130001_mail_template_base_code (base_code
  column and index); SyncIndex writes base_code; EnsureLocaleRows creates
  the <template>-<locale> rows of locales that ship no file; TemplateBase
  and Catalog.TemplateFor; send, preview and validation resolve a missing
  <template>-<locale> to the locale's customization, else the base's
  customization, else the base file. Names with their own file send as
  before.
- cabana: mail locales are the translator's plus the TranslationWriter's
  enabled locales; sync ensures the locale rows and re-syncs when the
  locale set changes; record lookups admit fallback-locale rows; the
  record title is the base code; RecordMeta.LocaleVariants
  (RecordLocaleVariant) on the show and update responses.
- admin: LocaleVariantSwitcher in the update form header, from
  meta.localeVariants, behind the unsaved-changes confirm.
- tests: TestMailOverrideSmoke/locale_fallback,
  TestMailScreensSmoke/locales, LocaleVariantSwitcher.test.ts.
2026-11-13 20:29:42 +01:00
Jakub Zych
9afe95ccef docs(35): revise gap-closure plans after plan check
- 35-07: record G-35-8 as framework-closed with the plugin part deferred
  (35-VALIDATION.md and a closure note in 35-UAT.md); scope the UAT test 8
  re-run to the built-in layouts; deferred plugin follow-up check
- 35-07: TestInlineCSS dangerous-URL fixture injected past save validation
- 35-06: examples/hello go.mod/go.sum in files_modified
- 35-05: T-35-31 wording matches the locale tag rule (pt-BR)
- 35-05/35-06: tracer tasks may land as green sub-commits
2026-11-13 16:46:05 +01:00
Jakub Zych
293400e61f docs(35): plan gap closure for G-35-1 and G-35-8
Three gap-closure plans confirmed by the user:
- 35-05: one admin record per mail template with a locale switcher (supersedes D-05)
- 35-06: finished built-in layouts, Branding site name, CSS inlining via go-premailer (supersedes D-10's inlining claim)
- 35-07: unit tests for both gaps and a read-only scratch-modfile consumers stage
2026-11-13 16:43:14 +01:00
Jakub Zych
b8c177fca8 docs(35): diagnose UAT gaps G-35-1 and G-35-8 2026-11-13 16:18:28 +01:00
Jakub Zych
9db6a66ca4 test(35): complete UAT - 8 passed, 2 issues 2026-11-13 16:11:26 +01:00
593f99ac70 test(35): persist human verification items as UAT 2026-11-13 14:46:09 +01:00
5eb866b37a docs(35): mark plan 04 complete in STATE and ROADMAP
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-13 14:31:53 +01:00
fd51f1f523 docs(35-04): complete unit tests and phase gate plan
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-13 14:31:10 +01:00
ed696bc74e docs(35): drop pending marker from validation status key
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-13 14:23:57 +01:00
31d019fcc5 docs(35): fill the validation map
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-13 14:23:48 +01:00
1ae1a9553f test(admin): unit and browser tests for the mail editor fields
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-13 14:23:28 +01:00
45017039b2 fix(admin): rebuild boardwalk dist after mail preview and insertImage fixes
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-13 14:23:28 +01:00
52e854a19e fix(admin): skip mail preview requests while the field is off-screen
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-13 14:21:48 +01:00
275e70b42d fix(admin): encode parentheses in markdown mail image URLs
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-13 14:21:48 +01:00
cd20540f13 test(cabana): unit tests for mail permissions, save validation, drift, reset, layout delete and test send
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-13 14:14:08 +01:00
659969b9ac test(postcard): unit tests for overrides, fallback, partials, samples, validation, sync and branding
- Pin override precedence, fallback, partials, samples, draft validation and branding
- Postgres TestStore/TestSync for index sync, drift hashes and reset
- Pact row-state and mail capability method-set pins; attach AbsolutePublicURL cases

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-13 14:04:14 +01:00
1df2e31dea fix(admin): isolate CodeMirror load for chunk-failure tests
- Route CodeEditorField through codeeditor/load so vitest can mock the chunk
- Keep registry expectations for colorpicker/codeeditor without importing the editor SFC

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-13 13:57:16 +01:00
e81cfde7b2 fix(admin): restore suite after colorpicker and codeeditor registration
- Expect colorpicker/codeeditor as registered controls; use notatype for unsupported cases
- Seed DatePicker placeholder from the model value so the calendar opens on that month
- Make CodeEditor chunk-failure mock reject the dynamic import

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-13 13:53:44 +01:00
5f62cd6b92 test(35): phase gate script check-phase35.sh
- Fail-closed stages for self-test, go, docker, consumers, admin, docs, marker and additive
- Consumers run sm-user-plugin and sm-paymentgateway-plugin mail tests against this checkout

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-13 13:53:44 +01:00
95eed7ad98 docs(35-03): complete mail templates SPA editor plan 2026-11-13 13:43:33 +01:00
f232076531 docs(state): record phase 31.2 context session 2026-11-13 13:41:27 +01:00
b8638aac66 docs(31.2): capture phase context 2026-11-13 13:41:25 +01:00
8969806dc8 fix(phrasebook): add mail.picker copy keys used by the admin image picker
SPA literals for insert/use/upload states and empty/error copy must resolve
in en and pl or the phrasebook SPA key check fails.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-13 13:40:49 +01:00
36f3410896 build(admin): rebuild the embedded admin for the mail editor
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-13 13:38:48 +01:00
d13340672f feat(admin): footer record actions, deletable flag, mail row states and diff styles
- FormView footer RecordActions when there is no preview; meta.deletable hides Delete
- Partial fields reload after save and record actions; customized/outdated badges
- .summer-diff kit and docs for codeeditor, mailpreview and footer actions

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-13 13:37:55 +01:00
aba512800e test(35-03): add failing test for customized and outdated row badges
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-13 13:35:48 +01:00
68e1d36fd5 feat(admin): colour picker, mail image field and the image picker with insert
- insertImage escapes markdown/html/css/text snippets per UI-SPEC C4
- MailImagePicker with canUpload-gated upload, radiogroup tiles, insert/choose modes
- ColorPickerField, MailImageField, markdown/codeeditor Insert image wiring

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-13 13:34:54 +01:00
48e87b7543 docs(state): record phase 31.1 context session 2026-11-13 13:32:27 +01:00
db88fb15f2 docs(31.1): capture phase context 2026-11-13 13:32:26 +01:00
3e29e6042e test(35-03): add failing tests for insertImage and colorpicker
- insertImage C4 table expects escaped markdown/html/css/text snippets
- ColorPickerField sync cases; stubs return empty until GREEN

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-13 13:29:09 +01:00
9975cf4b52 feat(admin): codeeditor field on CodeMirror 6, loaded lazily
- Pin the seven approved CodeMirror/lezer packages exactly; lockfile integrity matches the decision note
- Lazy createCodeEditor with Go {{ }} highlighting, form hotkeys kept, Tab unbound
- Loading skeleton, chunk-failure textarea fallback, read-only pre

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-13 13:28:02 +01:00
7e2c01172f test(35-03): add failing tests for codeeditor field
- Browser smoke: Tab leaves, Mod+S/Mod+Enter save, Esc does not cancel
- Happy-dom: loading box, read-only pre, chunk-failure textarea fallback
- Stub field/editor so imports resolve; assertions fail until GREEN

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-13 13:24:19 +01:00
ee0bbc27f8 docs(31): record planned phase and patterns 2026-11-13 13:15:24 +01:00
6e0d4bbca7 docs(35): CodeMirror decision note and STACK.md row for the admin code editor
- Document seven exact pins, integrity values, and the too-new flag on @codemirror/view
- Add Admin SPA STACK.md rows linking the decision note before any npm install

Plan 35-03, task 2

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-13 13:15:23 +01:00
52204e171d feat(admin): mail preview field with sandboxed HTML and test send
- Add MailPreviewField (POST /mail/preview + /mail/test-send, empty sandbox iframe)
- Register mailpreview as valueless/group-labelled; SettingsFormView FORM_VALUES/FORM_LOCALE
- Smoke tests for srcdoc, sequence guard, 422 keep-last, and 429 Retry-After

Plan 35-03, task 1

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-13 13:14:22 +01:00
9ea3159ba2 fix(31): reslice plans after checker feedback 2026-11-13 13:07:56 +01:00
da6bfa9e48 docs(35-02): record plan progress in state and roadmap
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-13 13:05:49 +01:00
399ba5fb60 docs(35-02): complete mail screens server plan
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-13 13:05:25 +01:00
0c73c8d4f1 feat(cabana): mail preview and test send to yourself
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-13 13:02:49 +01:00
4fd2ed07eb feat(cabana): code editor, colour and mail image fields, mail branding and the image library
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-13 12:53:09 +01:00
b996a8fc83 docs(31): add recording foundation todo and test plans 2026-11-13 12:48:32 +01:00
83f76cc3f7 feat(cabana): mail layouts and partials screens with reset, drift and custom layouts
- Layouts and partials controllers with catalog scoping, reset action and File version diff
- Custom layout create/delete with in-use refusal; meta.deletable and customized/outdated row states
- List schema golden fixtures updated for the two new row-state message keys

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-13 12:33:20 +01:00
Jakub Zych
7efb9ed7ad feat(cabana): mail templates screen over postcard overrides
- Settings -> Mail -> Mail templates in the internal pseudo-plugin when
  postcard's Mailer is published; system.manage_mail_templates and
  system.manage_mail_layouts registered with no role grants
- MailTemplate/MailLayout models, catalog-scoped list and form, layout
  relation over file and custom layouts, no create or delete
- save stamps is_custom, base_hash and customized_at and validates the
  override through postcard.Editor inside the save transaction
- serve-start postcard.SyncIndex through lagoon.OnDatabase, retried on
  the first mail list request
- copy en/pl, README and docs; TestMailScreensSmoke/templates

Plan 35-02, task 1
2026-11-13 11:45:13 +01:00
Jakub Zych
2acf8e46c4 docs(31): split into 31, 31.1 and 31.2 and record the planning decisions 2026-11-13 11:29:37 +01:00
Jakub Zych
7b25fcff55 docs(phase-31): add validation strategy 2026-11-13 11:21:57 +01:00
Jakub Zych
1bfe0514f8 docs(31): research phase domain 2026-11-13 11:20:52 +01:00
Jakub Zych
533d0d2fcd docs(35-01): record plan decisions in state 2026-11-13 11:11:42 +01:00
Jakub Zych
db86b51a51 docs(35-01): complete mail domain layer plan 2026-11-13 11:11:01 +01:00
Jakub Zych
2bf9081c1b feat(postcard): mail branding and the logo URL
- Brand, DefaultBrand and CompileBrandCSS: thirteen colours, each checked
  as a six-digit hex colour, compiled into CSS for plain elements and the
  built-in layouts and partials
- once the branding row exists its compiled CSS replaces mail.brandCss;
  mail.css still follows, and the file version sent after a failing
  override keeps the Branding
- layouts get logoUrl, built per send from storage.uploads.public_url or
  app.url through attach.AbsolutePublicURL; a logo that cannot be shown is
  left out with a rate-limited warning
- Editor previews and validates a Branding draft (rule colour)

Plan 35-01, task 5.
2026-11-13 11:06:43 +01:00