mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-09-27 03:33:37 +00:00
Added an overview of all files attached to a chat
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
63eedafb1c
commit
0929e54cbf
@ -112,6 +112,10 @@
|
|||||||
|
|
||||||
<AttachDocuments Name="File Attachments" DocumentPaths="@this.ComposerState.FileAttachments" DocumentPathsChanged="@this.ComposerAttachmentsChanged" CatchAllDocuments="true" UseSmallForm="true" ShowMediaStatus="false" Provider="@this.Provider" OwnerChat="@this.ChatThread" EnsureOwnerChatAsync="@this.EnsureMediaImportChatAsync" Disabled="@this.MediaTranscriptionService.IsBusy(this.CurrentMediaImportOwner)"/>
|
<AttachDocuments Name="File Attachments" DocumentPaths="@this.ComposerState.FileAttachments" DocumentPathsChanged="@this.ComposerAttachmentsChanged" CatchAllDocuments="true" UseSmallForm="true" ShowMediaStatus="false" Provider="@this.Provider" OwnerChat="@this.ChatThread" EnsureOwnerChatAsync="@this.EnsureMediaImportChatAsync" Disabled="@this.MediaTranscriptionService.IsBusy(this.CurrentMediaImportOwner)"/>
|
||||||
|
|
||||||
|
<MudTooltip Text="@T("Show all files attached to this chat")" Placement="@TOOLBAR_TOOLTIP_PLACEMENT">
|
||||||
|
<MudIconButton Icon="@Icons.Material.Filled.LibraryBooks" Disabled="@(!this.HasSentFileAttachments)" OnClick="@this.ShowSentFileAttachments"/>
|
||||||
|
</MudTooltip>
|
||||||
|
|
||||||
<MudDivider Vertical="true" Style="height: 24px; align-self: center;"/>
|
<MudDivider Vertical="true" Style="height: 24px; align-self: center;"/>
|
||||||
|
|
||||||
<MudTooltip Text="@T("Bold")" Placement="@TOOLBAR_TOOLTIP_PLACEMENT">
|
<MudTooltip Text="@T("Bold")" Placement="@TOOLBAR_TOOLTIP_PLACEMENT">
|
||||||
|
|||||||
@ -673,6 +673,24 @@ public partial class ChatComponent : MSGComponentBase
|
|||||||
|
|
||||||
private bool CanThreadBeCopied => this.CanThreadBeSaved && !this.IsCurrentChatStreaming && !this.MediaTranscriptionService.IsBusy(this.CurrentMediaImportOwner);
|
private bool CanThreadBeCopied => this.CanThreadBeSaved && !this.IsCurrentChatStreaming && !this.MediaTranscriptionService.IsBusy(this.CurrentMediaImportOwner);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The files attached to the messages of this chat which were already sent, each one once.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Told apart by their path rather than as records: a file which changed in size between two
|
||||||
|
/// messages would otherwise appear twice. The draft is left out, because the paperclip right
|
||||||
|
/// beside the overview already shows it.
|
||||||
|
/// </remarks>
|
||||||
|
private HashSet<FileAttachment> SentFileAttachments => this.ChatThread?.Blocks
|
||||||
|
.Where(block => !block.HideFromUser && block.Content is not null)
|
||||||
|
.SelectMany(block => block.Content!.FileAttachments)
|
||||||
|
.DistinctBy(attachment => attachment.FilePath)
|
||||||
|
.ToHashSet() ?? [];
|
||||||
|
|
||||||
|
private bool HasSentFileAttachments => this.ChatThread?.Blocks.Any(block => !block.HideFromUser && block.Content?.FileAttachments.Count > 0) ?? false;
|
||||||
|
|
||||||
|
private async Task ShowSentFileAttachments() => await ReviewAttachmentsDialog.OpenDialogAsync(this.DialogService, this.SentFileAttachments, canRemove: false);
|
||||||
|
|
||||||
private string TooltipAddChatToWorkspace => string.Format(T("Start new chat in workspace '{0}'"), this.currentWorkspaceName);
|
private string TooltipAddChatToWorkspace => string.Format(T("Start new chat in workspace '{0}'"), this.currentWorkspaceName);
|
||||||
|
|
||||||
private string UserInputStyle => this.SettingsManager.ConfigurationData.Confidence.ShowProviderConfidence ? this.Provider.UsedLLMProvider.GetConfidence(this.SettingsManager).SetColorStyle(this.SettingsManager) : string.Empty;
|
private string UserInputStyle => this.SettingsManager.ConfigurationData.Confidence.ShowProviderConfidence ? this.Provider.UsedLLMProvider.GetConfidence(this.SettingsManager).SetColorStyle(this.SettingsManager) : string.Empty;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user