fix(ui): stop task cards teleporting when a sidebar toggles - #71
Merged
Conversation
fit_layout translated a card rigidly with its anchored boundary's displacement, so hiding the secondary sidebar teleported every right-anchored card by the full sidebar width even when it was parked mid-board — the user then had to drag it all the way back. CardLayout now keeps the user-intended rectangle (`preferred`) separate from the fitted one: only an edge resting on a boundary follows that boundary (the default top-right docking), a parked card keeps its absolute position and is merely clamped inside the new bounds, and a card that a sidebar pushed aside returns to its place once the boundary recedes. Drag and resize gestures write both rectangles, so drag origins always match what is on screen. A full-render regression test drives sidebars, workspace geometry and the Processing card through a hide/drag sequence; fit-level tests pin the parked-stays-put and displaced-returns semantics.
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hiding the secondary sidebar teleported every right-anchored task card by the full sidebar width — even a card parked mid-board — and the first stretch of a subsequent drag was silently eaten while the drag origin "caught up" with the card's real position.
Root cause:
fit_layouttranslated a card rigidly with its anchored boundary's displacement, and drag origins were taken from the stored layout rect rather than the rendered one.CardLayoutnow keeps the user-intended rectangle (preferred) separate from the fitted one: only an edge actually resting on a boundary follows that boundary (the default top-right docking), a parked card keeps its absolute position and is merely clamped inside the new bounds, and a card a sidebar pushed aside returns to its place once the boundary recedes. Drag and resize gestures write both rectangles, so drag origins always match what is on screen.Validation
cargo pr-checkpasses (fmt, source sizes, dependency policy, default-frontends build, clippy-D warnings, reference-backend test suite).task_card_tests.rs).mainis conflict-free (git merge-treeclean).UI display logic
CommandId+describe) and are searchable in the command palette. (No actions added or changed.)disabled_reasonthat says how to unblock. (No show/hide logic touched.)docs/(English and zh-CN) for user-visible behavior. (Bug fix restoring intended drag behavior; no documented behavior changed.)