diff --git a/app/MindWork AI Studio/Dialogs/ReviewAttachmentsDialog.razor b/app/MindWork AI Studio/Dialogs/ReviewAttachmentsDialog.razor
index 3528d5fc..8e11ef54 100644
--- a/app/MindWork AI Studio/Dialogs/ReviewAttachmentsDialog.razor
+++ b/app/MindWork AI Studio/Dialogs/ReviewAttachmentsDialog.razor
@@ -9,7 +9,14 @@
Disabled="@this.IsZoneDisabled"
Context="isDropTarget">
- @T("Here you can see all attached files. Files that can no longer be found (deleted, renamed, or moved) are marked with a warning icon and a strikethrough name. You can remove any attachment using the trash can icon.")
+ @if (this.CanRemove)
+ {
+ @T("Here you can see all attached files. Files that can no longer be found (deleted, renamed, or moved) are marked with a warning icon and a strikethrough name. You can remove any attachment using the trash can icon.")
+ }
+ else
+ {
+ @T("Here you can see all attached files. Files that can no longer be found (deleted, renamed, or moved) are marked with a warning icon and a strikethrough name.")
+ }
@if (this.CanAttach)
@@ -66,11 +73,14 @@
OnClick="@(() => this.InvestigateFile(fileAttachment))"/>
-
-
-
+ @if (this.CanRemove)
+ {
+
+
+
+ }
}
@@ -93,11 +103,14 @@
Color="Color.Primary"
Disabled="true"/>
-
-
-
+ @if (this.CanRemove)
+ {
+
+
+
+ }
}
diff --git a/app/MindWork AI Studio/Dialogs/ReviewAttachmentsDialog.razor.cs b/app/MindWork AI Studio/Dialogs/ReviewAttachmentsDialog.razor.cs
index daccf3c6..1f68c076 100644
--- a/app/MindWork AI Studio/Dialogs/ReviewAttachmentsDialog.razor.cs
+++ b/app/MindWork AI Studio/Dialogs/ReviewAttachmentsDialog.razor.cs
@@ -38,6 +38,16 @@ public partial class ReviewAttachmentsDialog : MSGComponentBase
[Parameter]
public Func? IsAttachingUnavailable { get; set; }
+ ///
+ /// Whether the user may remove attachments here.
+ ///
+ ///
+ /// False when this dialog gathers the attachments of several messages at once: a removal would
+ /// reach into a message that was already sent, and nothing here could tell which one.
+ ///
+ [Parameter]
+ public bool CanRemove { get; set; } = true;
+
[Inject]
private IDialogService DialogService { get; set; } = null!;
@@ -120,11 +130,12 @@ public partial class ReviewAttachmentsDialog : MSGComponentBase
private async Task PathsDropped(List paths) => await this.AttachPathsAsync(paths);
- public static async Task> OpenDialogAsync(IDialogService dialogService, HashSet documentPaths, Func, Task>>? attachPaths = null, Func? isAttachingUnavailable = null)
+ public static async Task> OpenDialogAsync(IDialogService dialogService, HashSet documentPaths, Func, Task>>? attachPaths = null, Func? isAttachingUnavailable = null, bool canRemove = true)
{
var dialogParameters = new DialogParameters
{
- { x => x.DocumentPaths, documentPaths }
+ { x => x.DocumentPaths, documentPaths },
+ { x => x.CanRemove, canRemove },
};
if (attachPaths is not null)