feat(postcard): sample values, file hashes, index sync and the draft editor

- sample.<path> header keys and a parse-tree walker that fills every other
  variable with a visible [path] placeholder, nested fields and range
  targets included
- every file entry carries the sha256 of its CRLF-normalized text; the
  catalog lists its files (Templates, Layouts, Partials) for admin code
- SyncIndex upserts one index row per file and never touches the override
  columns of a customized row; ResetOverride returns a row to its file
- Editor validates, previews and test-sends a template, layout or partial
  draft through the render path of Send and reports field and rule
- pact.RowStateCustomized and pact.RowStateOutdated

Plan 35-01, task 4.
This commit is contained in:
Jakub Zych
2026-11-13 10:57:05 +01:00
parent 5df1ec27cf
commit 495319ee21
11 changed files with 2128 additions and 42 deletions

View File

@@ -28,10 +28,12 @@ const (
// partials: goldmark with tables, raw HTML still dropped.
var partialMarkdown = goldmark.New(goldmark.WithExtensions(extension.Table))
// partialError is a failed partial call. name is the partial's full name.
// partialError is a failed partial call. name is the partial's full name;
// unknown is set when no such partial is registered.
type partialError struct {
name string
msg string
name string
msg string
unknown bool
}
func (e *partialError) Error() string {
@@ -78,7 +80,7 @@ func partialName(name string) string {
func (r *partialRun) sections(full string) (text, html string, err error) {
p, ok := r.cat.lookupPartial(full)
if !ok {
return "", "", &partialError{name: full, msg: "unknown partial"}
return "", "", &partialError{name: full, msg: "unknown partial", unknown: true}
}
if ov, ok := r.overrides[full]; ok {
return ov.Text, ov.HTML, nil