Skip to content

fix(ui): stop task cards teleporting when a sidebar toggles - #71

Merged
nmrtist merged 1 commit into
nmrtist:mainfrom
Limdongcheng:fix/task-card-geometry
Aug 29, 2026
Merged

fix(ui): stop task cards teleporting when a sidebar toggles#71
nmrtist merged 1 commit into
nmrtist:mainfrom
Limdongcheng:fix/task-card-geometry

Conversation

@Limdongcheng

@Limdongcheng Limdongcheng commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

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_layout translated a card rigidly with its anchored boundary's displacement, and drag origins were taken from the stored layout rect rather than the rendered one. CardLayout now 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-check passes (fmt, source sizes, dependency policy, default-frontends build, clippy -D warnings, reference-backend test suite).
  • New 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 (task_card_tests.rs).
  • Merge with current main is conflict-free (git merge-tree clean).

UI display logic

  • New or changed actions go through the command catalog (CommandId + describe) and are searchable in the command palette. (No actions added or changed.)
  • Hiding happens only at Ribbon-group level (dataset kind or width budget); transient states disable with a disabled_reason that says how to unblock. (No show/hide logic touched.)
  • No layout changes from background events; panels are never auto-closed. (Card geometry now reacts only to explicit sidebar toggles and user drags.)
  • New panels or empty regions show an empty state with a next step. (No new panels.)
  • Docs updated in docs/ (English and zh-CN) for user-visible behavior. (Bug fix restoring intended drag behavior; no documented behavior changed.)

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.
@nmrtist
nmrtist merged commit e5ff53e into nmrtist:main Aug 29, 2026
11 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants