Repository navigation
b.number: the slider's editable readout without the track (#328, PR 3; based on #407) - #414
Merged
Merged
Conversation
One implementation for both, as the user decided on #328: - owned/readout.rs: `Readout`, the readout a slider's header shows, moved out of the slider: its text, a button that opens it when it is editable, and the field it opens into (with #403's Session). The slider's header is its label plus a Readout, in the slider's muted readout colours. - `Builder::number(key, value, range)` -> `NumberChain`: format, editable, step, named, classes (merged), tooltip, enablement, size, on_edit, then on_change, or add for one that only shows the value. It takes the text colour around it (the user's pick), and its range is the one a typed value reaches. - examples/slider_header gains a Gain slider whose readout types past its track (#407) and a Trim number, for the trial. Based on #407. Part of #328. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKf74MNWrhkW1CvKVUP
# Conflicts: # src/owned/slider.rs
# Conflicts: # tests/it/main.rs
#414 moved the readout, and the slider's focus import with it, to readout.rs; #395 added focus_on_open and focus_now to the slider, which use it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PWiKKf74MNWrhkW1CvKVUP
# Conflicts: # src/owned/mod.rs
# Conflicts: # tests/it/main.rs
Owner
Author
|
Approved by the user after the number-field trial (2026-11-19). GitHub's required checks pass on the branch merged with current main. Merging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #328: PR 3 of 3,
b.number. Based on #407 (which is based on #403): this PR targets #407's branch and moves to main as the stack merges.One implementation, as the user decided on #328
owned/readout.rs:Readoutis the slider header's readout, moved out of the slider. It covers:Role::Button"Edit {name}" that opens it while it is editable;Session, so Enter or leaving commits and Escape reverts.Readout { .. }.show(..). The slider keeps its muted readout colour and the typed range from Slider: a typed range wider than the track's (part of #328, based on #403) #407.b.number(key, value, range)builds the sameReadoutwithout a track. It takes the colour of the text around it.API (rustdoc
TODO(prose)where new)valueis reported asBadRange, as for the slider.refusedandwhen/when_some(Owned controls: refused(reason), IntoTip, when/when_some, gap fills (part of #315) #385), which this stack doesn't contain. They follow once Owned controls: refused(reason), IntoTip, when/when_some, gap fills (part of #315) #385 and this stack are both on main.Behaviour changes
None to the slider: its 69 tests, the #403 and #407 tests included, pass unchanged.
Tests (
tests/it/number_readout.rs, through the real draw path)[Began, Ended]);.add()(even after.editable) only shows its value: no button, and a click opens nothing;Mutations, each caught:
add()keeping the parse;To try (UI change: the user tries it before approval)
cargo xtask example slider_header. It gains two rows:b.number, formatted+0.0 dB, step 0.5.Click either readout to type in it. Enter or clicking away commits; Escape reverts.
Goldens
None changed:
cargo xtask snapshots --updatewrote nothing. The example has no golden.Prose for you
TODO(prose)on:NumberChain;Builder::number;NumberChain::format,editable,stepandsize.git diff origin/typed-range-328 HEAD --stat(this PR alone)cargo xtask ciexits 0 on 21fa92c (on #407's 6833d6c).🤖 Generated with Claude Code
https://claude.ai/code/session_01PWiKKf74MNWrhkW1CvKVUP