Feature/improve responsiveness when selecting file browser entries - #128
Merged
markusressel merged 2 commits intoJun 20, 2026
Merged
Conversation
…ancel and diffSeq fields to snapshot_browser.go to track
cancellation and sequence numbers.
2. Asynchronous/Incremental Loop: Replaced synchronous table construction with startAsyncDiffCalculation() . The component now:
• Instantly renders the snapshots table with Unknown ( N/A ) diff states to keep the UI thread completely non-blocking.
• Spawns a background goroutine to perform os.Lstat filesystem diff queries.
• Dispatches updates to the UI thread using application.QueueUpdateDraw() .
• Incremental Redraw: Updates the UI after each of the first 5 calculations (visible entries) for instant visual feedback, and then
batches updates every 10 calculations to avoid rendering bottlenecks.
• Strict Cancellation: Immediately aborts and discards older computations when a new directory, file, or dataset is selected.
3. Verification: Checked all unit tests ( go test ./... ) and compiled the binary successfully ( just build ).
… call snapshotBrowser.tableContainer.GetEntries() on the main thread right after updating placeholder states. This gives us the exact order in which entries are sorted on the screen. 2. Top-to-Bottom Processing: The background calculation goroutine uses this sorted order to iterate and compute diff states sequentially. 3. Correct Re-sorting: When the UI is incrementally redrawn, SetData will correctly re-sort them based on the current active sort options, meaning the positions remain synchronized.
markusressel
deleted the
feature/improve-responsiveness-when-selecting-file-browser-entries
branch
June 20, 2026 22:23
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.
Asynchronous & Incremental Diff Loading in Snapshot Browser
Description
This pull request resolves the blocking interface lag/freeze that occurs when navigating or changing the selected entry in the file browser.
Previously, selecting a file triggered synchronous filesystem attribute queries (
os.Lstat) for every snapshot in the dataset on the main UI thread. In datasets with many snapshots, this caused a significant, blocking delay (input lag) while scrolling.This PR moves the diff state calculation to a background goroutine, updates the UI incrementally to ensure high responsiveness, and adds proper request cancellation and ordering logic.
Key Changes
1. Asynchronous Diff Computation
SnapshotBrowserComponentto compute diff states in a background goroutine rather than synchronously blocking the main UI thread duringupdateTableEntries.Unknown(N/A) diff states, giving the user immediate, non-blocking feedback.2. Presentation Order Synchronization (Top-to-Bottom)
tableContainer.GetEntries()).0tolen - 1of this sorted list, causing the calculated diff states to populate smoothly from top to bottom on the screen (regardless of active sorting parameters, e.g. ascending or descending).3. Concurrency Safety & Cancellation
diffCancel context.CancelFuncanddiffSeq atomic.Uint64fields to the component.4. Incremental UI Redraws
SetData()too frequently, the background task updates the table:5entries (providing near-instant feedback for the visible rows).10entries for the remainder of the calculation.Files Modified
Verification
go test ./...).just build).