Minor quicklook fixes. (#6112)

* Only show a spinner when opening the media viewer is slow

* Keep a sent local echo's page in the media viewer

* Fix the caption visibility.

---------

Co-authored-by: Stefan Ceriu <stefan.ceriu@gmail.com>
Co-authored-by: Matthew Hodgson <matthew@matrix.org>
This commit is contained in:
Doug
2026-09-08 09:40:43 +01:00
committed by GitHub
parent 1af16e92db
commit 15627e4512
4 changed files with 112 additions and 10 deletions
@@ -708,8 +708,15 @@ class TimelineViewModel: TimelineViewModelType, TimelineViewModelProtocol {
}
private func handleMediaTapped(with itemID: TimelineItemIdentifier, galleryIndex: Int? = nil) async {
state.showLoading = true
// Building the media timeline takes ~100ms from the event cache, however its possible that
// a focussed timeline may hit /context so we need to show a spinner when it's actually slow.
let spinner = Task {
try? await Task.sleep(for: .milliseconds(300))
guard !Task.isCancelled else { return }
state.showLoading = true
}
let action = await timelineInteractionHandler.processItemTap(itemID)
spinner.cancel()
switch action {
case .displayMediaPreview(let item, let timelineViewModelKind):