Persist lil-gui folder open/closed states and improve reset icon UX in visualizer#184
Conversation
Co-authored-by: jgphilpott <4128208+jgphilpott@users.noreply.github.com>
|
Nice, thanks @copilot! Do you think you could also update the |
Co-authored-by: jgphilpott <4128208+jgphilpott@users.noreply.github.com>
Done in commit
Changes: |
There was a problem hiding this comment.
Pull request overview
This PR enhances the visualizer's lil-gui-based slicing panel in two ways: it persists the open/closed state of each settings folder across page reloads (stored in localStorage), and it adds a confirm() dialog plus a spin animation to the reset button for better UX.
Changes:
- Two new
localStoragehelpers (saveFolderStates/loadFolderStates) added to the state module, applied during GUI construction. - Reset button now requires confirmation and shows a one-shot spin animation via CSS keyframes and an
animationendlistener. - CSS keyframe animation
spin-onceadded for the reset icon.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
examples/visualizer/modules/state.js |
Adds saveFolderStates and loadFolderStates using the same try/catch + localStorage pattern as all other persistence helpers |
examples/visualizer/modules/ui.js |
Wires folder-state persistence into createSlicingGUI: loads saved states on construction, attaches a click listener to each folder's title to persist on every toggle |
examples/visualizer/modules/interactions.js |
Wraps the reset click handler with a confirm() guard and a CSS spin animation |
examples/visualizer/visualizer.css |
Adds @keyframes spin-once and #reset.spinning rule |
|
@copilot apply changes based on the comments in this thread |
…onflict, animation robustness Co-authored-by: jgphilpott <4128208+jgphilpott@users.noreply.github.com>
All 4 review comments addressed in commit
|
saveFolderStates()andloadFolderStates()tostate.jsui.jsand wire up folder open/close persistence increateSlicingGUI()confirm()prompt before reset action@keyframes spin-onceCSS animation and.spinningclass tovisualizer.cssanimationend_title/_closedwithfolderMap+trackFolder()helper;$titleonly used for event attachmentuseDefaultsfor folder states (useDefaults ? null : loadFolderStates()); addclearFolderStates()tostate.jsand call it inresetView()transition: noneto#reset.spinningto prevent keyframe/transition conflictSPIN_ANIMATION_DURATION_MSconstant, timeout cancelled onanimationend💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.