Feature/long running dialog actions - #134
Merged
Merged
Conversation
This commit refactors the dialog system to handle actions asynchronously, preventing the UI from blocking during long-running operations. Key Changes: - The `SelectionDialog` now manages background tasks with a `handler` function and updates the UI with an `onComplete` callback. - A loading spinner animation is now displayed within dialogs to provide clear visual feedback while an action is in progress. - Added standardized `NewSuccessDialog` and `NewErrorDialog` for consistent user feedback across the application. - Updated the `FileBrowser` and `SnapshotBrowser` to use the new asynchronous dialogs for all actions (e.g., create, delete, restore, diff), significantly improving UI responsiveness.
Removes the `SetHandler` method from `SelectionDialog` and moves the `handler` and `onComplete` callbacks to the constructor. This makes the dialog's behavior more predictable by setting its actions at creation time. This change simplifies the calling code by removing the need for a separate `SetHandler` call and encourages a more functional style of creating dialogs. The handler and onComplete callbacks now also receive the dialog instance, allowing them to interact with it directly (e.g., to close it).
… newest entry after creation, refactor
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.
Refactor UI for Asynchronous Operations and Improved UX
This PR introduces a major refactoring of the UI to handle background tasks asynchronously, preventing the UI from blocking during long-running operations like creating or deleting snapshots. It also improves the user experience by adding loading spinners, standardized success/error dialogs, and fixing a bug in the external diff viewer.
Key Changes
SelectionDialognow manages background tasks with ahandlerfunction and updates the UI with anonCompletecallback. This prevents the UI from freezing during operations.SelectionDialogAPI is simplified by removing theSetHandlermethod and moving callbacks to the constructor, making the dialog's behavior more predictable.NewSuccessDialogandNewErrorDialogfor consistent user feedback across the application.