replace admin rail with unified bottom sheet editor
All checks were successful
deploy / deploy (push) Successful in 1m30s

- add editor sheet component anchored bottom (mobile) / right (desktop)
- admin cog moves to header, always visible for admins
- remove Done button from editor header, keep only Save
- add editor_at_defaults tracking to disable Reset when at defaults
- sheet collapses on click outside or Escape, stays in edit mode
- dirty indicator + beforeunload warning for unsaved changes
- keyboard shortcuts: Ctrl+Z undo, Ctrl+Shift+Z redo
- WCAG compliant: aria-expanded, live region, focus management

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
jamey
2026-03-07 09:30:07 +00:00
parent dbcecc7878
commit f4f036b84b
12 changed files with 1232 additions and 474 deletions

View File

@@ -1089,6 +1089,7 @@
align-items: center;
position: relative;
z-index: 1;
margin-left: auto;
}
.header-icon-btn {
@@ -1145,66 +1146,161 @@
}
}
/* ── Mobile bottom nav ── */
/* ── Hamburger menu button (mobile only) ── */
.mobile-bottom-nav {
position: fixed;
bottom: 0;
inset-inline: 0;
z-index: 100;
background-color: var(--t-surface-raised);
border-top: 1px solid var(--t-border-default);
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
padding-bottom: env(safe-area-inset-bottom, 0px);
.header-hamburger {
display: flex;
align-items: center;
justify-content: center;
width: 2.5rem;
height: 2.5rem;
background: none;
border: none;
cursor: pointer;
color: var(--t-text-secondary);
border-radius: var(--t-radius-button);
margin-right: 0.5rem;
flex-shrink: 0;
& ul {
display: flex;
justify-content: space-around;
align-items: center;
height: 4rem;
margin: 0;
padding: 0;
list-style: none;
&:hover {
background: var(--t-surface-sunken);
}
& li {
flex: 1;
& svg {
width: 1.5rem;
height: 1.5rem;
}
@media (min-width: 768px) {
display: none;
}
}
.mobile-nav-link {
/* ── Mobile nav drawer ── */
.mobile-nav-drawer {
position: fixed;
inset: 0;
z-index: 1000;
pointer-events: none;
visibility: hidden;
}
.mobile-nav-drawer.is-open {
pointer-events: auto;
visibility: visible;
}
.mobile-nav-backdrop {
position: absolute;
inset: 0;
background: rgba(0, 0, 0, 0.4);
opacity: 0;
transition: opacity 0.2s ease;
}
.mobile-nav-drawer.is-open .mobile-nav-backdrop {
opacity: 1;
}
.mobile-nav-panel {
position: absolute;
top: 0;
left: 0;
bottom: 0;
width: 280px;
max-width: 85vw;
background: var(--t-surface-base);
transform: translateX(-100%);
transition: transform 0.25s ease;
display: flex;
flex-direction: column;
overflow-y: auto;
}
.mobile-nav-drawer.is-open .mobile-nav-panel {
transform: translateX(0);
}
.mobile-nav-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 1rem;
border-bottom: 1px solid var(--t-border-default);
}
.mobile-nav-title {
font-family: var(--t-font-heading);
font-size: var(--t-text-lg);
font-weight: 600;
color: var(--t-text-primary);
}
.mobile-nav-close {
display: flex;
align-items: center;
justify-content: center;
gap: 0.25rem;
padding-block: 0.5rem;
margin-inline: 0.25rem;
min-height: 56px;
border-radius: var(--t-radius-card, 0.5rem);
font-size: var(--t-text-caption);
width: 2.5rem;
height: 2.5rem;
background: none;
border: none;
cursor: pointer;
color: var(--t-text-secondary);
text-decoration: none;
font-weight: 500;
background-color: transparent;
border-radius: var(--t-radius-button);
& svg {
width: 1.25rem;
height: 1.25rem;
&:hover {
background: var(--t-surface-sunken);
}
}
.mobile-nav-links {
list-style: none;
margin: 0;
padding: 0.5rem 0;
}
.mobile-nav-drawer .mobile-nav-link {
display: block;
padding: 0.875rem 1.25rem;
color: var(--t-text-primary);
text-decoration: none;
font-size: var(--t-text-base);
font-weight: 500;
transition: background 0.15s ease;
&:hover {
background: var(--t-surface-sunken);
}
&[aria-current="page"] {
color: color-mix(in oklch, var(--t-accent) 80%, black);
font-weight: 600;
background-color: color-mix(in oklch, var(--t-accent) 10%, transparent);
& svg {
width: 1.5rem;
height: 1.5rem;
}
color: var(--t-accent);
background: color-mix(in oklch, var(--t-accent) 8%, transparent);
}
}
.mobile-nav-section {
padding-top: 0.5rem;
border-top: 1px solid var(--t-border-default);
margin-top: 0.5rem;
}
.mobile-nav-section-title {
display: block;
padding: 0.5rem 1.25rem;
font-size: var(--t-text-sm);
font-weight: 600;
color: var(--t-text-secondary);
text-transform: uppercase;
letter-spacing: 0.05em;
}
/* ── Mobile bottom nav (REMOVED - replaced by hamburger drawer) ── */
.mobile-bottom-nav {
display: none;
}
/* ── Search modal ── */
.search-modal {
@@ -2356,13 +2452,7 @@
/* ── Flash messages ── */
.shop-flash-group {
position: fixed;
top: 1rem;
inset-inline-end: 1rem;
z-index: 200;
display: flex;
flex-direction: column;
gap: 0.5rem;
/* document flow — pushes content down, no overlay */
}
.shop-flash {
@@ -2370,10 +2460,6 @@
align-items: center;
gap: 0.75rem;
padding: 0.75rem 1rem;
border-radius: var(--t-radius-card);
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
max-width: 24rem;
animation: flash-in 0.3s ease-out;
background-color: var(--t-surface-raised, #fff);
color: var(--t-text-primary);
@@ -2384,11 +2470,11 @@
}
.shop-flash--info {
border: 1px solid var(--t-border-default);
border-bottom: 1px solid var(--t-border-default);
}
.shop-flash--error {
border: 1px solid hsl(0 70% 50% / 0.3);
border-bottom: 1px solid hsl(0 70% 50% / 0.3);
}
.shop-flash-icon {
@@ -2405,11 +2491,6 @@
color: hsl(0 70% 50%);
}
@keyframes flash-in {
from { opacity: 0; transform: translateX(1rem); }
to { opacity: 1; transform: translateX(0); }
}
/* Transition classes for JS.hide flash dismiss */
.fade-out { transition: opacity 200ms ease-out; }
.fade-out-from { opacity: 1; }