feat(server): persist renderContent texture and cover it in asset lifecycle

Add an optional renderContent field to canvas nodes across the go-zero API
type, domain node, SQLC models/queries, PostgreSQL schema, and mappers so a
lightweight transparent-WebP display texture persists alongside the original
content. Prefer renderContent for project thumbnails and main-canvas
previews, and treat both content and renderContent as protected/deletable
asset URLs during canvas asset cleanup. Extend round-trip coverage.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-16 20:45:56 +08:00
parent e7a0cc0b86
commit ee2c52bbc6
17 changed files with 75 additions and 46 deletions
@@ -31,6 +31,7 @@ type projectPreviewNode struct {
Width float64 `json:"width"`
Height float64 `json:"height"`
Content string `json:"content,omitempty"`
RenderContent string `json:"renderContent,omitempty"`
Tone string `json:"tone,omitempty"`
LayerRole string `json:"layerRole,omitempty"`
FillColor string `json:"fillColor,omitempty"`
@@ -82,6 +83,7 @@ func canvasPreviewNodes(nodes []design.Node) []projectPreviewNode {
continue
}
content := strings.TrimSpace(node.Content)
renderContent := strings.TrimSpace(node.RenderContent)
if node.Type == design.NodeTypeFrame && !isGeneratedImageContent(content) {
content = ""
}
@@ -93,6 +95,7 @@ func canvasPreviewNodes(nodes []design.Node) []projectPreviewNode {
Width: math.Max(1, node.Width),
Height: math.Max(1, node.Height),
Content: content,
RenderContent: renderContent,
Tone: strings.TrimSpace(node.Tone),
LayerRole: strings.TrimSpace(node.LayerRole),
FillColor: strings.TrimSpace(node.FillColor),