adwaita: make the channel refresh button respond while a tab load is in flight #6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/adwaita-refresh-button"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
On a subscribed channel the header's refresh button could feel completely dead:
ChannelPage::refreshbailed out whenever a tab fetch was still in flight (refreshing || loading), with no feedback of any kind. On a slow or challenge-gated instance the initial tab fetch routinely runs 30s+, so a click during that window was silently swallowed — and even after the load finished, a refresh itself could take minutes with zero indication anything was happening.Fix
refresh()no longer refuses whileloading: it cancels any in-flight tab fetch the same wayselect_tabdoes (generation bump + flag reset, which the method already did). A tab fetch that races the refresh (e.g. Load more clicked mid-refresh) is cancelled in the completion handler before the forced tab reload, and its discarded result re-anchors the cursor via the fresh first page.gtk::Spinner(and the button goes insensitive) while the refresh runs, restoring the idle icon when it lands — including when the refresh is superseded. This matches the macOS shell, which shows aProgressViewand disables the button.Verification
Reproduced against a scripted slow local instance (10s per request):
cargo test: 302 passed; the two failures (playback::tests::enabled_tor_surfaces_bootstrap_failure,ui::stats::tests::selected_period_has_a_compact_readable_label) also fail/pass onmainindependent of this change.