fix(macos): wrap usage provider errors

This commit is contained in:
Peter Steinberger
2026-01-11 02:35:48 +01:00
parent 340d1c64b4
commit 2cc0d8c058
3 changed files with 25 additions and 9 deletions

View File

@@ -37,12 +37,14 @@ struct UsageMenuLabelView: View {
Spacer(minLength: 4)
Text(self.row.detailText())
.font(.caption.monospacedDigit())
.foregroundStyle(self.secondaryTextColor)
.lineLimit(1)
.fixedSize(horizontal: true, vertical: false)
.layoutPriority(2)
if !self.row.hasError {
Text(self.row.detailText())
.font(.caption.monospacedDigit())
.foregroundStyle(self.secondaryTextColor)
.lineLimit(1)
.truncationMode(.tail)
.layoutPriority(2)
}
if self.showsChevron {
Image(systemName: "chevron.right")
@@ -51,6 +53,16 @@ struct UsageMenuLabelView: View {
.padding(.leading, 2)
}
}
if let error = self.row.error?.nonEmpty {
Text(error)
.font(.caption)
.foregroundStyle(self.secondaryTextColor)
.multilineTextAlignment(.leading)
.lineLimit(2)
.truncationMode(.tail)
.fixedSize(horizontal: false, vertical: true)
}
}
.padding(.vertical, 10)
.padding(.leading, self.paddingLeading)