mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-05 02:07:21 +00:00
Added a Send to menu to every chat message and kept restrictions when sending content on (#1124)
This commit is contained in:
1 parent
d06688ca08
commit
bf54b8cd0d
73 files changed
+1923
-390
No files matched your search
@@ -1,6 +1,8 @@
|
||||
using AIStudio.Chat;
|
||||
using AIStudio.Components;
|
||||
using AIStudio.Dialogs;
|
||||
using AIStudio.Dialogs.Settings;
|
||||
using AIStudio.Tools.AssistantLaunch;
|
||||
using AIStudio.Tools.AssistantSessions;
|
||||
using AIStudio.Tools.Services;
|
||||
|
||||
@@ -152,20 +154,18 @@ public partial class VisualBriefingAssistant : MSGComponentBase
|
||||
return;
|
||||
}
|
||||
|
||||
this.ApplyFilters([], [Event.SEND_TO_VISUAL_BRIEFING_ASSISTANT, Event.CONFIGURATION_CHANGED]);
|
||||
this.ApplyFilters([], [Event.CONFIGURATION_CHANGED]);
|
||||
this.MediaTranscriptionService.StateChanged += this.MediaStateChanged;
|
||||
this.BuildProgressService.Changed += this.BuildProgressChanged;
|
||||
await this.ReloadListAsync();
|
||||
await this.ConsumePendingMediaOutcomesAsync();
|
||||
this.MonitorSourceStatusAsync(this.sourceMonitorCancellation.Token).Observe($"{nameof(VisualBriefingAssistant)}: monitoring the source status");
|
||||
var deferredInstruction = this.MessageBus.TakeDeferredMessages<string>(Event.SEND_TO_VISUAL_BRIEFING_ASSISTANT).LastOrDefault();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(deferredInstruction))
|
||||
if (AssistantLaunchService.TakeTextPayload(ComponentKind.VISUAL_BRIEFING_ASSISTANT) is { } textLaunchPayload && !string.IsNullOrWhiteSpace(textLaunchPayload.Text))
|
||||
{
|
||||
if (this.selectedBriefing is null)
|
||||
await this.CreateBriefingAsync();
|
||||
|
||||
this.editor.Instruction = deferredInstruction;
|
||||
// A text sent here starts a briefing of its own, which holds what the text demands. The briefing
|
||||
// open last belongs to other work, and its instruction would be gone:
|
||||
await this.CreateBriefingAsync(textLaunchPayload.Restrictions);
|
||||
this.editor.Instruction = textLaunchPayload.Text;
|
||||
await this.SaveCurrentAsync();
|
||||
}
|
||||
|
||||
@@ -235,17 +235,6 @@ public partial class VisualBriefingAssistant : MSGComponentBase
|
||||
/// </summary>
|
||||
protected override async Task ProcessIncomingMessage<T>(ComponentBase? sendingComponent, Event triggeredEvent, T? data) where T : default
|
||||
{
|
||||
if (triggeredEvent is Event.SEND_TO_VISUAL_BRIEFING_ASSISTANT && data is string text)
|
||||
{
|
||||
if (this.selectedBriefing is null)
|
||||
await this.CreateBriefingAsync();
|
||||
|
||||
this.editor.Instruction = text;
|
||||
await this.SaveCurrentAsync();
|
||||
this.StateHasChanged();
|
||||
return;
|
||||
}
|
||||
|
||||
if (triggeredEvent is Event.CONFIGURATION_CHANGED)
|
||||
{
|
||||
// The spellchecking setting might have changed. Since this page is not re-parameterized
|
||||
|
||||
Reference in new issue
Block a user