2.5.2 #12

Merged
rune merged 23 commits from 2.5.2 into main 2026-08-17 08:37:04 +02:00
Showing only changes of commit e3d0658a09 - Show all commits
+7 -12
View File
@@ -28,7 +28,6 @@ struct ModelInfoView: View {
@Environment(\.dismiss) var dismiss
@Bindable private var settings = SettingsService.shared
@State private var isDescriptionExpanded = false
var body: some View {
VStack(spacing: 0) {
@@ -73,6 +72,13 @@ struct ModelInfoView: View {
infoRow("Released", releaseDate.formatted(date: .abbreviated, time: .omitted))
}
if let desc = model.description {
// Always shown in full, no truncate/expand toggle Text with a lineLimit
// nested inside this view's ScrollView doesn't reliably compute wrapping/
// truncation (a well-documented SwiftUI/AppKit quirk: without a fixedSize
// hint it hard-clips mid-word with no ellipsis; with one, sibling views in
// the same VStack like the former "More" button can silently fail to
// lay out). The modal itself already scrolls, so a long description just
// means more scrolling, which sidesteps the whole bug class.
VStack(alignment: .leading, spacing: 6) {
Text("Description")
.font(.subheadline.weight(.medium))
@@ -80,18 +86,7 @@ struct ModelInfoView: View {
Text(desc)
.font(.body)
.foregroundColor(.primary)
.lineLimit(isDescriptionExpanded ? nil : 4)
.textSelection(.enabled)
if desc.count > 250 {
Button(isDescriptionExpanded ? "Less" : "More…") {
withAnimation(.easeInOut(duration: 0.2)) {
isDescriptionExpanded.toggle()
}
}
.font(.callout)
.foregroundStyle(.blue)
.buttonStyle(.plain)
}
}
.padding(.leading, 4)
}