Skip to content

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

Closed
Limdongcheng wants to merge 1 commit into
mainfrom
fix/task-card-geometry
Closed

fix(ui): stop task cards teleporting when a sidebar toggles#2
Limdongcheng wants to merge 1 commit into
mainfrom
fix/task-card-geometry

Conversation

@Limdongcheng

Copy link
Copy Markdown
Owner

Root cause

fit_layout translated a card rigidly with its anchored boundary's displacement: hiding the secondary sidebar teleported every right-anchored card by the full sidebar width even when the card was parked mid-board, and the user then had to drag it all the way back. Drag origins were taken from the stored layout rect, which no longer matched what was on screen — the first stretch of a drag was spent "catching up" the discrepancy.

Fix

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.
  • 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 the rendered position.

Tests

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. cargo pr-check passes.


Part 1 of a 6-PR stack (task-card geometry → clickable affordance → H/F fits → peak snap → peaks follow reference → reference on-plot pick).

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.
@github-actions

Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

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.

1 participant