fix: restore Download Properties routing and gestures

- Fix: Revert WindowGroup to expect UUID and update ALL openWindow calls to explicitly use id: 'download-properties' to prevent routing poisoning
- Fix: Wrap the File Name cell in doubleClickableCell using .simultaneousGesture so double clicks trigger the action without eating single click row selection
This commit is contained in:
nimbold
2026-06-08 00:17:32 +03:30
parent 01ba9c4c9b
commit 8d5eb74fba
3 changed files with 101 additions and 10 deletions
+13 -8
View File
@@ -37,7 +37,8 @@ struct DownloadTable: View {
Table(sortedItems, selection: $selection, sortOrder: $sortOrder) {
TableColumn("File Name", value: \.fileName) { item in
HStack(alignment: .top, spacing: 8) {
doubleClickableCell(for: item) {
HStack(alignment: .top, spacing: 8) {
Image(systemName: item.category.symbolName)
.font(.title3)
.foregroundStyle(categoryColor(for: item.category))
@@ -47,6 +48,7 @@ struct DownloadTable: View {
.lineLimit(1)
.truncationMode(.tail)
.allowsHitTesting(false)
}
.draggable(item.id.uuidString)
}
}
@@ -103,11 +105,6 @@ struct DownloadTable: View {
}
.width(min: 100, ideal: 155)
}
.simultaneousGesture(TapGesture(count: 2).onEnded {
if let id = selection.first, let item = controller.downloads.first(where: { $0.id == id }) {
performPrimaryAction(for: item)
}
})
.environment(\.defaultMinListRowHeight, settings.listRowDensity.minRowHeight)
.contextMenu(forSelectionType: DownloadItem.ID.self) { itemIDs in
rowContextMenu(for: itemIDs)
@@ -161,11 +158,19 @@ struct DownloadTable: View {
}
}
private func doubleClickableCell<Content: View>(for item: DownloadItem, @ViewBuilder content: () -> Content) -> some View {
content()
.contentShape(Rectangle())
.simultaneousGesture(TapGesture(count: 2).onEnded {
performPrimaryAction(for: item)
})
}
private func performPrimaryAction(for item: DownloadItem) {
if item.status == .completed {
openFile(item)
} else {
openWindow(id: "download-properties", value: item.id.uuidString)
openWindow(id: "download-properties", value: item.id)
}
}
@@ -266,7 +271,7 @@ struct DownloadTable: View {
Button {
for target in targetItems {
openWindow(value: target.id)
openWindow(id: "download-properties", value: target.id)
}
} label: {
Label(targetItems.count > 1 ? "Properties (\(targetItems.count))" : "Properties", systemImage: "info.circle")
+2 -2
View File
@@ -115,8 +115,8 @@ struct FirelinkApp: App {
}
.windowResizability(.contentSize)
WindowGroup("Download Properties", id: "download-properties", for: String.self) { $downloadIDString in
if let idString = downloadIDString, let downloadID = UUID(uuidString: idString) {
WindowGroup("Download Properties", id: "download-properties", for: UUID.self) { $downloadID in
if let downloadID {
DownloadPropertiesWindow(downloadID: downloadID)
.environmentObject(controller)
.environmentObject(settings)