8000 Apple: restore #152's Prop.View, and print the stepper's label to its step by rleibman · Pull Request #159 · rleibman/thicket · GitHub
[go: up one dir, main page]

Skip to content

Apple: restore #152's Prop.View, and print the stepper's label to its step - #159

Merged
rleibman merged 1 commit into
mainfrom
fix/apple-platform-view-and-stepper
Nov 13, 2026
Merged

rleibman merged 1 commit into
mainfrom
fix/apple-platform-view-and-stepper

Conversation

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

main's Apple CI is red. #156 fixed the header and the Platform kind mapping. This PR fixes the two faults left.

1. Prop.View: hosting the view at all

Fault: #151's merge brought back the placeholder Prop.View case, so a Platform host showed "not available" text and never got its view. This restores #152's line: platformViews.setView(handle, view).

Control: the macOS gallery without this line fails 4 Platform checks:

  • the NSTextField is not in the window;
  • the "not available" label;
  • the replacement;
  • the release.

2. The stepper's label precision

Fault: StepperView.show() printed NSDecimalNumber's stringValue, which drops trailing zeros. A 0.25 step showed 1.5, not 1.50, on AppKit and UIKit. #153 carried this bug.

Fix: round with NSDecimalNumber, then print exactly digits decimals, as Steps.format does.

Before the fix: both galleries failed "…showing its value to its step's precision" and "− moves it back a step". That showed in main's Apple CI on 9f2a3bd, and in #158's run on its merge with main.

Measured

bin/verify-apple.sh "iPhone 17e" on this branch passed 20/20 steps.

  • Load average: 80–180, with Apple CI running beside it.
  • macOS gallery: 237 ok per run.
  • iOS gallery: 252 ok, with every Stepper and Platform check passing.

#158 (camera preview) fails only these two stepper checks. Once this PR merges, merging main into #158 should clear them.

🤖 Generated with Claude Code

… step

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: 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.

🟢 Approval recommended

The provided context does not indicate any open review threads, failing checks, or unresolved blocking items, and describes the changes as straightforward restorations/improvements to Apple rendering behavior.

No open issues 🎉

What changed in this PR

This pull request addresses two Apple renderer regressions: restoring Platform view hosting via Prop.View, and improving Stepper value label formatting so it reflects the step’s precision (e.g., preserving trailing zeros).

Changes:

  • Restore Prop.View handling in AppleRenderer so platform hosts actually embed their provided native view.
  • Update StepperView.show() in both UIKit and AppKit shims to display values with the step’s decimal precision.

The stepper label formatting still has moderate issues to resolve:

  • It rounds with NSDecimalNumber but then converts back to Double for String(format:), reintroducing binary floating-point rounding risk and potentially diverging from decimal semantics.
  • String(format:) is locale-sensitive; output may use a comma decimal separator under some locales, which can break expected dot-based formatting in self-tests. Use an explicit POSIX locale and enforce exactly digits fraction digits (e.g., via NumberFormatter) while formatting the decimal value directly.

Assessment: This pull request requires changes.

File Summary
modules/​renderer-apple/​src/​main/​scala/​thicket/​renderer/​apple/​AppleRenderer.scala Restores Prop.View routing so Platform hosts mount the provided platform view again.
modules/​renderer-apple/​shim/​Sources/​Shim+UIKit.swift Adjusts Stepper label formatting to preserve step precision, but still needs decimal/locale-stable formatting.
modules/​renderer-apple/​shim/​Sources/​Shim+AppKit.swift Mirrors the Stepper label precision change, with the same decimal/locale-stability concerns.

Review effort: Balanced

@rleibman
rleibman merged commit 7eab939 into main Nov 13, 2026
3 checks passed
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.

2 participants

0