From 5a3d06c527cf03d68149449965fade0dd5ea0ed2 Mon Sep 17 00:00:00 2001 From: Dustin Mierau Date: Tue, 11 Nov 2025 20:25:40 -0800 Subject: Fix warning in console about panel not restoring. Add popover for compact transfers list items. Remove push notification entitlement. --- Hotline/Hotline.entitlements | 4 ---- .../Transfers/HotlineFileDownloadClient.swift | 4 +--- Hotline/Info.plist | 10 ++++---- Hotline/Library/Views/HotlinePanel.swift | 5 +++- Hotline/macOS/ServerView.swift | 28 +++++++++++++++++++++- 5 files changed, 38 insertions(+), 13 deletions(-) diff --git a/Hotline/Hotline.entitlements b/Hotline/Hotline.entitlements index e15d27d..074bc56 100644 --- a/Hotline/Hotline.entitlements +++ b/Hotline/Hotline.entitlements @@ -2,10 +2,6 @@ - aps-environment - development - com.apple.developer.aps-environment - development com.apple.developer.icloud-container-identifiers iCloud.co.goodmake.hotline diff --git a/Hotline/Hotline/Transfers/HotlineFileDownloadClient.swift b/Hotline/Hotline/Transfers/HotlineFileDownloadClient.swift index 82f61d4..6441047 100644 --- a/Hotline/Hotline/Transfers/HotlineFileDownloadClient.swift +++ b/Hotline/Hotline/Transfers/HotlineFileDownloadClient.swift @@ -125,9 +125,7 @@ public class HotlineFileDownloadClient: @MainActor HotlineTransferClient { destinationURL = url.resolvingSymlinksInPath() destinationFilename = destinationURL.lastPathComponent case .downloads(let filename): - var downloadsURL = fm.urls(for: .downloadsDirectory, in: .userDomainMask)[0] - downloadsURL = downloadsURL.resolvingSymlinksInPath() - destinationURL = URL(filePath: downloadsURL.generateUniqueFilePath(filename: filename)) + destinationURL = URL.downloadsDirectory.resolvingSymlinksInPath().generateUniqueFileURL(filename: filename) destinationFilename = destinationURL.lastPathComponent } diff --git a/Hotline/Info.plist b/Hotline/Info.plist index 82ee6ac..59b1e50 100644 --- a/Hotline/Info.plist +++ b/Hotline/Info.plist @@ -7,11 +7,13 @@ CFBundleTypeName Hotline Bookmark + CFBundleTypeRole + Editor LSHandlerRank Owner LSItemContentTypes - 'HTbm' + 'HTbm' @@ -19,7 +21,7 @@ CFBundleTypeRole - Viewer + Editor CFBundleURLName co.goodmake.hotline CFBundleURLSchemes @@ -29,7 +31,7 @@ CFBundleTypeRole - Viewer + Editor CFBundleURLName co.goodmake.hotline CFBundleURLSchemes @@ -46,7 +48,7 @@ UTTypeIconFiles UTTypeIdentifier - 'HTbm' + 'HTbm' UTTypeTagSpecification public.filename-extension diff --git a/Hotline/Library/Views/HotlinePanel.swift b/Hotline/Library/Views/HotlinePanel.swift index d7d8284..f6d76fc 100644 --- a/Hotline/Library/Views/HotlinePanel.swift +++ b/Hotline/Library/Views/HotlinePanel.swift @@ -22,7 +22,10 @@ class HotlinePanel: NSPanel { // Don't delete panel state when it's closed. self.isReleasedWhenClosed = false - + + // Disable state restoration for this utility panel + self.isRestorable = false + self.standardWindowButton(.closeButton)?.isHidden = false self.standardWindowButton(.zoomButton)?.isHidden = true self.standardWindowButton(.miniaturizeButton)?.isHidden = true diff --git a/Hotline/macOS/ServerView.swift b/Hotline/macOS/ServerView.swift index 98ab976..399deba 100644 --- a/Hotline/macOS/ServerView.swift +++ b/Hotline/macOS/ServerView.swift @@ -425,6 +425,7 @@ struct ServerTransferRow: View { @Environment(HotlineState.self) private var model: HotlineState @State private var hovered: Bool = false @State private var buttonHovered: Bool = false + @State private var detailsShown: Bool = false var body: some View { HStack(alignment: .center, spacing: 5) { @@ -508,6 +509,7 @@ struct ServerTransferRow: View { withAnimation(.snappy(duration: 0.25, extraBounce: 0.3)) { self.hovered = hovered } + self.detailsShown = hovered } .onTapGesture(count: 2) { guard transfer.completed, let url = transfer.fileURL else { @@ -516,7 +518,31 @@ struct ServerTransferRow: View { NSWorkspace.shared.activateFileViewerSelecting([url]) } - .help(self.formattedProgressHelp) + .popover(isPresented: .constant(self.detailsShown && !self.transfer.done), arrowEdge: .trailing) { + let rows: [(String, String)] = [ + ("document", self.transfer.title), + ("info", self.transfer.displaySize), + (self.transfer.isUpload ? "arrow.up" : "arrow.down", self.transfer.displaySpeed ?? "--"), + ("clock", self.transfer.displayTimeRemaining ?? "--") + ] + + Grid(alignment: .leading, horizontalSpacing: 8, verticalSpacing: 8) { + ForEach(rows, id: \.0) { imageName, label in + GridRow { + Image(systemName: imageName) + .resizable() + .scaledToFit() + .frame(width: 16, height: 16) + .gridColumnAlignment(.trailing) + Text(label) + .monospacedDigit() + .gridColumnAlignment(.leading) + } + } + } + .frame(minWidth: 200, maxWidth: 350, alignment: .leading) + .padding() + } } private var formattedProgressHelp: String { -- cgit