Skip to content

Guides: Lock Guides keeps guides deselected after Undo, Exit Isolation Mode and Paste - #2629

Merged
bflatastic merged 1 commit into
storytold:mainfrom
dotCooCoo:fix/exit-isolation-keeps-lock-guides
Oct 17, 2026
Merged

bflatastic merged 1 commit into
storytold:mainfrom
dotCooCoo:fix/exit-isolation-keeps-lock-guides

Conversation

@dotCooCoo

Copy link
Copy Markdown
Contributor

What and why

With View › Guides › Lock Guides on, Session::select drops the paths made into guides from the selection (#1534),
but commands that set the selection another way skipped that filter and left a locked guide selected, so the next
move moved it. On main, with Lock Guides on, object.exitIsolation after object.isolate {id} on a guide path
selects the guide, and object.move then moves it. Undo, Redo, a canceled undo group, a canceled drag or dialog
preview and a failed command.batch brought back locked guide paths and ruler guides in the selection. Unlock All,
Show All and Paste selected the guide paths they unlocked, showed or pasted. Locking the guides deselected them in the
active document only.

The filter is now deselect_guides in crates/engine/src/lib.rs, which also clears the selected ruler guides.
Session::select and Session::edit run it while Lock Guides is on, and so do object.exitIsolation, Undo, Redo,
Session::cancel_interaction, a canceled undo group and a failed batch. Locking the guides deselects them in every
open document. With Lock Guides off, the selection is set as before. The params text of view.guides.lock and the
guides paragraph of docs/mcp.md describe this.

How it was tested

  • tests_menucmds::exit_isolation_leaves_a_locked_guide_path_deselected: nothing is selected and a move leaves the
    guide in place; with Lock Guides off the guide is selected.
  • tests_menucmds::undo_and_redo_leave_locked_guides_deselected: a guide path and a ruler guide stay deselected and
    in place.
  • tests_menucmds::unlock_all_show_all_and_paste_leave_locked_guide_paths_deselected
  • tests_menucmds::lock_guides_deselects_the_guides_of_every_open_document
  • tests_menucmds::a_failed_batch_and_a_canceled_undo_group_leave_locked_guides_deselected
  • tests_menucmds::a_canceled_interaction_leaves_locked_guides_deselected

Each test fails with its part of the change taken out. Targeted checks: clippy, cargo fmt, the engine library
(2,254 passed), and cargo xtask brands, layers and assets.

On Windows 11 (x86-64) with rustc 1.99.0, on top of main at 8bc6532:

  • CRAFT_FONTS_DIR=<craft-fonts checkout> cargo xtask ci passes its 9 steps: 7,370 tests passed, 0 failed, 11 ignored.

git merge-tree reports no conflicts with main at 8bc6532. With #2592, exit_isolation, Session::edit, Undo, Redo
and the canceled undo group conflict: keep both, with deselect_guides before #2592's protect_locked_artboards or
sync_new_art call. With #1987, keep its pub(crate) fn exit_isolation; with #1281, call deselect_guides after its prune_found.

Checklist

  • cargo xtask ci passes (fmt, clippy, tests, assets, brands, layers, wasm).
  • No panics in shipped code: no unwrap(), expect(), panic!, unreachable!, todo! or
    unimplemented! outside tests, and no unchecked indexing on data from files, parameters or
    messages. Errors are returned as Result and shown to the user
    (why and how).
  • Clean-room: nothing copied from Adobe products or GPL/AGPL code (AGENTS.md).
  • Every new asset has a row in ASSETS.md.

…n Mode and Paste

With View > Guides > Lock Guides on, Session::select drops the paths
made into guides from the selection (storytold#1534), but commands that set the
selection another way skipped that filter and left a locked guide
selected, so the next move moved it. object.exitIsolation selected an
isolated guide path. Undo, Redo, a canceled undo group, a canceled
drag or dialog preview and a failed command.batch brought back locked
guide paths and ruler guides in the selection. Unlock All, Show All
and Paste selected the guide paths they unlocked, showed or pasted.
Locking the guides deselected them in the active document only.

The filter is now deselect_guides, which also clears the selected
ruler guides. Session::select and Session::edit run it while Lock
Guides is on, and so do object.exitIsolation, Undo, Redo,
Session::cancel_interaction, a canceled undo group and a failed batch.
Locking the guides deselects them in every open document. With Lock
Guides off, the selection is set as before.

Docs: docs/mcp.md.
@bflatastic
bflatastic force-pushed the fix/exit-isolation-keeps-lock-guides branch from 3e8832d to 30c5bd3 Compare October 17, 2026 10:16
@bflatastic
bflatastic merged commit 21dc3bf into storytold:main Oct 17, 2026
2 of 3 checks passed
@bflatastic

Copy link
Copy Markdown
Member

Thanks @dotCooCoo, merged. It went through the full gate (fmt, clippy, tests, layers, wasm) in a batch with the other PRs landed today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants