diff --git a/.planning/phases/35-mail-templates-and-layouts-editor/35-REVIEW-FIX.md b/.planning/phases/35-mail-templates-and-layouts-editor/35-REVIEW-FIX.md new file mode 100644 index 00000000..c0d1ceee --- /dev/null +++ b/.planning/phases/35-mail-templates-and-layouts-editor/35-REVIEW-FIX.md @@ -0,0 +1,109 @@ +--- +phase: 35-mail-templates-and-layouts-editor +fixed_at: 2026-11-14T16:45:00Z +review_path: .planning/phases/35-mail-templates-and-layouts-editor/35-REVIEW.md +iteration: 1 +findings_in_scope: 5 +fixed: 5 +skipped: 0 +status: all_fixed +--- + +# Phase 35: Code Review Fix Report + +**Fixed at:** 2026-11-14T16:45:00Z +**Source review:** .planning/phases/35-mail-templates-and-layouts-editor/35-REVIEW.md +**Iteration:** 1 + +**Summary:** +- Findings in scope: 5 (CR-01, CR-02, WR-01, WR-02, WR-03; fix_scope critical_warning, IN-01..IN-03 not attempted) +- Fixed: 5 +- Skipped: 0 + +`workflow.use_worktrees` is `false`, so the fixes were edited and committed in the main checkout on `master` (no worktree, no temp branch, no recovery sentinel). All verification below ran in the main checkout and can be reproduced from it. + +Order of commits: CR-01, CR-02, WR-01, WR-02, WR-03, then the decision note amendment (planning doc, separate commit). WR-02 depends on CR-02: the whole-document handler regex could only be dropped once the tokenizer walk reads raw-text element and comment content. + +## Fixed Issues + +### CR-01: A site name that `UnsafeText` accepts still stops every default/system-layout send + +**Files modified:** `modules/postcard/safety.go`, `modules/postcard/sitename_test.go`, `modules/cabana/mail_site_name_postgres_test.go`, `modules/postcard/README.md`, `docs/services/mail.md` +**Commit:** 2dbee305 +**Applied fix:** `UnsafeText` now checks the escaped name in the places the built-in layouts print it (`printContext`: after `© 2000 ` in a footer paragraph, in the header span and in the logo's `alt`), not on its own. With that commit alone, `Online=Shop` and `onboarding=team` were dropped at render (with the rate-limited warning) and refused on the Branding form, so sends on default and system layouts succeeded on every path. WR-02 (31de2ff9) then removed the cause: such names are now shown and saved. Regression tests (final state, after WR-02): `TestSiteNameSend` sends `Online=Shop`/`onboarding=team` from the Branding and from a `mail.from` display name on the default and system layouts over the file-version, override and override-failure paths and checks the name in the header and footer. `TestUnsafeText` pins them as safe. `TestUnsafeSiteNameDropped/editor` checks that a template or layout save under a stored `Online=Shop` is not refused. `TestMailSiteNameSafety` (Postgres) has `handler_shaped_name_sends`, which saves `Online=Shop` on the Branding form and sends on both layouts. The verifier probe (`zz_verifier_probe_test.go` via overlay) now reports `err=` for all 8 Branding/mail.from sends and for `Editor.Validate` under Branding `Online=Shop`. +**Status:** fixed: requires human verification. This is a logic change to the safety rule. + +### CR-02: Scheme and handler checks are skipped inside raw-text elements + +**Files modified:** `modules/postcard/safety.go`, `modules/postcard/safety_test.go`, `modules/postcard/README.md`, `docs/services/mail.md` +**Commit:** 1d481bb0 +**Applied fix:** `unsafeMarkup` now checks again, as markup: +- the raw source of the content of every raw-text element (`rawTextElements`: iframe, noembed, noframes, noscript, plaintext, script, style, textarea, title, xmp). This also covers content after a self-closing start tag such as `