-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Menu: let metric meta and reset rows wrap instead of truncating #2742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2bac53c
a022b65
b69f82f
0b2e490
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -539,7 +539,9 @@ private struct MetricRow: View { | |
| Text(resetText) | ||
| .font(.footnote) | ||
| .foregroundStyle(MenuHighlightStyle.secondary(self.isHighlighted)) | ||
| .lineLimit(1) | ||
| .lineLimit(2) | ||
| .multilineTextAlignment(.trailing) | ||
| .fixedSize(horizontal: false, vertical: true) | ||
| } | ||
| } | ||
| UsageProgressBar( | ||
|
|
@@ -554,8 +556,9 @@ private struct MetricRow: View { | |
| Text(metaText) | ||
| .font(.footnote) | ||
| .foregroundStyle(MenuHighlightStyle.secondary(self.isHighlighted)) | ||
| .lineLimit(1) | ||
| .lineLimit(2) | ||
| .truncationMode(.tail) | ||
| .fixedSize(horizontal: false, vertical: true) | ||
|
Comment on lines
+559
to
+561
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When an already-populated metric changes from a short countdown or pace string to a longer one—for example, when a forecast is appended after refresh—these lines now change the card's height. However, Useful? React with 👍 / 👎. |
||
| } | ||
| if let detail = self.metric.detailText { | ||
| Text(detail) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a stable reset label sits near the wrapping threshold, a width-changing title update—such as
9% leftbecoming100% left, or a longer dynamic window title—reduces the space offered to the reset text in the sameHStackand can change it from one line to two. This fingerprint still hashes only reset/meta content and intentionally ignores percentage changes, so the old one-line cached height is reused and the new second line can be clipped. Fresh evidence in this revision is that reset wrapping was introduced while the cache key still omitspresentation.titleText; include that width-affecting text in the fingerprint as well.Useful? React with 👍 / 👎.