fix(ui): live folder rows again - retain rows, seed first-run progress, force redraws (v0.122.0) - #152
Merged
Conversation
connect_progress() wires the progress forwarder after start() has already fired startup syncs. The run_active flag introduced in #145 starts false, so every event from the in-flight startup run was dropped and the folder row showed no per-file progress or bar movement. Seed the flag from scheduler.is_running() when connecting, so an in-flight run keeps emitting events. Later runs are still gated by prepare_sync()/finished() as before. Closes #148
GTK may not repaint the row when properties are updated from a subscription callback, so after a sync finishes the row could still show "Synchronizing…" with the old file caption until the user clicked elsewhere to force a redraw. Queue an explicit draw on the whole slot after every state render and on the progress label after every progress change, so the icon, spinner, run bar, subtitle and caption all update together without user interaction. Closes #150
AccountView::new built each FolderStatusRow, appended its slot and dropped the row object at the end of the loop. Since the fix for #121, dropping a row unsubscribes its live state and progress callbacks, so every row froze at the state it had when the view was built: no spinner, no run bar, no per-file progress and no queued state until the user switched accounts and back, which rebuilt the view. The view now owns its rows, so the subscriptions stay active while the rows are on screen and are still released when the view is rebuilt. Includes a regression test that flips a folder state and asserts the row repaints without a rebuild. Closes #151
'Synchronization Scheduled' read like a future calendar event; the folder is actually queued behind the running one. Reuses the existing catalog entry and updates the Spanish translation to 'A la espera'. Refs #151
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The folder rows in the main window froze at the state they had when the view was built: no spinner, no run progress bar, no per-file progress, no queued state. The sync engine ran fine in the background; only the view was blind. Switching accounts and back rebuilt the view, which painted the current state once - the only way to get an update.
Root cause
Regression from the #121 fix (v0.118.0):
FolderStatusRowgot aDropimpl that unsubscribes its live state/progress callbacks, butAccountView::newappended the row's slot widget and then dropped the row object at the end of the loop iteration. Every row lost its subscriptions immediately after construction and stayed painted with its initial state forever. Before #121 the dropped row kept its subscriptions alive (a leak, but the rows updated - which is why this used to work).Fix
AccountViewnow owns its rows (_folder_rows: Vec<FolderStatusRow>) for exactly as long as they are on screen; rebuilding the view drops them and unsubscribes, keeping the FolderStatusRow subscriptions leak when the row drops without unsubscribe #121 guarantee intact. Includes a regression test that flips a folder state and asserts the row repaints without a view rebuild.run_activewhen connecting the progress forwarder during an in-flight run (Large folder shows 'Syncing' state without current file name or progress bar #148) and force a redraw of the row slot after state/progress updates (Folder row does not redraw after sync completes until user interaction #150).Closes #151
Closes #148
Closes #150