editor: friendlier panels - collapsible rail, remembered state, no more overlap

Rail sections (Outline/Blocks/Nodes) collapse via their headers like
Experiments already did, so long pages stay navigable. Rail open state
and section toggles persist in localStorage across reloads (the QA
preview flow reloads constantly). The assistant panel shifts left while
the dev panel is open instead of stacking exactly underneath it, and
the rail/dev/assistant widths cap at the viewport on small screens.

Tests: rail-sections harness (collapse, reload persistence, shifted
assistant); harness boots with a fresh profile unless keepStorage is
passed; in-memory localStorage shim for the origin-less jsdom.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
mats committed 2026-11-07 12:37:09 +01:00
1 parent 5786712078
commit bb875a0956
10 files changed
+185 -20

No files matched your search

+4 -1
View File
@@ -20,7 +20,10 @@ export interface Harness {
}
/** `stale`: the DOM is the *published* page, and the store has moved on since (the base-page problem). */
export async function setup(opts: { token?: string; auth?: boolean; stale?: boolean; noPreviewApi?: boolean } = {}): Promise<Harness> {
export async function setup(opts: { token?: string; auth?: boolean; stale?: boolean; noPreviewApi?: boolean; keepStorage?: boolean } = {}): Promise<Harness> {
// Fresh profile by default: remembered panel state must not leak between tests.
// Pass keepStorage to simulate a reload with the same profile.
if (!opts.keepStorage) localStorage.clear()
const cms = createMockCms({ token: opts.token, auth: opts.auth })
document.head.innerHTML = ''
window.open = () => null