Skip to content

Spring time mode, save/load state, batch set, folder polish#43

Merged
ryankiley merged 3 commits into
mainfrom
panel-state-and-spring-time
Jun 21, 2026
Merged

Spring time mode, save/load state, batch set, folder polish#43
ryankiley merged 3 commits into
mainfrom
panel-state-and-spring-time

Conversation

@ryankiley

Copy link
Copy Markdown
Owner

A few additions and some polish — all dependency-free, types included, tests green.

New

  • Spring Time mode — the spring control now has a Time mode (duration + bounce) next to Physics, switched in the control. Either way it emits { stiffness, damping, mass }, so consumers don't change.
  • panel.toJSON() / panel.fromJSON() — save and restore the whole panel: every value plus which folders are open and which tab is active. Separate from the built-in presets, so you can keep it in a file, a URL, or your own store. JSON.stringify(panel) works too.
  • panel.setMany({ ... }) — set several values at once with a single update (one listener fire instead of one per key).

Polish

  • Folders now show a hairline above each group, so sections read as distinct.
  • The docs samples use folders more, starting with the homepage demo.

Fix

  • A segmented control built inside a non-default tab now measures its pill correctly when the tab is first shown.

- Spring: new Time mode (duration + bounce) alongside Physics; either
  mode emits { stiffness, damping, mass }.
- panel.toJSON() / fromJSON(): save and restore the whole panel — values
  plus open folders and active tab — separate from the presets system.
- panel.setMany(): set several values at once with a single update.
- Folders show a hairline above each group; docs samples use folders more.
- Fix: a segmented pill inside a non-default tab now measures on reveal.
The collapsed body kept a 6px residual (the inner padding-top survived the
collapse), so the title sat off-centre under its rule. Collapse that padding
to zero and retune the folder's top padding so the title now has equal room
above and below — 9.5px — in both the open and collapsed states.
Put the folder title in a full row-height header (centred like every other row)
framed top and bottom by a hairline, with consecutive folders sharing one rule.
The title now sits evenly in its section — ~9px above and below — in both the
open and collapsed states, a cleaner section rhythm than the cramped label.
@ryankiley ryankiley merged commit 9dc1231 into main Jun 21, 2026
2 checks passed
@ryankiley ryankiley deleted the panel-state-and-spring-time branch June 21, 2026 03:21
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.

1 participant