Skip to content

Add stdout renderer support#893

Merged
Kyle-Ye merged 17 commits into
mainfrom
feature/stdout_renderer
Jun 7, 2026
Merged

Add stdout renderer support#893
Kyle-Ye merged 17 commits into
mainfrom
feature/stdout_renderer

Conversation

@Kyle-Ye
Copy link
Copy Markdown
Member

@Kyle-Ye Kyle-Ye commented Jun 7, 2026

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:

  • Confirmed the PR diff against the merge-base with main contains only stdout renderer, example, documentation, tests, and CI workflow changes.
  • Did not run a fresh macOS build in this step after stashing the Linux follow-up work.

@github-actions github-actions Bot added area: app-scene App, scene, window, commands, storage, and lifecycle APIs. area: docs Documentation area label. area: example Example apps, previews, sample projects, screenshots, or demo assets. area: rendering DisplayList, render backends, renderer hosts, drawing, and effects. area: tests Test suites, UI tests, fixtures, snapshots, and test support code. area: tooling Developer tooling, package manifests, Tuist, scripts, formatting, or release tooling. type: ci GitHub Actions, test infrastructure, runners, checks, or automation. type: feature New API, behavior, platform support, or user-facing capability. labels Jun 7, 2026
@Kyle-Ye Kyle-Ye marked this pull request as ready for review June 7, 2026 08:16
@Kyle-Ye Kyle-Ye requested a review from Mx-Iris as a code owner June 7, 2026 08:16
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Jun 7, 2026

🤖 Augment PR Summary

Summary: Adds a stdout-based renderer path for OpenSwiftUI apps to support quick, text-only inspection of display-list output.

Changes:

  • Introduces `stdout` as a new `_RendererConfiguration.Renderer` case with `StdoutOptions`.
  • Adds a display-list stdout renderer (`StdoutDisplayListRenderer`) that prints a simplified command stream.
  • Adds `StdoutRendererHost` plus `runStdoutApp` to bootstrap rendering without platform UI hosting.
  • Plumbs an app-level `rendererConfiguration` through `AppGraph` into hosting controllers on Apple platforms.
  • Updates `DisplayList.ViewRenderer` vendor logic to instantiate and manage the stdout renderer.

Examples/CI:

  • Adds a standalone demo package under Renderer/Stdout, including a Tuist-based Xcode workflow.
  • Adds renderer documentation plus focused unit tests for stdout display-list formatting.
  • Adds a macOS GitHub Actions workflow to run the demo (Linux job left commented out for follow-up).

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 4 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.


private func stdoutFormat(_ value: CGFloat) -> String {
let number = Double(value)
return String(format: "%.1f", number == -0.0 ? 0.0 : number)
Copy link
Copy Markdown

@augmentcode augmentcode Bot Jun 7, 2026

Choose a reason for hiding this comment

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

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

Fix This in Augment

🤖 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)
Copy link
Copy Markdown

@augmentcode augmentcode Bot Jun 7, 2026

Choose a reason for hiding this comment

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

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

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Comment thread Renderer/Stdout/README.md
```

The script runs `tuist install`, generates the workspace without opening during
generation, then opens `StdoutRenderer.xcworkspace`. If `mise` is available, the
Copy link
Copy Markdown

@augmentcode augmentcode Bot Jun 7, 2026

Choose a reason for hiding this comment

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

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

Fix This in Augment

🤖 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"
Copy link
Copy Markdown

@augmentcode augmentcode Bot Jun 7, 2026

Choose a reason for hiding this comment

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

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

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@Kyle-Ye Kyle-Ye force-pushed the feature/stdout_renderer branch from e9f847f to 01016d3 Compare June 7, 2026 08:40
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 7, 2026

Codecov Report

❌ Patch coverage is 32.69231% with 140 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.71%. Comparing base (681409e) to head (01016d3).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...UICore/Render/DisplayList/StdoutRendererHost.swift 0.00% 51 Missing ⚠️
...Render/DisplayList/DisplayListStdoutRenderer.swift 65.26% 33 Missing ⚠️
Sources/OpenSwiftUI/App/App/Stdout/StdoutApp.swift 0.00% 20 Missing ⚠️
Sources/OpenSwiftUI/App/App/App.swift 0.00% 13 Missing ⚠️
...e/Render/DisplayList/DisplayListViewRenderer.swift 33.33% 12 Missing ⚠️
...OpenSwiftUI/App/App/AppKit/AppKitAppDelegate.swift 0.00% 4 Missing ⚠️
...OpenSwiftUICore/Render/RendererConfiguration.swift 0.00% 4 Missing ⚠️
Sources/OpenSwiftUI/App/App/AppGraph.swift 0.00% 3 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Kyle-Ye Kyle-Ye merged commit 66235c0 into main Jun 7, 2026
8 checks passed
@Kyle-Ye Kyle-Ye deleted the feature/stdout_renderer branch June 7, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: app-scene App, scene, window, commands, storage, and lifecycle APIs. area: docs Documentation area label. area: example Example apps, previews, sample projects, screenshots, or demo assets. area: rendering DisplayList, render backends, renderer hosts, drawing, and effects. area: tests Test suites, UI tests, fixtures, snapshots, and test support code. area: tooling Developer tooling, package manifests, Tuist, scripts, formatting, or release tooling. type: ci GitHub Actions, test infrastructure, runners, checks, or automation. type: feature New API, behavior, platform support, or user-facing capability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant