Add OpenSwiftUI attributed string and text scale support - #892
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #892 +/- ##
==========================================
- Coverage 26.77% 26.68% -0.09%
==========================================
Files 690 693 +3
Lines 48287 48651 +364
==========================================
+ Hits 12929 12984 +55
- Misses 35358 35667 +309 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🤖 Augment PR SummarySummary: This PR adds foundational support for attributed-string-backed Changes:
Technical Notes: The implementation relies on attribute transfer/merging during 🤖 Was this summary useful? React with 👍 or 👎 |
| options: Text.ResolveOptions, | ||
| properties: inout Text.ResolvedProperties | ||
| ) { | ||
| enumerateAttributes( |
There was a problem hiding this comment.
Sources/OpenSwiftUICore/View/Text/AttributedString/Text+AttributedString.swift:542 — convertToPlatformStyled mutates the same NSMutableAttributedString (setAttributes / replaceCharacters) from inside enumerateAttributes, which is generally unsafe and can lead to skipped ranges or runtime exceptions. This is especially risky because caseConvertedIfNeeded can change the string length, making subsequent range values invalid.
Severity: high
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| // | ||
|
|
||
| extension Text { | ||
| func strikethrough(_ active: Bool = true, action: Color? = nil) -> Text { |
There was a problem hiding this comment.
Sources/OpenSwiftUICore/View/Text/Text/TextUnimplemented.swift:9 — This Text.strikethrough implementation is a silent no-op, so .inlinePresentationIntent(.strikethrough) processing in withInlinePresentationIntent(from:) won’t have any visible effect and could mask missing behavior.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| } | ||
| } | ||
|
|
||
| class BoldTextModifier: AnyTextModifier { |
There was a problem hiding this comment.
Sources/OpenSwiftUICore/View/Text/Text/TextUnimplemented.swift:14 — BoldTextModifier / MonospacedTextModifier don’t override modify(style:environment:) or isEqual(to:), so if they’re ever evaluated (e.g., Text equality via .anyTextModifier), they’ll hit AnyTextModifier’s abstract-method trap at runtime.
Severity: high
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
bfda42d to
2ee5de6
Compare
Summary
AttributeScopes.OpenSwiftUIAttributesand OpenSwiftUI attributed string attribute definitions.Textstorage, style transfer, platform attributed string conversion, and localized formatting support.Text.ScaleAPIs and tests.