feat(ui): collapsible sidebar + rail, off-canvas mobile drawers, responsive layout
- Left sidebar collapses (topbar menu button); rail collapses (topbar button + strip). - <=860px / portrait: sidebar + rail become off-canvas drawers over main with a scrim, closed by default; main goes full-width single-column. - Smooth transitions; crossing the breakpoint resets to a sane default. - New components/chrome.js owns toggle + drawer state. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -240,3 +240,65 @@ ul.plain li:last-child { border-bottom: none; }
|
||||
.tile.status-unknown .dot { background: var(--muted); }
|
||||
.tile-go { color: var(--lb); font-size: 11px; opacity: 0; transition: opacity .25s; }
|
||||
.tile:hover .tile-go { opacity: 1; }
|
||||
|
||||
/* ===== Collapsible chrome + responsive layout (Plan 6 polish) ===== */
|
||||
:root { --sidebar-w-min: 0px; }
|
||||
#shell { transition: grid-template-columns .22s ease; }
|
||||
#sidebar, #rightrail { transition: transform .22s ease; }
|
||||
|
||||
/* Desktop collapse — shrink the grid columns */
|
||||
#shell.sidebar-collapsed { grid-template-columns: var(--sidebar-w-min) 1fr var(--rail-w); }
|
||||
#shell.sidebar-collapsed.rail-collapsed { grid-template-columns: var(--sidebar-w-min) 1fr var(--rail-w-min); }
|
||||
#shell.rail-collapsed { grid-template-columns: var(--sidebar-w) 1fr var(--rail-w-min); }
|
||||
#shell.sidebar-collapsed #sidebar { overflow: hidden; border-right: none; }
|
||||
/* Hide chat body when the rail is collapsed so the thin strip stays clean */
|
||||
#shell.rail-collapsed .rail-chat { display: none; }
|
||||
|
||||
/* Topbar toggle buttons */
|
||||
.chrome-toggle {
|
||||
background: transparent; border: 1px solid var(--border); color: var(--text);
|
||||
width: 34px; height: 30px; border-radius: 4px; cursor: pointer; font-size: 15px; line-height: 1; flex: none;
|
||||
}
|
||||
.chrome-toggle:hover { border-color: var(--accent-dim); color: var(--accent); }
|
||||
|
||||
/* Scrim behind mobile drawers */
|
||||
#scrim {
|
||||
position: fixed; inset: var(--topbar-h) 0 0 0; background: rgba(0,0,0,.5);
|
||||
z-index: 40; opacity: 0; pointer-events: none; transition: opacity .22s;
|
||||
}
|
||||
body.drawer-open #scrim { opacity: 1; pointer-events: auto; }
|
||||
|
||||
/* Hide the chat-only toggle button on wide screens (rail has its own strip);
|
||||
show it on narrow screens where the rail is an off-canvas drawer. */
|
||||
.rail-toggle-btn { display: none; }
|
||||
|
||||
/* ---- Narrow / mobile / vertical: off-canvas drawers, single-column main ---- */
|
||||
@media (max-width: 860px) {
|
||||
#shell,
|
||||
#shell.sidebar-collapsed,
|
||||
#shell.rail-collapsed,
|
||||
#shell.sidebar-collapsed.rail-collapsed {
|
||||
grid-template-columns: 1fr;
|
||||
grid-template-areas: "topbar" "main";
|
||||
}
|
||||
#sidebar, #rightrail {
|
||||
position: fixed; top: var(--topbar-h); bottom: 0; z-index: 50;
|
||||
}
|
||||
#sidebar { left: 0; width: min(82vw, 300px); transform: translateX(-100%); border-right: 1px solid var(--border); }
|
||||
#rightrail{ right: 0; width: min(90vw, 360px); transform: translateX(100%); }
|
||||
/* A drawer is OPEN when its collapse class is absent */
|
||||
#shell:not(.sidebar-collapsed) #sidebar { transform: translateX(0); box-shadow: 6px 0 28px rgba(0,0,0,.6); }
|
||||
#shell:not(.rail-collapsed) #rightrail{ transform: translateX(0); box-shadow: -6px 0 28px rgba(0,0,0,.6); }
|
||||
#shell:not(.rail-collapsed) .rail-chat { display: flex; flex-direction: column; height: 100%; }
|
||||
#main { padding: 16px 18px; }
|
||||
.topbar-search { max-width: none; }
|
||||
.rail-toggle-btn { display: inline-block; }
|
||||
}
|
||||
|
||||
/* Very narrow phones — tighten the topbar so toggles + search fit */
|
||||
@media (max-width: 520px) {
|
||||
#topbar { padding: 0 8px; gap: 8px; }
|
||||
.brand { display: none; }
|
||||
#main { padding: 14px 12px; }
|
||||
/* Sacred Valley cards already collapse to 1 column at <=900px (see grid rules) */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user