aboutsummaryrefslogtreecommitdiff
path: root/Hotline/macOS
diff options
context:
space:
mode:
authorDustin Mierau <dustin@mierau.me>2025-10-22 21:15:04 -0700
committerDustin Mierau <dustin@mierau.me>2025-10-22 21:15:04 -0700
commit485e4d981b6cd19a1e00ebf244ed1dd538fba284 (patch)
tree8e5a5996b7597c671e947f1ba732aa07140b031e /Hotline/macOS
parent46213b6e09b8b23bfa039634ff5af4919c758473 (diff)
Improvements to file search UI and config.
Diffstat (limited to 'Hotline/macOS')
-rw-r--r--Hotline/macOS/FilesView.swift64
-rw-r--r--Hotline/macOS/TrackerView.swift3
2 files changed, 43 insertions, 24 deletions
diff --git a/Hotline/macOS/FilesView.swift b/Hotline/macOS/FilesView.swift
index 206e0a4..4498dc9 100644
--- a/Hotline/macOS/FilesView.swift
+++ b/Hotline/macOS/FilesView.swift
@@ -255,6 +255,16 @@ struct FilesView: View {
return nil
}
}
+
+ private var searchStatusPath: String? {
+ guard let path = model.fileSearchCurrentPath else {
+ return nil
+ }
+ if path.isEmpty {
+ return "/"
+ }
+ return "/" + path.joined(separator: "/") + "/"
+ }
private func openPreviewWindow(_ previewInfo: PreviewFileInfo) {
switch previewInfo.previewType {
@@ -529,56 +539,64 @@ struct FilesView: View {
}
.safeAreaInset(edge: .top) {
if isShowingSearchResults, let message = searchStatusMessage {
- HStack {
- Spacer()
-
+ HStack(alignment: .center, spacing: 6) {
if case .searching(_, _) = model.fileSearchStatus {
ProgressView()
.controlSize(.small)
- .tint(.red)
+ .accentColor(.white)
+ .tint(.white)
}
else if case .completed = model.fileSearchStatus {
Image(systemName: "checkmark.circle.fill")
.resizable()
- .symbolRenderingMode(.palette)
- .foregroundStyle(.white, .fileComplete)
+ .symbolRenderingMode(.monochrome)
+ .foregroundStyle(.white)
.aspectRatio(contentMode: .fit)
.frame(width: 16, height: 16)
}
else if case .failed = model.fileSearchStatus {
Image(systemName: "exclamationmark.triangle.fill")
.resizable()
- .symbolRenderingMode(.multicolor)
+ .symbolRenderingMode(.monochrome)
+ .foregroundStyle(.white)
.aspectRatio(contentMode: .fit)
.frame(width: 16, height: 16)
}
Text(message)
+ .lineLimit(1)
.font(.body)
.foregroundStyle(.white)
Spacer()
+
+ if let pathMessage = searchStatusPath {
+ Text(pathMessage)
+ .lineLimit(1)
+ .truncationMode(.tail)
+ .font(.footnote)
+// .fontWeight(.semibold)
+ .foregroundStyle(.white)
+ .opacity(0.5)
+ .padding(.top, 2)
+ }
}
-// .overlay(alignment: .leading) {
-// Button {
-// model.cancelFileSearch(clearResults: true)
-// } label: {
-// Image(systemName: "xmark.circle.fill")
-// .resizable()
-// .scaledToFit()
-// .foregroundStyle(.white)
-// .opacity(0.8)
-// }
-// .buttonStyle(.plain)
-// }
- .padding(.horizontal, 8)
- .padding(.leading, 4)
+ .padding(.trailing, 14)
+ .padding(.leading, 8)
.padding(.vertical, 8)
.background {
- Color(nsColor: .controlAccentColor)
- .clipShape(.capsule(style: .continuous))
+ Group {
+ if case .completed = model.fileSearchStatus {
+ Color.fileComplete
+ }
+ else {
+ Color(nsColor: .controlAccentColor)
+ }
+ }
+ .clipShape(.capsule(style: .continuous))
}
.padding(.horizontal, 8)
+ .padding(.top, 8)
}
}
}
diff --git a/Hotline/macOS/TrackerView.swift b/Hotline/macOS/TrackerView.swift
index 83a56b8..c14f982 100644
--- a/Hotline/macOS/TrackerView.swift
+++ b/Hotline/macOS/TrackerView.swift
@@ -416,8 +416,9 @@ struct TrackerView: View {
// Not expanded, expand it (which also fetches)
self.setExpanded(true, for: bookmark)
}
+ return
}
- return
+ break
default:
break
}