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>
This commit is contained in:
2026-11-13 12:33:20 +01:00
parent 7efb9ed7ad
commit 83f76cc3f7
35 changed files with 1868 additions and 18 deletions

View File

@@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"strings"
"time"
"git.golem15.com/golem15/summercms/modules/pact"
@@ -107,3 +108,24 @@ func IsReorderStale(err error) bool {
// last-superuser race tests hold it in a transaction of their own, so both
// racing requests queue on it before either counts the other superusers.
const SuperuserLockKey = superuserLockKey
// LineDiffForTest renders lineDiff(a, b, context) as "|"-joined lines with
// their two-character prefixes ("+ ", "- ", " "); a gap between hunks is
// "...", and no diff (above the line cap) is "".
func LineDiffForTest(a, b []string, context int) string {
lines := lineDiff(a, b, context)
out := make([]string, 0, len(lines))
for _, line := range lines {
switch line.Kind {
case diffAdd:
out = append(out, "+ "+line.Text)
case diffDel:
out = append(out, "- "+line.Text)
case diffGap:
out = append(out, "...")
default:
out = append(out, " "+line.Text)
}
}
return strings.Join(out, "|")
}