mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-07 20:41:50 +00:00
dbdeeec2e9
* Undo: what is hidden lives in the snapshot, so hiding is a step (#2219) `Session::execute` records a step only when the document `Arc` changes, and what is hidden lives in `Session::visibility` — saved with the design, but outside the document. `browser.visibility` was also declared `.noundo()`, and `Snapshot` had no field for it, so even a recorded step could not put a hidden body back: undo went to the command before the hide and left it hidden (#2219). `Snapshot` and `Checkpoint` now carry the `Visibility`, `go_to` restores it, and `Session::execute` treats a visibility change as a change of its own. That change is display-only, so it refreshes the view with a revision bump (`refresh_display`) instead of evaluating a model a hide does not touch. The command also takes `folder: "all"` (every body, sketch, construction item, origin item and joint, plus the browser folders and occurrence hides) so Show All can be one step, and asking for the state an item already has no longer reorders the hidden lists: a redundant hide is not a step and leaves no unsaved changes. * Show/Hide: the menus run browser.visibility, so the history has it (#2219) The hide and show actions wrote `session.visibility` directly instead of running the command: the body and face menus (`ui.hide` / `ui.show`), the `V` key (`context_menu::toggle_visibility`), the browser rows' eyes, the Origin rows and `ui.originAll` / `ui.originPart`. The engine could record a step and there was nothing to record — which is why the release still answered "nothing to undo" after hiding from the Browser. They all run `browser.visibility` now (the repo rule that the UI acts through commands), and `ui.showAll` is that one `folder: "all"` call, so Show All is one undo step rather than three. `docs/occurrence-workflows.md` says what visibility does in the history.