Add stdout renderer support#893
Conversation
🤖 Augment PR SummarySummary: Adds a stdout-based renderer path for OpenSwiftUI apps to support quick, text-only inspection of display-list output. Changes:
Examples/CI:
🤖 Was this summary useful? React with 👍 or 👎 |
|
|
||
| private func stdoutFormat(_ value: CGFloat) -> String { | ||
| let number = Double(value) | ||
| return String(format: "%.1f", number == -0.0 ? 0.0 : number) |
There was a problem hiding this comment.
Sources/OpenSwiftUICore/Render/DisplayList/DisplayListStdoutRenderer.swift:145 stdoutFormat uses String(format:) without a fixed locale, so the decimal separator can vary by environment and make stdout output/tests non-deterministic. Consider ensuring the renderer’s textual output is locale-stable so CI and users always see the same formatting.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| append( | ||
| list: list, | ||
| transform: transform.concatenating( | ||
| CGAffineTransform(translationX: frame.minX + offset.x, y: frame.minY + offset.y) |
There was a problem hiding this comment.
Sources/OpenSwiftUICore/Render/DisplayList/DisplayListStdoutRenderer.swift:101 In .flattened, the translation uses frame.minX/minY after applying the current transform, which can be incorrect when transform includes scaling/rotation (bounding-box mins differ from local-space translation). This could make the stdout geometry misleading for transformed flattened subtrees.
Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| ``` | ||
|
|
||
| The script runs `tuist install`, generates the workspace without opening during | ||
| generation, then opens `StdoutRenderer.xcworkspace`. If `mise` is available, the |
There was a problem hiding this comment.
Renderer/Stdout/README.md:24-25 The README says open-xcode.sh uses mise to pick a repo-pinned Tuist version, but the script currently calls tuist directly. This looks like a doc/code mismatch that could confuse users trying to reproduce the intended workflow.
Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| *) | ||
| export OPENSWIFTUI_OPENATTRIBUTESHIMS_ATTRIBUTEGRAPH=0 | ||
| export OPENSWIFTUI_OPENATTRIBUTESHIMS_COMPUTE=1 | ||
| export OPENSWIFTUI_LIB_SWIFT_PATH="$(swiftly use --print-location)/usr/lib/swift" |
There was a problem hiding this comment.
Renderer/Stdout/run-example.sh:15 On non-Darwin, this script unconditionally calls swiftly; with set -euo pipefail it will fail early on systems without swiftly even if Swift itself is installed. If the goal is to keep the example runnable on Linux by default, this assumption may be worth revisiting.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
e9f847f to
01016d3
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #893 +/- ##
==========================================
+ Coverage 26.68% 26.71% +0.02%
==========================================
Files 693 697 +4
Lines 48651 48889 +238
==========================================
+ Hits 12984 13060 +76
- Misses 35667 35829 +162 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Agent Summary
Adds stdout renderer support for OpenSwiftUI apps, including renderer configuration plumbing, a display-list stdout renderer, and a small example package under
Renderer/Stdout.This also adds a Tuist-backed macOS Xcode workflow for the stdout example, documentation under
Renderer/, focused stdout renderer unit coverage, and a macOS CI workflow that runs the example script. The Linux workflow entry is left disabled for now so the remaining Linux runtime work can be handled in a follow-up change.Validation:
maincontains only stdout renderer, example, documentation, tests, and CI workflow changes.