Repository navigation
feat(timeline): Alt-click a layer's eye, padlock or outline button to set every other layer - #816
ashokram-si wants to merge 3 commits into
Conversation
… set every other layer layer.toggle_visible, layer.toggle_lock and layer.toggle_outline take others: true: every layer but this one, what it holds, the folders it is in and the camera, in one undo step. The timeline row buttons run it on Alt-click and say what happened in the status bar. Fixes storytold#804.
…when there is no other layer Hiding the mask over the clicked layer showed it unmasked. The layers it is in now come from Timeline::is_inside (folders and masks, depth-limited) instead of a walk that kept folders only. With no other layer the status bar says so rather than reporting a change. Tests: the mask, a folder in a folder, and a forced no-op leaving no undo step.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Alt-click on a layer's eye, padlock or outline button now hides, locks or outlines every other layer, and Alt-click again brings them back.
Fixes #804.
What the user saw: to work on one layer alone, you had to click the eye (or padlock) on each of the other layers in turn, and click them all again afterwards. The eye above the layers sets every layer, the one you want included.
Cause: the row buttons only ran
layer.toggle_visible,layer.toggle_lockandlayer.toggle_outlinefor their own layer, and those commands had no "every layer but this one" mode.What changed:
others: true: every other layer, leaving alone the camera, what this one holds (a folder's layers, a mask's masked layers) and the folders and mask it is in. If any of the layers it sets is in the normal state (showing, unlocked, showing its artwork), they all go the other way; once none is, they all go back.onstill forces a state. It is one command, so one undo step.allandotherstogether are refused.Timeline::is_inside; so do the layers inside a folder or mask the user clicked. The camera stays as it is, as with the eye above the layers.others: trueand says what happened in the status bar ("Every other layer hidden (Alt-click again to show them)" and so on, or "No other layer to change" when there is none). The three buttons now have hover text that mentions the Alt-click; the outline one keeps its old text with the hint added, so its existing translations fall back to English until craft-i18n catches up. This follows the onion button's Alt-click, which already sets one layer against all the others.Tests (
crates/engine/src/layer_order_tests.rs:an_alt_click_shows_locks_and_outlines_every_other_layer,an_alt_click_spares_the_mask_over_the_layer_and_a_folder_in_a_folder):onforced to where the others already are changes nothing and leaves no empty undo step (the next undo takes back the Alt-click before it).allwithothersis refused.Verification (macOS arm64, on main 0e1fa19):
cargo clippy --all-targets -- -D warnings: clean.cargo test -p anicraft-doc -p anicraft-engine -p anicraft-cli --no-fail-fast: all pass (doc 393, engine 932 and its integration tests, cli 30 and 38). In one full run the recovery testsa_save_then_clear_leaves_no_copyandunclean_finish_keeps_the_work_for_next_timetimed out under load; they pass run alone, and the first is Flaky test: recovery::tests::a_save_then_clear_leaves_no_copy under a full engine test run #802.cargo test -p anicraft: 557 pass, the translation checks included.timeline::tests::the_header_fits_at_the_default_window_sizefails on main here too (this machine lacks some craft-fonts files).ANICRAFT_BLESS_GUIDE=1 cargo test -p anicraft guide_reference.Accessibility: no new control. The eye, padlock and square keep their checkbox role and names; Alt-click is a shortcut for clicks already reachable one layer at a time, and the scripted
othersoption gives the same result without a pointer. The hover texts and status messages go throughtr!, in existing text roles. Not checked with a screen reader.Summary by CodeRabbit