App-side chrome: new "Pointer Cursor" toggle (Settings -> Editor, outpost.pointerCursorEnabled, on by default) driving a shared .pointerCursorOnHover() view modifier (push/pop NSCursor.pointingHand, macOS-only, no-op on iOS) wired onto every clickable sidebar/list row: collection tree rows + disclosure chevron, flat collection list, document outline rows, collection-overview tab bar + document/search rows, global search results, command palette rows. In-document link hover: MarkdownEditorConfiguration gets a new pointerCursorOverLinksWhileEditing flag (default true). Read-only mode already showed a pointing hand over links unconditionally; editable mode never did (I-beam only) until now - applyReadOnlyCursor in NativeTextView+CursorRects.swift now applies the same over any .link range while editing too, gated by the flag. Wiki links already carry .link alongside their own custom .wikiLinkID, so they're covered with no extra work. Closes out the last item from the original preferences-wiring scope.
44 lines
1.5 KiB
Swift
44 lines
1.5 KiB
Swift
import SwiftUI
|
|
import OutlineKit
|
|
|
|
struct CollectionListContent: View {
|
|
var viewModel: CollectionsViewModel
|
|
let onSelect: (OutlineCollection) -> Void
|
|
|
|
var body: some View {
|
|
Group {
|
|
if viewModel.isLoading && viewModel.collections.isEmpty {
|
|
ProgressView()
|
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
} else if let errorMessage = viewModel.errorMessage, viewModel.collections.isEmpty {
|
|
ContentUnavailableView {
|
|
Label("Couldn't Load Collections", systemImage: "exclamationmark.triangle")
|
|
} description: {
|
|
Text(errorMessage)
|
|
} actions: {
|
|
Button("Retry") {
|
|
Task { await viewModel.load() }
|
|
}
|
|
}
|
|
} else if viewModel.collections.isEmpty {
|
|
ContentUnavailableView(
|
|
"No Collections",
|
|
systemImage: "folder",
|
|
description: Text("Collections you have access to will appear here.")
|
|
)
|
|
} else {
|
|
List(viewModel.collections) { collection in
|
|
Button {
|
|
onSelect(collection)
|
|
} label: {
|
|
CollectionRowView(collection: collection)
|
|
}
|
|
.buttonStyle(.plain)
|
|
.pointerCursorOnHover()
|
|
}
|
|
}
|
|
}
|
|
.task { await viewModel.load() }
|
|
}
|
|
}
|