mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-13 04:41:37 +00:00
Add preview functionality for file attachments in ReviewAttachmentsDialog
This commit is contained in:
parent
9df0744d09
commit
684da62983
@ -46,19 +46,24 @@
|
|||||||
</MudTooltip>
|
</MudTooltip>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<MudTooltip Text="@T("Remove this attachment.")" Placement="Placement.Bottom">
|
<MudToolBar WrapContent="true" Gutters="false" Class="ml-2" Style="flex-shrink: 0; min-height: 1em;">
|
||||||
<MudIconButton Icon="@Icons.Material.Filled.Delete"
|
<MudTooltip Text="@T("Preview what we send to the AI.")" Placement="Placement.Bottom">
|
||||||
Color="Color.Error"
|
<MudIconButton Icon="@Icons.Material.Filled.Search"
|
||||||
Class="ml-2"
|
Color="Color.Primary"
|
||||||
Style="flex-shrink: 0;"
|
OnClick="@(() => this.InvestigateFile(fileAttachment))"/>
|
||||||
OnClick="@(() => this.DeleteAttachment(fileAttachment))"/>
|
</MudTooltip>
|
||||||
</MudTooltip>
|
|
||||||
|
<MudTooltip Text="@T("Remove this attachment.")" Placement="Placement.Bottom">
|
||||||
|
<MudIconButton Icon="@Icons.Material.Filled.Delete"
|
||||||
|
Color="Color.Error"
|
||||||
|
OnClick="@(() => this.DeleteAttachment(fileAttachment))"/>
|
||||||
|
</MudTooltip>
|
||||||
|
</MudToolBar>
|
||||||
</MudStack>
|
</MudStack>
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<MudStack Row Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center" Class="ms-3 mb-2">
|
<MudStack Row Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center" Class="ms-3">
|
||||||
<div style="min-width: 0; flex: 1; overflow: hidden;">
|
<div style="min-width: 0; flex: 1; overflow: hidden;">
|
||||||
<MudTooltip Text="@T("The file was deleted, renamed, or moved.")" Placement="Placement.Bottom">
|
<MudTooltip Text="@T("The file was deleted, renamed, or moved.")" Placement="Placement.Bottom">
|
||||||
<span class="d-inline-flex align-items-center" style="overflow: hidden; width: 100%;">
|
<span class="d-inline-flex align-items-center" style="overflow: hidden; width: 100%;">
|
||||||
@ -70,13 +75,17 @@
|
|||||||
</MudTooltip>
|
</MudTooltip>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<MudTooltip Text="@T("Remove this attachment.")" Placement="Placement.Bottom">
|
<MudToolBar WrapContent="true" Gutters="false" Class="ml-2" Style="flex-shrink: 0; min-height: 1em;">
|
||||||
<MudIconButton Icon="@Icons.Material.Filled.Delete"
|
<MudIconButton Icon="@Icons.Material.Filled.Search"
|
||||||
Color="Color.Error"
|
Color="Color.Primary"
|
||||||
Class="ml-2"
|
Disabled="true"/>
|
||||||
Style="flex-shrink: 0;"
|
|
||||||
OnClick="@(() => this.DeleteAttachment(fileAttachment))"/>
|
<MudTooltip Text="@T("Remove this attachment.")" Placement="Placement.Bottom">
|
||||||
</MudTooltip>
|
<MudIconButton Icon="@Icons.Material.Filled.Delete"
|
||||||
|
Color="Color.Error"
|
||||||
|
OnClick="@(() => this.DeleteAttachment(fileAttachment))"/>
|
||||||
|
</MudTooltip>
|
||||||
|
</MudToolBar>
|
||||||
</MudStack>
|
</MudStack>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -46,4 +46,18 @@ public partial class ReviewAttachmentsDialog : MSGComponentBase
|
|||||||
this.StateHasChanged();
|
this.StateHasChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The user might want to check what we actually extract from his file and therefore give the LLM as an input.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="fileAttachment">The file to check.</param>
|
||||||
|
private async Task InvestigateFile(FileAttachment fileAttachment)
|
||||||
|
{
|
||||||
|
var dialogParameters = new DialogParameters<DocumentCheckDialog>
|
||||||
|
{
|
||||||
|
{ x => x.Document, fileAttachment },
|
||||||
|
};
|
||||||
|
|
||||||
|
await this.DialogService.ShowAsync<DocumentCheckDialog>(T("Document Preview"), dialogParameters, DialogOptions.FULLSCREEN);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user