Implement line limit APIs - #958
Conversation
🤖 Augment PR SummarySummary: Completes OpenSwiftUI’s line-limit API surface and propagates both minimum and maximum line constraints through the environment so text layout can honor them. Changes:
Technical Notes: Ranged and space-reserving APIs now flow min/max constraints via 🤖 Was this summary useful? React with 👍 or 👎 |
| /// instances display. | ||
| @inlinable | ||
| nonisolated public func lineLimit(_ number: Int?) -> some View { | ||
| environment(\.lineLimit, number) |
There was a problem hiding this comment.
lineLimit(_ number: Int?) only writes EnvironmentValues.lineLimit; if an ancestor sets lowerLineLimit (via range/reservesSpace overloads), this overload will leave the old minimum in place, which can unexpectedly reserve/require extra lines. Consider ensuring this overload also resets the lower bound when setting/clearing the max.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| /// line in the ``Text`` element to the 2 lines that fit within the view's | ||
| /// bounds: | ||
| /// | ||
| /// Text("This is a long string that demonstrates the effect of OpenSwiftUI's lineLimit(:_) operator.") |
There was a problem hiding this comment.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #958 +/- ##
==========================================
+ Coverage 26.72% 26.78% +0.06%
==========================================
Files 731 732 +1
Lines 52738 52771 +33
==========================================
+ Hits 14094 14136 +42
+ Misses 38644 38635 -9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
lineLimitoverloadsEnvironmentValuesThis completes the line-limit API surface and lets text layout receive both minimum and maximum line constraints through the environment.