Skip to content

Let a slider format its readout - #150

Merged
ryankiley merged 1 commit into
mainfrom
ryan/slider-format
Oct 12, 2026
Merged

ryankiley merged 1 commit into
mainfrom
ryan/slider-format

Conversation

@ryankiley

@ryankiley ryankiley commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

A slider takes format (value to readout text, in place of its digits) and parse (typed text back to a value), so a minutes-of-the-day slider can read "7:30 AM" and be typed into the same way. Display only, like unit. A format that fails falls back to the digits, only a finite number from parse commits (a typo or a null leaves the value alone), and an editor left untouched commits nothing. Without a parse, typed text must all be a number less the unit, so "1,000" or "7:30" no longer commit 1 or 7. The editor sizes to its text, and the label to the room the readout leaves. Adds an example on the Numbers page and test/slider-format.

@ryankiley
ryankiley enabled auto-merge (squash) October 12, 2026 00:19
@ryankiley
ryankiley disabled auto-merge October 12, 2026 00:19
@ryankiley
ryankiley force-pushed the ryan/slider-format branch 2 times, most recently from a1f4d89 to 36e27b5 Compare October 12, 2026 00:50
A slider takes format, which draws its readout from the value in place of its digits (a clock for minutes of the day), and parse, which reads typed text back, so the inline editor shows and takes the same text. Display only, like unit. A format that fails falls back to the digits, only a finite number from parse commits, and an editor left untouched commits nothing; without a parse, typed text must all be a number (less the unit), so "1,000" no longer commits 1. The editor sizes to its text, and the label to the room the readout leaves. The Numbers page has an example, and test/slider-format covers it.
@ryankiley
ryankiley merged commit 36962a4 into main Oct 12, 2026
2 checks passed
@ryankiley
ryankiley deleted the ryan/slider-format branch October 12, 2026 01:08
@ryankiley ryankiley mentioned this pull request Oct 12, 2026
ryankiley added a commit that referenced this pull request Oct 12, 2026
Carries the slider's format and parse (#150) and the panel's silent writes, presets: false and persist: false (#151). All additive or fixes, so a patch: hosts on ^0.4.0 pick it up as is.
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