Make the UI fluid: async clip loading, animations, smoother clip switching#38
Merged
Conversation
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.
What
A set of changes to make the app feel more fluid and responsive. (Squash-merge — the branch has an add-then-revert detour from exploring a video-overlay approach that didn't pan out; the net change is below.)
1. Load clips off the UI thread
LoadClipsscanned the disk (CamStorage.Map) synchronously on the UI thread from both startup and the folder picker, freezing the window during the scan (174 clips ≈ 140 ms on a real archive; worse for larger ones). NowLoadClipsAsyncruns the scan viaTask.Run; the continuation resumes on the UI thread (WPFSynchronizationContext), so all view-model state is still mutated there. Sibling of the playback-load fix in #33.2. Smoother clip switching (no loading-screen flash)
The video hosts now stay visible while a selected clip loads, so switching clips just shows the players briefly blank until the first frame decodes — instead of collapsing the video, flashing a full loading screen, and popping back. Less on-screen churn. The full-screen overlay is now reserved for the genuinely no-video states (scanning with no clip selected, errors, the empty state).
3. Fixed the sidebar flicker
RefreshClipState()re-notifiedFilteredClipson every clip change, rebuilding the list and retriggering its fade. It's now only notified when the list actually changes (folder load / filter text).4. Subtle animations
Loadedcan't leave it invisible).Notes / constraints
MainWindowViewModel.LoadClipsis nowLoadClipsAsync; callers alreadyawaitit.Verification
93 tests pass; build +
dotnet formatclean; smoke-launched on a real 174-clip archive (async scan, playback, animations) with no crashes. Animation/feel verified interactively by the maintainer.