Skip to content

Update Text.resolve implementation#940

Merged
Kyle-Ye merged 24 commits into
mainfrom
feature/text_resolve
Jul 19, 2026
Merged

Update Text.resolve implementation#940
Kyle-Ye merged 24 commits into
mainfrom
feature/text_resolve

Conversation

@Kyle-Ye

@Kyle-Ye Kyle-Ye commented Jul 18, 2026

Copy link
Copy Markdown
Member

Summary

  • Implement Text.resolve, Text.Resolved, and resolved text append paths for strings, attributed strings, image attachments, named images, and resolvable text segments.
  • Complete supporting Text.Style, modifier, foreground style, font, line style, and renderer APIs.
  • Add text attachment drawing support, platform shims, DocC documentation, and supporting text utilities.

@github-actions github-actions Bot added area: graphics Color, shape, gradient, image, symbols, and graphics primitives. area: text Text, labels, line style, and text rendering APIs. type: feature New API, behavior, platform support, or user-facing capability. labels Jul 18, 2026
@augmentcode

augmentcode Bot commented Jul 18, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR substantially completes the Text.resolve pipeline and the supporting renderer/styling infrastructure.
Key Changes:

  • Added `Text.Resolved` / `Text.ResolvedString` containers to build resolved strings and attributed strings.
  • Implemented append paths for `String`, `NSAttributedString`, image/named-image attachments, and resolvable text segments.
  • Completed core `Text.Style` and `Text.Modifier` behavior (fonts, foreground style/color, underline/strikethrough, kerning/tracking, baseline offset, transitions, speech, shadow).
  • Added `ResolvedProperties` tracking (features, paragraph caching, custom attachment indices, custom style key-colors).
  • Introduced text attachment drawing (`OpenSwiftUITextAttachment`) and a `GraphicsContext.draw(image:in:style:shading:)` shim with SwiftUI test stubs.
  • Added/updated platform shims and SPI for `NSParagraphStyle` fields and `NSTextAttachment` accessibility metadata.
  • Refactored text utilities (moved attributed-string styling detection, kit attribute keys, update-schedule scaffolding).
Notes: Several resolution components remain stubbed, but the API surface and integration points are now in place.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed. 1 suggestion posted.

Fix All in Augment

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

}

// FIXME
public struct Shading: Sendable {}

@augmentcode augmentcode Bot Jul 18, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sources/OpenSwiftUICore/Graphic/GraphicsContext.swift:516: Since Shading is part of an @_silgen_name signature that can call into SwiftUI when OPENSWIFTUI_SWIFTUI_RENDERER is enabled, an empty placeholder type risks an ABI mismatch/undefined behavior at runtime. Consider ensuring this type’s layout matches SwiftUI’s GraphicsContext.Shading (even when you only ever pass nil).

Severity: high

Fix This in Augment

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

@codecov

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 1.94805% with 604 lines in your changes missing coverage. Please review.
✅ Project coverage is 25.68%. Comparing base (68e9cf6) to head (acdade9).

Files with missing lines Patch % Lines
Sources/OpenSwiftUICore/View/Text/Text/Text.swift 1.34% 220 Missing ⚠️
...enSwiftUICore/View/Text/Resolve/ResolvedText.swift 3.94% 219 Missing ⚠️
...OpenSwiftUICore/View/Text/Text/Text+Renderer.swift 0.00% 61 Missing ⚠️
.../Text/AttributedString/Text+AttributedString.swift 0.00% 56 Missing ⚠️
.../Text/Resolve/ResolvableTextSegmentAttribute.swift 0.00% 16 Missing ⚠️
...wiftUICore/View/Text/Text/TextNonDarwinShims.swift 0.00% 16 Missing ⚠️
...ICore/View/Text/Util/ReducedTimelineSchedule.swift 0.00% 10 Missing ⚠️
...rces/OpenSwiftUICore/Graphic/GraphicsContext.swift 0.00% 2 Missing ⚠️
...nSwiftUICore/View/Text/Util/String+Extension.swift 0.00% 2 Missing ⚠️
.../View/InterfaceIdiom/InterfaceIdiomPredicate.swift 0.00% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #940      +/-   ##
==========================================
- Coverage   25.94%   25.68%   -0.27%     
==========================================
  Files         721      722       +1     
  Lines       50700    51190     +490     
==========================================
- Hits        13156    13150       -6     
- Misses      37544    38040     +496     

☔ 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 94b21c0 into main Jul 19, 2026
8 of 9 checks passed
@Kyle-Ye
Kyle-Ye deleted the feature/text_resolve branch July 19, 2026 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: graphics Color, shape, gradient, image, symbols, and graphics primitives. area: text Text, labels, line style, and text rendering APIs. 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