fix(workbench): dock the preview behind Layers in the Edit rail again - #208
fix(workbench): dock the preview behind Layers in the Edit rail again#208lstein wants to merge 3 commits into
Conversation
The right-rail dock fold (30de929) shipped the Edit rail as the Layers panel alone, and its migration rewrote legacy default rails to that shape — which removed the preview widget from the rail the float/dock pair and the floated Invoke control live in. The capability was never deleted, but its default home was, and existing projects were swept to match. Ship the preview as the second tab behind Layers again, and treat the brief Layers-only rail as a shipped shape so projects that already adopted it get the preview back on load. Customized rails stay untouched. Co-Authored-By: Claude Code <noreply@anthropic.com>
…t floated from The float pair refused the last enabled center view in both the UI and the reducer, on the theory that floating it out is the same removal as closing — the work surface would stand with nothing to show. But a float keeps the view one dock click away, the emptied surface falls back to the center's fallback view, and rails already allow floating their last widget (they collapse). Only the destructive placements — close and toggle — keep their refusal. One instance may also be a member of several regions (the preview is placed in the center and a rail), and the float's host-region guess — the first member region in the region map's order, which persisted projects do not agree on — could detach the rail's membership when the button clicked was the center's. The region whose chrome was clicked now rides along in the action, and the window docks back into it. Co-Authored-By: Claude Code <noreply@anthropic.com>
… re-selects Adversarial review of the last-center-view float found two live corruptions and one invariant gap, each verified by executing the reducer: - ensureCenterRegion read an explicitly emptied center as missing data and refilled the default arrangement on every reload, injecting a Gallery view the project never placed — permanently, and into the sync baseline. A present center is now authoritative even when empty; the refilled pointer still names the floated instance so the boot preload keeps the window's chunk ready. - saveLayoutPreset normalized the live project before snapshotting, so the same refill baked the phantom view into a saved preset. Fixed with the refill change. - selectRegionWidget could set a region's active instance to a widget that was floating — the rail would render it alongside its window, the exact shape openRegionWidget's invariant forbids. Selecting a slot now docks. - the normalization test fed a shape the reducer never produces; it now drives the real persisted sole-view shape through a JSON round trip. Co-Authored-By: Claude Code <noreply@anthropic.com>
Adversarial reviewTwo contracts this PR introduces are load-bearing and neither is enforced:
Everything below was reproduced by driving the reducer on 1. Floating the preview out of the Edit rail and reloading permanently deletes it from the center
Preview is silently and permanently gone from the center view menu; the user has to re-add it through "Add To Center". Note the asymmetry with finding 3 — the rail self-heals on the next load via the new 2. An emptied center is now permanent, with a dangling pointer and no window to dock
The instance itself is fine (it is docked in the rail and usable). What is stranded is the center: a permanently empty work surface with a pointer naming a non-member, recoverable only through "Add To Center". None of
Narrow fix: keep the empty center only when 3. The
|
Summary
PR #180's preview float/dock pair and the floated-window Invoke control were never deleted — commit 30de929 (the right-rail dock fold) removed the preview widget from the Edit preset's right rail (
['layers', 'preview', 'gallery', 'image-map', 'queue']→['layers']) and its migration rewrote existing projects' legacy default rails to that Layers-only shape. With the preview no longer placed in the rail, its float icon and the floated Invoke titlebar were simply unreachable there.This PR restores the preview to the Edit rail, and then restores the center-panel float experience the same commit-era work had constrained:
fix(workbench): dock the preview behind Layers in the Edit rail again— the Edit preset ships['layers', 'preview']; the migration treats the brief Layers-only rail as another shipped shape, so already-swept projects get the preview back on load. Customized rails are untouched.feat(workbench): float the last center view, and dock it back where it floated from— the float pair no longer refuses the last enabled center view (the emptied surface falls back to the center's fallback view; only the destructive close/toggle keep their refusal), and the float records which region's chrome it was asked from, so floating the preview from the center docks it back into the center — not into the right rail it also belongs to.fix(workbench): honour an emptied center across reloads, presets, and re-selects— adversarial review found the emptied center was refilled with the default arrangement on reload (injecting a phantom Gallery view) and baked into saved presets;selectRegionWidgetcould also reveal a floated instance alongside its window. All fixed and pinned by tests.Test plan
pnpm test— 509 files / 7429 tests pass;test:browser— 158 files / 1036 tests pass;test:fixturespasspnpm lint(oxfmt, oxlint, tsc, architecture) clean;vite build+ both performance gates exit 0 against the committed baselines (no re-record needed)Known follow-ups (pre-existing, out of scope here)
ensureRightRegioncan leave a danglingactiveInstanceIdwhen rewriting the pre-image-map default rail, leaving the right panel empty until a tab is clicked.layoutPresetOverrides[edit]with a Layers-only rail) bypass the rail migration.🤖 Generated with Claude Code