8000 RadioGroup and Stepper, the last two v1 widgets, as §12.2a exceptions by rleibman · Pull Request #151 · rleibman/thicket · GitHub
[go: up one dir, main page]

Skip to content

RadioGroup and Stepper, the last two v1 widgets, as §12.2a exceptions - #151

Merged
rleibman merged 7 commits into
mainfrom
feat/radio-stepper
Nov 4, 2026
Merged

rleibman merged 7 commits into
mainfrom
feat/radio-stepper

Conversation

@rleibman
@rleibman rleibman commented Nov 3, 2026
Copy link
Copy Markdown
Owner

The two v1 widgets that were left. You decided on 2026-11-03 to build both as §12.2a exceptions, as TabView is on Android: each platform's own control where it has one, and a construction where it doesn't. On iOS, Radio is a checkmark list. The Apple controls are #150.

What it adds

  • RadioGroup: a group rather than a Radio per button, because Android's mutual exclusion is a container and GTK's is a pointer between siblings. It uses Picker's props (an index; -1 for none).
    • GTK: grouped GtkCheckButtons. This shares the segmented control's code, generalised.
    • Android: a vertical RadioGroup; the segmented control was already a horizontal one.
  • Stepper: Slider's props plus a new Prop.Step.
    • GTK: a GtkSpinButton, with its digits taken from the step.
    • Android has no stepper control, so it's a − / value / + row (StepperView). It's clamped to the range, and the button at a bound is disabled.
    • thicket.renderer.Steps.format shows a value to its step's precision, so Android's drawn number matches GTK's.
  • Apple, until Apple RadioGroup and Stepper: radio NSButtons / an iOS checkmark list; NSStepper / UIStepper #150: RadioGroup maps to the existing picker and Stepper to the slider, with the same props, so the Apple galleries keep working. docs/12 marks both as partial on Apple.
  • Gallery: a "RadioGroup and Stepper" section: three sizes, a count stepper from 0 to 5, and an amount stepper in steps of 0.25.

Measured

Before After
checkLinux exit 0
core tests 172 176 (RadioStepperSpec 4/4 on JVM, Native and JS)
GTK gallery / todo 144 / 69 150 / 69
Android gallery on s2test 95 100

Both platforms check the same things:

  1. One radio per option, with the model's choice selected.
  2. Choosing another option reports it, and only that one stays selected.
  3. Each stepper shows its value to its step's precision: 2 and 1.50.
  4. Pressing + moves each stepper a step, and the app hears it.
  5. The count stops at its maximum; on Android, its + is also disabled.

Falsified

  • Radio buttons not grouped: check 2 fails on GTK.
  • No spin-button digits: check 3 fails on GTK.
  • On Android, the wrong precision fails check 3, and no clamp fails check 5.

Not done

🤖 Generated with Claude Code

The owner's decision (2026-11-03): build both, each platform's own control
where it has one and a construction where it has none; iOS's Radio is a
checkmark list.
- renderer-api: WidgetKind.RadioGroup, WidgetKind.Stepper, Prop.Step, and
  Steps.format (a value to its step's precision). core: dsl.RadioGroup
  (Picker's props) and dsl.Stepper (Slider's, plus the step).
- GTK: grouped GtkCheckButtons (the segmented control's code, generalised)
  and a GtkSpinButton with digits from the step.
- Android: a vertical RadioGroup (the segmented control's code) and a
  StepperView, − / value / + from framework views, clamped.
- Apple: interim mapping to the picker and the slider until #150.
- Gallery: a RadioGroup and Stepper section, with GTK and Android checks.

Measured: checkLinux exit 0; RadioStepperSpec 4/4 on JVM, Native and JS
(core 176). GTK gallery 150 (144 + 6), todo 69; Android gallery 100
(95 + 5) on s2test; platforms/Test/compile 0 errors.
Falsified: radio buttons ungrouped fails "only it active" (GTK); no spin
digits fails the precision check (GTK); on Android the wrong precision
fails it and no clamp fails "stops at its maximum".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.

🟡 Changes recommended

There are unresolved moderate-to-critical issues around missing validation for non-positive/non-finite step values and non-finite model values, including a documented crash path in Steps.format when given NaN/Infinity during rendering.

3 open issues
What changed in this PR

Adds the final two v1 catalogue widgets—RadioGroup and Stepper—as §12.2a exceptions, implementing platform-appropriate controls on GTK and Android, with interim Apple mappings (RadioGroup→Picker, Stepper→Slider) to keep Apple galleries working pending #150. Updates the renderer contract, shared formatting helpers, gallery/self-tests, and documentation/counts.

Changes:

  • Extends the renderer contract with WidgetKind.RadioGroup, WidgetKind.Stepper, and Prop.Step, plus shared Steps.{digits,format} for step-precision display.
  • Implements RadioGroup/Stepper on GTK (grouped GtkCheckButtons, GtkSpinButton) and Android (vertical RadioGroup, custom StepperView).
  • Adds core coverage (RadioStepperSpec), expands gallery/self-tests on GTK/Android, and updates README/docs status and counts.

This pull request requires changes.

File Review notes
README.md Nit: Status table vs surrounding paragraphs contradict current RadioGroup/Stepper coverage. Nit: “Counts as of” date is inconsistent with updated 2026-11-03 counts.
modules/​renderer-gtk/​src/​main/​scala/​thicket/​renderer/​gtk/​GtkRenderer.scala Moderate: Prop.Step may pass non-finite/non-positive values into GTK spin-button configuration; sanitize and suppress events during configuration updates.
modules/​renderer-gtk/​src/​main/​scala/​thicket/​renderer/​gtk/​GtkInspect.scala Reviewed; no additional notes in final comments.
modules/​renderer-apple/​src/​main/​scala/​thicket/​renderer/​apple/​AppleRenderer.scala Reviewed; no additional notes in final comments.
modules/​renderer-api/​shared/​src/​main/​scala/​thicket/​renderer/​Renderer.scala Moderate: Steps.digits should normalize negative/zero step behavior. Critical: Steps.format can throw on NaN/Infinity; guard non-finite values to prevent rendering crashes.
modules/​renderer-android/​src/​main/​scala/​thicket/​renderer/​android/​StepperView.scala Moderate: setStep accepts non-finite/non-positive steps; sanitize before storing. Moderate: clamp() propagates NaN; normalize NaN/Infinity to bounds to avoid repeated onChange with NaN.
modules/​renderer-android/​src/​main/​scala/​thicket/​renderer/​android/​AndroidRenderer.scala Reviewed; no additional notes in final comments.
modules/​core/​shared/​src/​test/​scala/​thicket/​core/​TestRenderer.scala Reviewed; no additional notes in final comments.
modules/​core/​shared/​src/​test/​scala/​thicket/​core/​RadioStepperSpec.scala Reviewed; no additional notes in final comments.
modules/​core/​shared/​src/​main/​scala/​thicket/​core/​Element.scala Moderate: Stepper DSL accepts 0/negative/NaN/∞ step values; validate at the DSL boundary. Nit: Scaladoc immediately above RadioGroup appears to describe Picker; adjust to avoid misattached/misleading generated docs.
examples/​gallery/​shared/​shared/​src/​main/​scala/​example/​gallery/​Gallery.scala Reviewed; no additional notes in final comments.
examples/​gallery/​README.md Reviewed; no additional notes in final comments.
examples/​gallery/​gtk/​src/​main/​scala/​example/​gallery/​GalleryGtk.scala Reviewed; no additional notes in final comments.
examples/​gallery/​android/​scala/​src/​main/​scala/​example/​gallery/​android/​GallerySelfTest.scala Reviewed; no additional notes in final comments.
docs/​decisions.md Reviewed; no additional notes in final comments.
docs/​12-component-status.md Reviewed; no additional notes in final comments.

Review effort: Balanced

rleibman and others added 3 commits November 3, 2026 18:56
Handle NaN and Infinite values in format method.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@rleibman
rleibman commented Nov 4, 2026
Copy link
Copy Markdown
Owner Author

@copilot resolve the merge conflicts in this pull request

Co-authored-by: rleibman <3268890+rleibman@users.noreply.github.com>
Copilot AI commented Nov 4, 2026
Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved: the branch is clean, there are no conflict markers left, and the remaining review-driven Stepper issue is fixed in ce1ea75 (Tighten Stepper validation and finite formatting). Verified with the targeted RadioStepperSpec across JVM/JS/Native.

@rleibman
rleibman commented Nov 4, 2026
Copy link
Copy Markdown
Owner Author

@copilot resolve the merge conflicts in this pull request

…; NSStepper / UIStepper (#150) (#153)

* WIP Apple RadioGroup and Stepper: kinds 26/27, sui_set_step, sui_step; gallery checks (#150)

macOS gallery 234 ok, ALL CHECKS PASSED (12 new: section, 6 RadioGroup, 5 Stepper).
iOS not yet run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Apple RadioGroup and Stepper: the grouping check, docs (#150)

A last radio click with a handler that only records, so the platform's grouping is
measured apart from the app's write-back, which re-selected exclusively and hid an
ungrouped set.

bin/verify-apple.sh "iPhone Air": 20/20 steps. iOS simulator gallery 246, macOS 231
(screen locked), 13 new on each. shimGen/testFull 51/51.
Falsified: ungrouped radios (macOS: separate superviews; iOS: no exclusion) fail the new
check. Range +100 fails 'stops at 5' (7). An echoed app write fails both 'not reported
back' checks (macOS). 0 digits fails the precision check (macOS).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Update label formatting to use NSDecimalNumber

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Refactor show function to use NSDecimalNumber for rounding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Roberto Leibman <rleibman@magrathea.local>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@rleibman
rleibman commented Nov 4, 2026
Copy link
Copy Markdown
Owner Author

@copilot resolve the merge conflicts in this pull request

Copilot AI commented Nov 4, 2026
Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved: the branch is clean and there are no remaining merge-conflict markers. The review-driven Stepper fix is in ce1ea75 (Tighten Stepper validation and finite formatting), and the focused core regression check passes across JVM/JS/Native.

@rleibman
rleibman merged commit 9f2a3bd into main Nov 4, 2026
0 of 2 checks passed
rleibman added a commit that referenced this pull request Nov 9, 2026
* Regenerate thicket_apple.h: a merge left it broken, and main's CI red

Merging #152 and #151 left the kind-table comment in the generated Apple header
closed early (`*/` after the Stepper row) with a duplicate `25 Tab` row outside
it, as bare text before `sui_create`. That is not C, and shimGen's consistency
suite has failed on main since 9f2a3bd: 45 passed, 6 failed (Linux and Apple CI
both red on the #151 push). `shimGen/run` regenerates it; this is its output,
and the only file it changes.

Also the two-line comment in AppleRenderer that the same merge left mis-indented,
which `scalafmtAll` reflows.

Measured: `sbt --error checkLinux` exit 0, 356 tests passed, 0 failed (on main,
shimGen alone: 6 failed). Not verified here: the Swift build of the shim, which
needs the Mac.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* POM descriptions for every published module; the release rehearsal in docs/14 (#157)

* POM descriptions for every published module; the release rehearsal in docs/14

Each of the 50 published modules now sets `description` next to its `name`, so
the POM's <description> (what Central's and Maven's search pages show) says what
the module is instead of repeating its name.

docs/14 §14.5 records what the practice release run on 2026-11-09 settled: a clean
clone tagged v0.2.0 locally staged 62 modules (jar, sources, javadoc, POM, all
signed, 56 MB), all 33 external dependencies resolve on Central, and sonaUpload
reached VALIDATED (deployment 86b6f4e7, then dropped; nothing published). Also:
which account owns net.leibman, where sbt 2 reads credentials, why the release
must come from one machine (the Mac), and rehearse-then-Drop.

Measured: `show coreJVM/description` etc. print the new descriptions;
`sbt --error checkLinux` on this branch (stacked on the thicket_apple.h fix):
exit 0, 356 tests passed, 0 failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Update release instructions for Mac and Linux

Clarified release process for Mac and non-Mac hosts, detailing module staging and potential upload collisions.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Change Platform shim kind to match WidgetKind

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
rleibman added a commit that referenced this pull request Nov 13, 2026
… step (#159)

Two faults left on main after #151's merge and #156.

Prop.View: #151's merge brought back the placeholder that set "<description>:
not available" text, so a Platform host never got its view. Control on the
macOS gallery without this line: 4 Platform checks fail (the NSTextField is
not in the window, the "not available" label, the replacement, the release).

Stepper: StepperView.show() printed NSDecimalNumber's stringValue, which drops
trailing zeros, so a step of 0.25 showed "1.5", not "1.50", on AppKit and
UIKit. It now rounds with NSDecimalNumber and prints exactly `digits`
decimals, as Steps.format does. Before: both galleries failed "showing its
value to its step's precision" and "- moves it back a step" (main's own CI on
9f2a3bd, and #158's run on its merge with main).

Measured: bin/verify-apple.sh "iPhone 17e" on this tree, 20/20 steps, at a
load average of 80-180 (Apple CI ran beside it). macOS gallery 237 ok per
run, iOS 252 ok.

Co-authored-by: Roberto Leibman <rleibman@magrathea.local>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

3 participants

0