Skip to content

feat(timeline): Alt-click a layer's eye, padlock or outline button to set every other layer - #816

Open
ashokram-si wants to merge 3 commits into
storytold:mainfrom
ashokram-si:feat/alt-click-other-layers-804
Open

ashokram-si wants to merge 3 commits into
storytold:mainfrom
ashokram-si:feat/alt-click-other-layers-804

Conversation

@ashokram-si

@ashokram-si ashokram-si commented Dec 3, 2026 •

Copy link
Copy Markdown

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_lock and layer.toggle_outline for their own layer, and those commands had no "every layer but this one" mode.

What changed:

  • The three commands take 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. on still forces a state. It is one command, so one undo step. all and others together are refused.
  • What is left alone, and why: hiding or locking a folder the layer sits in would hide or lock the layer too, and hiding the mask over it would show it unmasked, so those keep their state, found with 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.
  • Timeline: Alt-click on a row's eye, padlock or square runs it with others: true and 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.
  • Guide: Timeline gets a paragraph on it; the command reference is regenerated.
  • CHANGELOG entry.

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):

  • Visible: Alt-click hides the others and leaves the clicked layer showing; again shows them; undo brings back the state before, in one step. A clicked layer that is itself hidden stays hidden.
  • Lock with one other layer already locked: Alt-click locks the rest, and again unlocks them all. Outline: Alt-click outlines the others.
  • Folders: an Alt-click on a layer inside a folder leaves the folder and the layer showing and hides the rest; an Alt-click on a folder leaves its layers alone.
  • Masks: an Alt-click on a masked layer leaves its mask showing, and one on the mask leaves the layer it masks. A folder in a folder: both stay shown.
  • on forced to where the others already are changes nothing and leaves no empty undo step (the next undo takes back the Alt-click before it).
  • The camera keeps its state.
  • all with others is 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 tests a_save_then_clear_leaves_no_copy and unclean_finish_keeps_the_work_for_next_time timed 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_size fails on main here too (this machine lacks some craft-fonts files).
  • The command reference was regenerated with ANICRAFT_BLESS_GUIDE=1 cargo test -p anicraft guide_reference.
  • Not run: the Windows and Linux builds (CI covers them); the Alt-click by hand in the running app.

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 others option gives the same result without a pointer. The hover texts and status messages go through tr!, in existing text roles. Not checked with a screen reader.

Summary by CodeRabbit

  • New Features
    • Alt-click a layer’s visibility, lock, or outline control to toggle the corresponding state across other layers. If any other layers are in their default state, they’re switched away from it; otherwise, they’re returned to it.
    • The selected layer, its contents, containing folders, applicable mask, and camera remain unchanged. Each Alt-click action can be reversed with one undo step.
  • Documentation
    • Added guidance for Alt-click behavior and the corresponding layer commands.

… 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.
@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Alt-clicking a layer’s visibility, lock, or outline control now applies the corresponding change to other layers. The timeline sends the others: true option and reports the resulting state or that no layers changed.

Changes: Alt-click layer controls

Layer / File(s) Summary
Other-layer toggle behavior
crates/engine/src/cmds_timeline.rs, crates/engine/src/layer_order_tests.rs, docs/guide/reference/commands.md
The engine applies visibility, lock, or outline changes to other layers. It supports an explicit on value and rejects combining others with all. Tests cover layer relationships, camera visibility, and no-change undo behavior. The command reference documents others?: true.
Timeline Alt-click integration
src/timeline.rs, docs/guide/timeline.md, CHANGELOG.md
Alt-click sends others: true and reports the resulting state or that no other layer changed. The guide and changelog describe the interaction and its undo behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant TimelineControls
  participant ToggleCommand
  User->>TimelineControls: Alt-click visibility, lock, or outline control
  TimelineControls->>ToggleCommand: Send layer ID and others: true
  ToggleCommand-->>TimelineControls: Return resulting state and changed count
  TimelineControls-->>User: Report the result or no layer changed
Loading

Suggested reviewers: tanish2k09

Merge Risk: Minimal · up to 31fa9

Alt-clicking the eye, padlock or outline button now changes all other layers and can be undone in one step. No defects were found in the inspected code, so the change looks safe to merge. Manual in-app testing was not run.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: Alt-click on a layer's eye, padlock, or outline button sets the same state on every other layer. The changeset adds the others: true option to the three toggle comma…
Linked Issues check Passed [#804] asks that Alt-click on a layer's visibility, lock, or outline button set that state on all other layers, and reverse it when the others already hold it. At the reviewed head, `crates/engine/src…
Out of Scope Changes check Passed The changes connect to the Alt-click behavior in #804. The others option in the three layer commands in cmds_timeline.rs implements the feature. The folder, mask, and camera exclusions keep the cl…
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names the main change: Alt-click on a layer's eye, padlock, or outline button sets the same state on every other layer. The changeset adds the others: true option to the three toggle commands, the UI Alt-click handling, docs, and tests, which matches the title's scope. The title uses the conventional commit prefix and is specific, so a teammate scanning history can identify the change.

Full details: Linked Issues check

Explanation

[#804] asks that Alt-click on a layer's visibility, lock, or outline button set that state on all other layers, and reverse it when the others already hold it. At the reviewed head, crates/engine/src/layer_order_tests.rs tests layer.toggle_visible, layer.toggle_lock, and layer.toggle_outline with others: true. The test an_alt_click_shows_locks_and_outlines_every_other_layer asserts that Alt-click hides the other layers while the clicked layer stays visible, and that a second Alt-click shows them again. It also asserts that the lock and outline cases toggle the others and toggle back, and that one undo restores the prior state. The PR description states that src/timeline.rs sends others: true on Alt-click. The additional rules (folder, mask, camera, and all with others refused) go beyond the issue text but do not conflict with it. Limit: the source diff for crates/engine/src/cmds_timeline.rs could not be read at the reviewed head within the output limit, so the handler logic is established from the test assertions and the PR description, not from the handler body. The tests were not run in this review.

Full details: Out of Scope Changes check

Explanation

The changes connect to the Alt-click behavior in #804. The others option in the three layer commands in cmds_timeline.rs implements the feature. The folder, mask, and camera exclusions keep the clicked layer's own state consistent with the rest of the timeline, and the tests cover them. src/timeline.rs adds the Alt-click dispatch, status messages, and hover text. The guide paragraph, regenerated command reference, and CHANGELOG entry document the feature. The outline hover text change means its existing translations fall back to English until translations are updated; the PR description discloses this. No unrelated behavior was found. The src/timeline.rs and cmds_timeline.rs diffs could not be read in full, so the verdict relies on the file read, the test file, the PR description, and the supplied summaries.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7b4572d1-6c02-427e-b21f-955073ca97d8
Commits

Reviewing files that changed from the base of the PR and between 98ba1cc and 31fa9f9.

Files selected for processing: 2

  • crates/engine/src/cmds_timeline.rs
  • docs/guide/reference/commands.md
Files skipped from review as they are similar to previous changes: 2

  • crates/engine/src/cmds_timeline.rs
  • docs/guide/reference/commands.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

This branch has not been deployed

No deployments
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.

[Feature request] Alt-click to to hide/lock/outline all layers but the current one

1 participant