Skip to content

Feature/dynamic data loading - #121

Merged
markusressel merged 12 commits into
mainfrom
feature/dynamic-data-loading
Jun 14, 2026
Merged

Feature/dynamic data loading#121
markusressel merged 12 commits into
mainfrom
feature/dynamic-data-loading

Conversation

@markusressel

@markusressel markusressel commented Jun 14, 2026

Copy link
Copy Markdown
Owner
image image image

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

  • Asynchronous Data Loading: ZFS dataset and snapshot loading is now performed in background goroutines, preventing UI blocking.
  • Visual Loading Indicators: Introduced DataLoader and LoadingContainer components to show loading states (e.g., "Loading...") while data is being fetched.
  • Intra-Dataset Navigation Optimizations:
    • Navigating within the same dataset preserves the selected snapshot, ensuring diffs remain visible in the file browser.
    • Navigating to a different dataset immediately clears stale snapshots before loading the new ones.
    • Snapshot loading happens quietly only when navigating subpaths of the current dataset.
  • Dataset Properties: Expanded Dataset Info to include Compression, Encrypted, and Key Status properties, sorted alphabetically.
  • Improved Caching: Added RWMutex to the shared ZFS dataset cache to guarantee thread-safe concurrent access.
  • Event Bus Refactor: Moved the generic Emitter (event bus) to a common internal/util package for broader application use.

🐛 Bug Fixes

  • Fixed a bug where snapshots would fail to load when switching datasets while an active snapshot load was already in progress.
  • Enhanced ZFS dataset resolution using gopath and added fallback metadata fetching for better reliability.
  • Improved the file browser table to gracefully handle nil stats during asynchronous loads.
  • Ensure all components are fully synchronized by emitting SelectedSnapshotChanged whenever snapshot loading completes.

🧹 Chores

  • Changed Snapshot CreationDate from *time.Time to time.Time.
  • Added missing files and cleaned up temporary files.

…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.
@markusressel markusressel added the enhancement New feature or request label Jun 14, 2026
@markusressel
markusressel merged commit 64cd5db into main Jun 14, 2026
3 checks passed
@markusressel
markusressel deleted the feature/dynamic-data-loading branch June 14, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant