Repository navigation
feat(gauge): implement Gauge and built-in styles - #1266
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
/uitest osui-iag update only-testing=OpenSwiftUIUITests/GaugeUITests |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d351f30175
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if configuration.currentValueLabel != nil { | ||
| HStack { configuration.currentValueLabel } | ||
| } else { | ||
| HStack { configuration.label } |
There was a problem hiding this comment.
Preserve the circular capacity gauge's accessibility label
When an .accessoryCircularCapacity gauge supplies a currentValueLabel, this branch renders only that value and never includes configuration.label in the accessibility subtree. AccessibilityGaugeModifier combines existing children and adds the numeric value; it does not restore the omitted purpose label. Consequently, a gauge labeled “Battery” with a current-value label of “75” loses “Battery” for accessibility users. Add an accessibility representation containing both labels, as the other gauge implementations do.
Useful? React with 👍 / 👎.
| private struct OpenRing: Shape { | ||
| var lineWidth: CGFloat | ||
| var radius: CGFloat | ||
| var startAngle: Angle | ||
| var endAngle: Angle |
There was a problem hiding this comment.
Animate the open-ring marker alongside its cutout
When an .accessoryCircular gauge's value changes inside an animation, RotationOffsetEffect animates the destination-out cutout, but OpenRing inherits empty animatable data, so the visible marker immediately jumps to its final angle. During the transition, the hole and marker occupy different positions, leaving a detached marker and an unrelated gap in the track. Expose the ring's angles through animatableData so the marker and cutout interpolate together.
Useful? React with 👍 / 👎.
| if let controlTint { | ||
| nsView.fillColor = NSColor(controlTint) | ||
| } |
There was a problem hiding this comment.
Reset the native gauge fill when its tint is removed
On macOS, changing a gauge's tint from a color to nil reuses the existing NSLevelIndicator, but this conditional skips updating fillColor. The indicator therefore retains the previous custom color instead of returning to its default appearance. Handle the nil case by restoring the native default fill color rather than leaving the previous value installed.
Useful? React with 👍 / 👎.
🛠️ Tuist Run Report 🛠️Tests 🧪
Builds 🔨
Reported by Tuist, faster builds and reliable tests for Xcode, Gradle, Bazel, and more. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8c177026b6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if fractionCompleted > 0.5 { | ||
| RingArc(fractionCompleted: fractionCompleted, lineWidth: lineWidth, firstHalf: false) | ||
| .fill(foreground) |
There was a problem hiding this comment.
Keep the second ring arc alive across animated value changes
When an .accessoryCircularCapacity gauge animates across 50%, such as from 0.25 to 0.75, this conditional inserts the second arc already at its final fraction. Its animatableData therefore cannot interpolate from the previous value: the second arc fades in at its final length while the first arc and end cap continue moving, temporarily displaying fill ahead of the cap. Keep the second arc structurally present and control its visibility using the interpolated fraction so both halves track the same animated progress.
Useful? React with 👍 / 👎.
Summary
Closes #1022