Feature/dynamic data loading - #121
Merged
Merged
Conversation
…dling - Make ZFS dataset and snapshot loading asynchronous to prevent UI blocking. - Introduce `DataLoader` and `LoadingContainer` to display loading indicators for Dataset Info and Snapshot Browser. - Move `eventbus` from `internal/ui/util` to `internal/util` for broader usage. - Improve file browser table to gracefully handle nil stats during async loading. - Enhance ZFS dataset resolution using `gopath` and add fallback metadata fetching. - Change Snapshot `CreationDate` from `*time.Time` to `time.Time`. - Add new properties to Dataset Info (Compression, Encrypted, Key Status) and sort them alphabetically. - Improve thread safety for dataset cache with mutexes.
…t information asynchronously, preventing the UI from freezing on startup. Key changes: - ZFS data is now loaded in a background goroutine. - Introduced `DataLoader` and `LoadingContainer` components to provide visual feedback (e.g., "Loading...") in the UI while data is being fetched. - The file browser and snapshot browser are now more robust and can render partial data while waiting for background operations to complete. - Improved thread safety for the shared ZFS dataset cache using a RWMutex. - Enhanced ZFS dataset discovery and property fetching logic for better reliability. - Moved the generic `Emitter` (event bus) to a common `util` package. - The UI now initializes only after the initial dataset list is loaded, ensuring a better user experience.
This commit improves the user experience when navigating between directories by intelligently preserving or clearing snapshot state based on the dataset boundaries: * FileBrowser: Retain the currently selected snapshot if the new path is within the same dataset. This ensures that active diffs remain visible while navigating the directory tree. * SnapshotBrowser: Clear the snapshot state immediately if the newly selected path belongs to a different dataset. This prevents stale snapshots from remaining visible while the new dataset loads. * SnapshotBrowser: Refine the loading logic to only use quiet loading when navigating within the subpaths of the current dataset. * SnapshotBrowser: Always emit the `SelectedSnapshotChanged` event after snapshots load to guarantee that all UI components (like the FileBrowser) are fully synchronized with the selection state.
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.
Description
This pull request refactors the application to load ZFS datasets and snapshots asynchronously, significantly improving performance and preventing UI freezes during startup and navigation. Additionally, it introduces robust state handling for intra-dataset navigation, ensuring a smoother user experience.
Key Changes
🚀 Features & Enhancements
DataLoaderandLoadingContainercomponents to show loading states (e.g., "Loading...") while data is being fetched.RWMutexto the shared ZFS dataset cache to guarantee thread-safe concurrent access.Emitter(event bus) to a commoninternal/utilpackage for broader application use.🐛 Bug Fixes
gopathand added fallback metadata fetching for better reliability.nilstats during asynchronous loads.SelectedSnapshotChangedwhenever snapshot loading completes.🧹 Chores
CreationDatefrom*time.Timetotime.Time.