feat(builder): implement visual homepage builder

New HomepageOverviewComponent (Tasks 1+8), mounted at the top of the
existing Homepage section page: completion ring, active/hidden section
counts, recommended next step, last-modified timestamp, and a 6-item
Homepage Health checklist (hero/categories/products/promotion/
newsletter/any-sections) - all derived from the real page.sections/
widgets data already in the facade, nothing fabricated.

Existing page-level drag-and-drop reordering (homepage-section's
CdkDragDrop over page.sections) was already implemented pre-Sprint 5 -
left as-is per "build on top of, do not replace."

Widgets section (Task 2) rewritten from a bare list into visual cards:
per-widget icon + humanized type label (hero/categories/product-
collection), a visible/hidden toggle and badge, up/down move buttons
(keyboard-accessible reorder within a section - see Known limitations
for why this replaces pointer drag for widgets specifically), duplicate,
and remove (with confirm). The existing per-type field editors (hero/
categories/product-collection) are unchanged; the raw-JSON fallback for
unknown widget types now sits behind a collapsed "Advanced settings"
disclosure instead of being the default view.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
sdarbinyan
2026-07-18 10:24:13 +04:00
parent a83cfdfe4d
commit 04b36bab9b
12 changed files with 551 additions and 19 deletions

View File

@@ -0,0 +1,96 @@
.widget-card--hidden {
opacity: 0.6;
}
.widget-card__header {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: var(--space-sm);
margin-bottom: var(--space-sm);
}
.widget-card__icon {
font-size: 1.25rem;
color: var(--primary-color);
flex-shrink: 0;
}
.widget-card__title {
margin: 0;
font-size: 1.125rem;
font-weight: 600;
color: var(--text-primary);
flex: 1 1 auto;
min-width: 120px;
}
.widget-card__hidden-badge {
font-size: 0.7rem;
font-weight: 600;
letter-spacing: 0.4px;
text-transform: uppercase;
padding: 2px 8px;
border-radius: var(--radius-sm);
background: var(--bg-tertiary);
color: var(--text-light);
}
.widget-card__actions {
display: flex;
align-items: center;
gap: var(--space-xs);
flex-wrap: wrap;
button {
display: inline-flex;
align-items: center;
justify-content: center;
width: 34px;
height: 34px;
border: 1px solid var(--border-color);
border-radius: var(--radius-sm);
background: var(--bg-primary);
color: var(--text-secondary);
cursor: pointer;
&:hover:not(:disabled) {
border-color: var(--primary-color);
color: var(--primary-color);
}
&:focus-visible {
outline: 2px solid var(--primary-color);
outline-offset: 2px;
}
&:disabled {
opacity: 0.4;
cursor: not-allowed;
}
}
}
.widget-card__remove:hover:not(:disabled) {
border-color: var(--error-color) !important;
color: var(--error-color) !important;
}
.widget-card__visible-toggle {
display: inline-flex;
align-items: center;
gap: var(--space-xs);
font-size: 0.75rem;
color: var(--text-secondary);
}
.widget-card__advanced {
margin-top: var(--space-sm);
summary {
cursor: pointer;
font-size: 0.75rem;
font-weight: 600;
color: var(--text-light);
}
}