Commit Graph

2425 Commits

Author SHA1 Message Date
Jakub Zych
6e8cead959 docs(35): plan gap closure for CR-01
Two gap-closure plans confirmed by the user:
- 35-08: URL-scheme check on decoded attribute values instead of the whole
  document, unsafe site names dropped at render with a warning and refused
  on the Branding form (postcard.UnsafeText), the inlined result never
  stops mail, literal site name in the footer (CR-01, WR-01, WR-05)
- 35-09: regression and unit tests, new names required by
  check-phase35.sh, IN-03 self-test fix, validation map
2026-11-14 14:59:30 +01:00
Jakub Zych
0aa38db8b5 docs(35): re-verify phase after gap closure - CR-01 gap found 2026-11-13 22:33:37 +01:00
Jakub Zych
b1f85c2177 docs(35): record code review disposition 2026-11-13 22:23:46 +01:00
Jakub Zych
75669b343f docs(35): add code review report 2026-11-13 22:23:31 +01:00
Jakub Zych
0bef6b3098 docs(35-07): update state and roadmap after plan 35-07 2026-11-13 22:11:33 +01:00
Jakub Zych
d00e2c8d6f docs(35-07): complete gap-closure tests plan
- SUMMARY for the G-35-1 and G-35-8 tests, the read-only consumers stage
  and the validation map
2026-11-13 22:11:03 +01:00
Jakub Zych
a3ce097455 docs(35): validation map for the gap closure
- 35-VALIDATION.md: G-35-1 and G-35-8 rows (postcard unit and Postgres,
  cabana Postgres, SPA, consumers through scratch modfiles); D-05 and the
  default-layout byte-identity rows superseded by the 35-05/35-06 notes;
  manual re-runs of UAT tests 1 and 8 (test 8 scoped to the built-in
  layouts), a real-inbox check and the deferred plugin follow-up check;
  open item: site name not checked for a URL scheme at save time
- 35-UAT.md: closure_note and rerun_scope on G-35-8 (framework part closed,
  plugin part deferred); status and results unchanged
2026-11-13 22:09:53 +01:00
Jakub Zych
a9381165c7 test(admin): mail template locale switcher
- LocaleVariantSwitcher: current flag, option values and locales, the label
  through the control id, the query kept on navigation, no navigation for the
  open version, selection restored when a guard throws, props updates
- FormView: no switcher with one variant; with unsaved edits switching asks
  the unsaved-changes confirm, stays on cancel and opens the sibling on confirm
- check-phase35.sh requires LocaleVariantSwitcher.test.ts (ADMIN_FILES)
2026-11-13 21:38:36 +01:00
Jakub Zych
eed91c821a test(cabana): grouped mail templates, site name and the inlining switch
- TestMailLocaleGroups: one list row per template, customized locales,
  grouped badges and status filter, localeVariants order, labels, states and
  current flag, the default version on a fallback row, save then send, reset,
  drift through the base file, the file version against the base file,
  out-of-group ids, the permission split and locales enabled at run time
- TestMailBrandSiteName: saved trimmed, 255-character limit, preview and send
  header, no header row without a name or a logo, current handling of a name
  holding a URL scheme
- TestMailLayoutInlineOptOut: the switch on a file layout, reset to the file
  value, a custom layout created with the switch off
- check-phase35.sh requires the three names (DOCKER_TESTS)
2026-11-13 21:38:30 +01:00
Jakub Zych
a0dde086d2 test(postcard): locale fallback, built-in layouts, partials and CSS inlining
- TestTemplateBase, TestTemplateFor and TestSendLocaleFallback pin the
  <template>-<locale> resolution and the order the override source is asked
- TestEnsureLocaleRows (Postgres): rows only for non-default locales without
  files, idempotent, customized content kept while file_hash follows the
  base, base_code from SyncIndex, reset of a fallback row, migrations roll back
- TestBuiltinLayoutsLogo, TestHeaderFooterPartials, TestButtonPartial and
  TestSiteName cover the finished default, system and minimal layouts
- TestInlineCSS, TestInlineCSSOptOut and TestInlineFailure cover inlining,
  the per-layout opt-out and the fallback when the inliner fails
- check-phase35.sh requires the new names (GO_TESTS, DOCKER_TESTS)
2026-11-13 21:31:44 +01:00
Jakub Zych
ae13e4dd41 test(35): read-only consumers with a scratch modfile in check-phase35.sh
- consumers stage runs each core plugin with GOWORK=off, GOPROXY=off and
  -mod=mod -modfile=<scratch>/go.mod (its go.sum merged with the framework's),
  so the go-premailer requirement resolves without writing the sibling tree
- workspace_check takes the modfile flags; a sibling whose git status
  --porcelain prints anything before or after the runs is refused
- self-test: planted dirty repository and a modfile resolving the framework
  elsewhere
2026-11-13 21:23:00 +01:00
Jakub Zych
0e97113a4f docs(35-06): update state and roadmap after plan 35-06 2026-11-13 21:19:40 +01:00
Jakub Zych
be9170af53 docs(35-06): complete finished mail layouts and CSS inlining plan 2026-11-13 21:19:04 +01:00
Jakub Zych
f1cebf1d70 docs(35): UI-SPEC copy for inlining, site name and the layout opt-out
- C5: the disable_auto_inline_css switch on the CSS tab with its copy;
  the CSS comment's inlining is now true
- C12: the site_name row after the logo, the changed logo comment and a
  note on the built-in layouts' header and footer, referencing the
  decision note that supersedes D-10's inlining claim
2026-11-13 21:17:30 +01:00
Jakub Zych
09a5338d9a feat(postcard): header, logo, footer and padding in the system and minimal layouts
- system.htm: the header partial (logo or site name) above the card and
  the copyright footer below it; its text wrapper ends with the footer
- brand CSS: the system layout's content cell keeps WinterCMS's 35px
  side padding (the 35px 0 override is gone)
- minimal.htm: the logo above the message when logoUrl is set
- TestMailPartialsSmoke/built_in_layouts covers the three layouts and the
  inlined brand colour on the button in each
- 35-06 Task 3 (G-35-8)
2026-11-13 21:17:02 +01:00
Jakub Zych
d320733510 feat(postcard): inline mail CSS at render with a per-layout opt-out
- github.com/vanng822/go-premailer v1.38.0 (default options) inlines the
  rendered HTML after the safety checks; the result is checked again,
  HTML without a style element is left as it is, an inliner error sends
  the style block only and warns (key inline:<layout>)
- opt-out: layout header key disable_auto_inline_css, the layouts column
  of the same name (migration 202611130003), LayoutFile/LayoutOverride/
  Draft.DisableAutoInlineCSS; SyncIndex mirrors and ResetOverride restores
  the file's value
- cabana layout form switch on the CSS tab, mapped into the layout draft
  and the save validation; en/pl copy
- tests: TestMailPartialsSmoke/inline, TestMailEditorSmoke/inline_flag,
  the layouts switch in TestMailScreensSmoke; CSS-slot tests read the
  style block through a no-op inliner
- 35-06 Task 2 (G-35-8)
2026-11-13 21:12:01 +01:00
Jakub Zych
dcd0ae5338 docs(35): decision note for mail CSS inlining with go-premailer
- go-premailer pinned at v1.38.0, facts checked, MVS changes and the
  indirect modules tidy adds, rejected alternatives
- supersedes D-10's inlining claim and lifts 35-01's default.htm gate;
  Branding gains a site name with the mail.from fallback
- STACK.md Supporting Libraries row
2026-11-13 20:55:30 +01:00
Jakub Zych
093529d45c feat(postcard): finished default layout with logo header, footer and site name
- default.htm ports WinterCMS's default layout: wrapper, header row with
  the Branding logo (or the site name), the inner-body card and a
  copyright footer; its text wrapper ends with the footer
- built-in header and footer partials (logo/body/url, body)
- layouts get siteName (Branding site name, else the display name of
  mail.from) and year; Brand.SiteName and migration
  202611130002_mail_brand_site_name
- cabana Branding form gets site_name (trimmed, max 255), mapped into the
  Branding preview draft; en/pl copy; img.logo brand CSS
- 35-06 Task 1 (G-35-8)
2026-11-13 20:52:52 +01:00
Jakub Zych
fdc2094ffc docs(35-05): update state and roadmap after plan 35-05 2026-11-13 20:43:50 +01:00
Jakub Zych
7a209dee9a docs(35-05): complete mail template locale groups plan 2026-11-13 20:43:18 +01:00
Jakub Zych
1173a5c5a2 docs(35): decision note superseding D-05 and the locale switcher contract 2026-11-13 20:42:06 +01:00
Jakub Zych
e114492bbe build(admin): rebuild the embedded admin for the mail locale switcher 2026-11-13 20:40:18 +01:00
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