mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-04 13:07:21 +00:00
Added progress messages and quick access to exported files (#1112)
This commit is contained in:
1 parent
7f72da628e
commit
e0d8e18f34
33 files changed
+1130
-23
No files matched your search
@@ -0,0 +1,32 @@
|
||||
using AIStudio.Components;
|
||||
|
||||
namespace AIStudio.Tools;
|
||||
|
||||
/// <summary>
|
||||
/// The notification that a file is being exported.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// It stays until the export ends, however long that takes, since a timeout would claim an end which
|
||||
/// has not happened. Closing it is allowed: the export goes on all the same.
|
||||
/// </remarks>
|
||||
/// <param name="Key">The key of the export, shared with its success notification, which replaces this one.</param>
|
||||
/// <param name="FilePath">The file the export writes.</param>
|
||||
public readonly record struct DataFileExportRunningMessage(string Key, string FilePath)
|
||||
{
|
||||
public void Show(ISnackbar snackbar)
|
||||
{
|
||||
var parameters = new Dictionary<string, object>
|
||||
{
|
||||
[nameof(FileExportRunningMessage.FileName)] = Path.GetFileName(this.FilePath)
|
||||
};
|
||||
|
||||
snackbar.Add<FileExportRunningMessage>(parameters, Severity.Info, config =>
|
||||
{
|
||||
config.HideIcon = true;
|
||||
config.RequireInteraction = true;
|
||||
config.HideTransitionDuration = 600;
|
||||
}, this.Key);
|
||||
}
|
||||
|
||||
public void Hide(ISnackbar snackbar) => snackbar.RemoveByKey(this.Key);
|
||||
}
|
||||
Reference in new issue
Block a user