explorer: a restored snapshot loses to a folder's running animation
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with core/widgets/TreeWidget.zig (the branch's expanded and the _expanded data around lines 468 and 890) and plugins/workbench/src/files.zig (carryBack and the expander near line 1150), then find where setExplorerBranchOpen is called. Replay #293's property test with seed 0x6 to reproduce the failure. Done when the tree draws open or closed from the caller's value each frame, the expander reports toggles instead of writing back, and both the seed test and a new test that sets open state mid-close-animation pass.
Written by the indexing model from the issue text.
Description
Found by #293 (#280 step B1), whose property test replays a demo and seeks to random moments. With seed 0x6 it fails in the tour's explorer, on seeks to 46937, 13890 and 17830 ms: after a snapshot restore, the explorer's open folders aren't the ones the snapshot holds. The checked-in seed and nine others pass, so this shows up only when a seek lands during a folder's open or close animation.
Cause: open state lives in two places that copy each other
core.widgets.TreeWidget's branch keeps its ownexpanded, stored per widget as_expandedin dvui's data (core/widgets/TreeWidget.zig:468,:890). It eases toward the caller's value through an animation.- The workbench keeps the explorer's open folders on the host (
setExplorerBranchOpen, the per-branch open state the snapshot captures and restores). Each frame it writes the branch'sexpandedback into that state (plugins/workbench/src/files.zig,carryBackand the expander around:1150).
So a restore that sets the host's open state while a branch's own animation is still running loses: the next frame copies the widget's in-flight value back over the restored one. Nothing is wrong with the snapshot or the player. The model has two writers.
Fix
Give the open state one owner. The tree should draw open or closed from the caller's value each frame, keeping only the animation's progress as its own state, and never write it back. Clicking the expander reports a toggle to the caller, which changes its state. Then a restore, or anything else that sets the open folders (a reveal-in-explorer, a demo keyframe), takes effect on the next frame with no race.
Test: #293's property test with seed 0x6 must pass, plus a focused integration test: start a folder's close animation, set the open state from outside, run frames, and check the branch ends open.
Part of #280.
🤖 Generated with Claude Code
- Dominant language
- Zig
- Stars
- 1.5k
- Forks
- 40
- Avg merge
- 5h 35m
- Merged PRs (30d)
- 151
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fizzyedit/fizzy
-
replay: bench-replay no longer compiles, and nothing in CI builds itPossibly taken A pull request linked to this issue is open or already merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
fizzyedit/fizzy#306 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 8/100
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 12/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 12/100
Maintainers usually reply within 1 day
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
acsandmann/rift#577 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
wpilibsuite/FirstDriverStation-Public#91 · 1 comment ·
-
0.kind: bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day