feat(site-builder): version history modal with preview and restore

Adds a site.history command (WHP mode, only when history_list answers) opening
a modal of saves/publishes by day. Preview opens the snapshot re-exported with
its own design; Restore site / Restore one page load the snapshot as unsaved
state (history cleared, dirty marked) so the user still clicks Save.

Refs #51

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
shadowdaoandClaude Sonnet 5.5 committed 2026-10-07 12:04:17 -07:00
1 parent 5430f13877
commit a9c8f4d65a
8 files changed
+947

No files matched your search

+62
View File
@@ -2731,3 +2731,65 @@ body {
color: var(--color-text);
cursor: pointer;
}
/* ==== #51 version history ==== */
.wsb-history-modal {
width: min(640px, calc(100vw - 32px));
max-height: calc(100vh - 64px);
display: flex;
flex-direction: column;
background: var(--color-bg-surface);
color: var(--color-text);
border: 1px solid var(--color-border);
border-radius: var(--radius-lg, 8px);
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.wsb-history-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 16px;
border-bottom: 1px solid var(--color-border);
}
.wsb-history-title { margin: 0; font-size: 15px; font-weight: 600; }
.wsb-history-close { background: transparent; border: 0; color: var(--color-text-muted); cursor: pointer; padding: 4px 6px; }
.wsb-history-close:hover { color: var(--color-text); }
.wsb-history-body { padding: 8px 16px 16px; overflow-y: auto; }
.wsb-history-empty { color: var(--color-text-muted); font-size: 13px; }
.wsb-history-day-title {
margin: 14px 0 6px;
font-size: 11px;
font-weight: 600;
letter-spacing: 0.06em;
text-transform: uppercase;
color: var(--color-text-dim);
}
.wsb-history-list, .wsb-history-pages { list-style: none; margin: 0; padding: 0; }
.wsb-history-row { padding: 6px 0; border-bottom: 1px solid var(--color-border); font-size: 13px; }
.wsb-history-row-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wsb-history-badge {
font-size: 11px;
padding: 1px 8px;
border-radius: var(--radius-sm);
border: 1px solid var(--color-border);
color: var(--color-text-muted);
}
.wsb-history-badge-publish { color: var(--color-accent); border-color: var(--color-accent); }
.wsb-history-time { color: var(--color-text); }
.wsb-history-actions { margin-left: auto; display: inline-flex; gap: 6px; flex-wrap: wrap; }
.wsb-history-modal button:not(.wsb-history-close) {
font: inherit;
font-size: 12px;
padding: 3px 9px;
color: var(--color-text);
background: var(--color-bg-hover);
border: 1px solid var(--color-border);
border-radius: var(--radius-sm);
cursor: pointer;
}
.wsb-history-modal button:disabled { opacity: 0.5; cursor: default; }
.wsb-history-modal .wsb-history-primary { border-color: var(--color-accent); }
.wsb-history-pending { margin-top: 8px; padding: 8px 10px; background: var(--color-bg-hover); border-radius: var(--radius-sm); }
.wsb-history-pending p { margin: 0 0 8px; }
.wsb-history-pending > button { margin-right: 6px; }
.wsb-history-pages { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }