fix: size column fallback and table row interactions

- Fix: Size column falls back to 'bytesText' if sizeBytes is unknown
- Fix: Prevent filename text from intercepting row selection taps
- Fix: Use explicit window ID to ensure download properties opens reliably on double click
This commit is contained in:
nimbold
2026-06-07 23:59:03 +03:30
parent fbae92aae9
commit bd6aa867c7
3 changed files with 78 additions and 3 deletions
+15 -2
View File
@@ -46,16 +46,29 @@ struct DownloadTable: View {
.font(.headline)
.lineLimit(1)
.truncationMode(.tail)
.allowsHitTesting(false)
.draggable(item.id.uuidString)
}
}
.width(min: 200, ideal: 340)
TableColumn("Size", value: \.sortableSize) { item in
Text(ByteFormatter.string(item.sizeBytes))
if let size = item.sizeBytes, size > 0 {
Text(ByteFormatter.string(size))
.monospacedDigit()
.lineLimit(1)
.truncationMode(.tail)
} else if item.bytesText != "-" && !item.bytesText.isEmpty {
Text(item.bytesText)
.monospacedDigit()
.lineLimit(1)
.truncationMode(.tail)
} else {
Text("Unknown")
.monospacedDigit()
.lineLimit(1)
.truncationMode(.tail)
}
}
.width(min: 80, ideal: 100)
@@ -152,7 +165,7 @@ struct DownloadTable: View {
if item.status == .completed {
openFile(item)
} else {
openWindow(value: item.id)
openWindow(id: "download-properties", value: item.id)
}
}
+1 -1
View File
@@ -115,7 +115,7 @@ struct FirelinkApp: App {
}
.windowResizability(.contentSize)
WindowGroup("Download Properties", for: UUID.self) { $downloadID in
WindowGroup("Download Properties", id: "download-properties", for: UUID.self) { $downloadID in
if let downloadID {
DownloadPropertiesWindow(downloadID: downloadID)
.environmentObject(controller)