Floating dock panels are silently lost on reload #102
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lz/agent-nexus#102
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pre-existing bug, split out of issue #96 as design D8 (the spec explicitly scoped it to its own issue and PR rather than letting it ride a feature branch).
Symptom
Shift-drag a panel out of the dock to float it, reload the page — the panel is gone. No error, no watermark clue, nothing in the console. The gesture works; the result does not survive.
Cause
stripArtifactPanels(nexus/src/lib/dock/layout.ts) rebuilds aSerializedDockviewwith onlygrid/panels/activeGroupon the way to localStorage, deliberately droppingfloatingGroups:disableFloatingGroupsis never set inDock.svelte, so shift-drag floats a panel today. The combination is the worst one available: floating is enabled and unpersisted.Why nobody noticed
layout.test.tspinned the dropping behaviour and passed. A green test was actively concealing the bug — it took an audit reading the spec against the code to surface it.Fix
Repair floats instead of dropping them, the same treatment
gridalready gets: a float loses only the views actually stripped, one that loses all of them is removed, one that keeps some is kept with the survivors.Three details a naive
.data.viewsfilter misses:datafor a single group,gridfor a nested layout of several (seeSerializedFloatingGroup). Handling onlydatasilently discards every multi-group float.activeGroupcan name a floating group, so surviving ids must be collected from kept floats too.popoutGroups/edgeGroupskeep being dropped — popouts need astatic/popout.htmlthat does not exist, and neither is reachable from the UI, so nothing is silently lost there.Known limitation, not fixed
The float's position. dockview passes the stored position to
addFloatingGroup, butconstrainBounds()runs immediately after deserialization and callsoverlay.setBounds(), re-clamping against a container that may not be measured yet. In a harness the restored float landed at the dock origin and the next save then persisted0,0. Whether that reproduces for a float created by a real shift-drag needs a manual check; it is dockview-side and outside what D8 prescribes.Fixed by PR #103.