feat: complete HTML-first architecture implementation (Phase 1 & 2)
Major architectural simplification removing content type complexity: Database Schema: - Remove 'type' field from content and content_versions tables - Simplify to pure HTML storage with html_content + original_template - Regenerate all sqlc models for SQLite and PostgreSQL API Simplification: - Remove content type routing and validation - Eliminate type-specific handlers (text/markdown/structured) - Unified HTML-first approach for all content operations - Simplify CreateContent and UpdateContent to HTML-only Backend Enhancements: - Update enhancer to only generate data-content-id (no data-content-type) - Improve container expansion utilities with comprehensive block/inline rules - Add Phase 3 preparation with boundary-respecting traversal logic - Strengthen element classification for viable children detection Documentation: - Update TODO.md to reflect Phase 1-3 completion status - Add WORKING_ON.md documenting the architectural transformation - Mark container expansion and HTML-first architecture as complete This completes the transition to a unified HTML-first content management system with automatic style detection and element-based behavior, eliminating the complex multi-type system in favor of semantic HTML-driven editing.
This commit is contained in:
@@ -11,8 +11,8 @@ import (
|
||||
)
|
||||
|
||||
const createContentVersion = `-- name: CreateContentVersion :exec
|
||||
INSERT INTO content_versions (content_id, site_id, html_content, original_template, type, created_by)
|
||||
VALUES (?1, ?2, ?3, ?4, ?5, ?6)
|
||||
INSERT INTO content_versions (content_id, site_id, html_content, original_template, created_by)
|
||||
VALUES (?1, ?2, ?3, ?4, ?5)
|
||||
`
|
||||
|
||||
type CreateContentVersionParams struct {
|
||||
@@ -20,7 +20,6 @@ type CreateContentVersionParams struct {
|
||||
SiteID string `json:"site_id"`
|
||||
HtmlContent string `json:"html_content"`
|
||||
OriginalTemplate sql.NullString `json:"original_template"`
|
||||
Type string `json:"type"`
|
||||
CreatedBy string `json:"created_by"`
|
||||
}
|
||||
|
||||
@@ -30,7 +29,6 @@ func (q *Queries) CreateContentVersion(ctx context.Context, arg CreateContentVer
|
||||
arg.SiteID,
|
||||
arg.HtmlContent,
|
||||
arg.OriginalTemplate,
|
||||
arg.Type,
|
||||
arg.CreatedBy,
|
||||
)
|
||||
return err
|
||||
@@ -53,7 +51,7 @@ func (q *Queries) DeleteOldVersions(ctx context.Context, arg DeleteOldVersionsPa
|
||||
|
||||
const getAllVersionsForSite = `-- name: GetAllVersionsForSite :many
|
||||
SELECT
|
||||
cv.version_id, cv.content_id, cv.site_id, cv.html_content, cv.original_template, cv.type, cv.created_at, cv.created_by,
|
||||
cv.version_id, cv.content_id, cv.site_id, cv.html_content, cv.original_template, cv.created_at, cv.created_by,
|
||||
c.html_content as current_html_content
|
||||
FROM content_versions cv
|
||||
LEFT JOIN content c ON cv.content_id = c.id AND cv.site_id = c.site_id
|
||||
@@ -73,7 +71,6 @@ type GetAllVersionsForSiteRow struct {
|
||||
SiteID string `json:"site_id"`
|
||||
HtmlContent string `json:"html_content"`
|
||||
OriginalTemplate sql.NullString `json:"original_template"`
|
||||
Type string `json:"type"`
|
||||
CreatedAt int64 `json:"created_at"`
|
||||
CreatedBy string `json:"created_by"`
|
||||
CurrentHtmlContent sql.NullString `json:"current_html_content"`
|
||||
@@ -94,7 +91,6 @@ func (q *Queries) GetAllVersionsForSite(ctx context.Context, arg GetAllVersionsF
|
||||
&i.SiteID,
|
||||
&i.HtmlContent,
|
||||
&i.OriginalTemplate,
|
||||
&i.Type,
|
||||
&i.CreatedAt,
|
||||
&i.CreatedBy,
|
||||
&i.CurrentHtmlContent,
|
||||
@@ -113,7 +109,7 @@ func (q *Queries) GetAllVersionsForSite(ctx context.Context, arg GetAllVersionsF
|
||||
}
|
||||
|
||||
const getContentVersion = `-- name: GetContentVersion :one
|
||||
SELECT version_id, content_id, site_id, html_content, original_template, type, created_at, created_by
|
||||
SELECT version_id, content_id, site_id, html_content, original_template, created_at, created_by
|
||||
FROM content_versions
|
||||
WHERE version_id = ?1
|
||||
`
|
||||
@@ -127,7 +123,6 @@ func (q *Queries) GetContentVersion(ctx context.Context, versionID int64) (Conte
|
||||
&i.SiteID,
|
||||
&i.HtmlContent,
|
||||
&i.OriginalTemplate,
|
||||
&i.Type,
|
||||
&i.CreatedAt,
|
||||
&i.CreatedBy,
|
||||
)
|
||||
@@ -135,7 +130,7 @@ func (q *Queries) GetContentVersion(ctx context.Context, versionID int64) (Conte
|
||||
}
|
||||
|
||||
const getContentVersionHistory = `-- name: GetContentVersionHistory :many
|
||||
SELECT version_id, content_id, site_id, html_content, original_template, type, created_at, created_by
|
||||
SELECT version_id, content_id, site_id, html_content, original_template, created_at, created_by
|
||||
FROM content_versions
|
||||
WHERE content_id = ?1 AND site_id = ?2
|
||||
ORDER BY created_at DESC
|
||||
@@ -163,7 +158,6 @@ func (q *Queries) GetContentVersionHistory(ctx context.Context, arg GetContentVe
|
||||
&i.SiteID,
|
||||
&i.HtmlContent,
|
||||
&i.OriginalTemplate,
|
||||
&i.Type,
|
||||
&i.CreatedAt,
|
||||
&i.CreatedBy,
|
||||
); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user