feat(collections): show loading spinner during stale-content reloads

Document reader and collection document list only showed a spinner on
first load — refetching over already-visible content (reopening a
document, remote-changes refresh) had no loading indicator at all.
This commit is contained in:
2026-08-14 02:18:58 +01:00
parent 4b23713c2b
commit a665eac9b7
2 changed files with 21 additions and 0 deletions
@@ -65,6 +65,16 @@ struct CollectionOverviewView: View {
}
}
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
// Corner spinner for reloads with stale data already on screen
// (remote-changes refresh, tab switch after the first load)
// `documentList`'s own spinner only covers the empty-state case.
.overlay(alignment: .topTrailing) {
if viewModel.isLoading && !viewModel.documents.isEmpty {
ProgressView()
.controlSize(.small)
.padding(12)
}
}
}
// No `.navigationTitle` here it renders its own native title bubble,
// duplicating the leading toolbar item `ContentView_macOS` already
@@ -49,6 +49,17 @@ struct DocumentReaderView: View {
.padding()
}
// No `.navigationTitle` here either same reason as CollectionOverviewView.
// Corner spinner, not gated on `text.isEmpty`: `viewModel.text` starts
// pre-filled from the list/summary copy of the doc, so the full-page
// spinner above rarely fires on open without this, the re-fetch in
// `loadFullContent()` looked like nothing was happening.
.overlay(alignment: .topTrailing) {
if viewModel.isLoading && !viewModel.text.isEmpty {
ProgressView()
.controlSize(.small)
.padding(12)
}
}
.task { await viewModel.loadFullContent() }
}