mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-02-05 17:49:05 +00:00
Fixed the "send to" issue, where you could select the bias-of-the-day (#183)
This commit is contained in:
parent
8bd54e6d61
commit
bd97c0fb4b
@ -51,11 +51,8 @@
|
|||||||
@if (this.ShowSendTo)
|
@if (this.ShowSendTo)
|
||||||
{
|
{
|
||||||
<MudMenu StartIcon="@Icons.Material.Filled.Apps" EndIcon="@Icons.Material.Filled.KeyboardArrowDown" Label="Send to ..." Variant="Variant.Filled" Style="@this.GetSendToColor()" Class="rounded">
|
<MudMenu StartIcon="@Icons.Material.Filled.Apps" EndIcon="@Icons.Material.Filled.KeyboardArrowDown" Label="Send to ..." Variant="Variant.Filled" Style="@this.GetSendToColor()" Class="rounded">
|
||||||
@foreach (var assistant in Enum.GetValues<Components>().OrderBy(n => n.Name().Length))
|
@foreach (var assistant in Enum.GetValues<Components>().Where(n => n.AllowSendTo()).OrderBy(n => n.Name().Length))
|
||||||
{
|
{
|
||||||
if (assistant is Components.NONE || this.Component == assistant)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
<MudMenuItem OnClick="() => this.SendToAssistant(assistant, new())">
|
<MudMenuItem OnClick="() => this.SendToAssistant(assistant, new())">
|
||||||
@assistant.Name()
|
@assistant.Name()
|
||||||
</MudMenuItem>
|
</MudMenuItem>
|
||||||
@ -84,11 +81,8 @@
|
|||||||
|
|
||||||
case SendToButton sendToButton:
|
case SendToButton sendToButton:
|
||||||
<MudMenu StartIcon="@Icons.Material.Filled.Apps" EndIcon="@Icons.Material.Filled.KeyboardArrowDown" Label="Send to ..." Variant="Variant.Filled" Style="@this.GetSendToColor()" Class="rounded">
|
<MudMenu StartIcon="@Icons.Material.Filled.Apps" EndIcon="@Icons.Material.Filled.KeyboardArrowDown" Label="Send to ..." Variant="Variant.Filled" Style="@this.GetSendToColor()" Class="rounded">
|
||||||
@foreach (var assistant in Enum.GetValues<Components>().OrderBy(n => n.Name().Length))
|
@foreach (var assistant in Enum.GetValues<Components>().Where(n => n.AllowSendTo()).OrderBy(n => n.Name().Length))
|
||||||
{
|
{
|
||||||
if(assistant is Components.NONE || sendToButton.Self == assistant)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
<MudMenuItem OnClick="() => this.SendToAssistant(assistant, sendToButton)">
|
<MudMenuItem OnClick="() => this.SendToAssistant(assistant, sendToButton)">
|
||||||
@assistant.Name()
|
@assistant.Name()
|
||||||
</MudMenuItem>
|
</MudMenuItem>
|
||||||
|
@ -267,6 +267,9 @@ public abstract partial class AssistantBase : ComponentBase, IMessageBusReceiver
|
|||||||
|
|
||||||
protected Task SendToAssistant(Tools.Components destination, SendToButton sendToButton)
|
protected Task SendToAssistant(Tools.Components destination, SendToButton sendToButton)
|
||||||
{
|
{
|
||||||
|
if (!destination.AllowSendTo())
|
||||||
|
return Task.CompletedTask;
|
||||||
|
|
||||||
var contentToSend = sendToButton == default ? string.Empty : sendToButton.UseResultingContentBlockData switch
|
var contentToSend = sendToButton == default ? string.Empty : sendToButton.UseResultingContentBlockData switch
|
||||||
{
|
{
|
||||||
false => sendToButton.GetText(),
|
false => sendToButton.GetText(),
|
||||||
|
@ -5,6 +5,14 @@ namespace AIStudio.Tools;
|
|||||||
|
|
||||||
public static class ComponentsExtensions
|
public static class ComponentsExtensions
|
||||||
{
|
{
|
||||||
|
public static bool AllowSendTo(this Components component) => component switch
|
||||||
|
{
|
||||||
|
Components.NONE => false,
|
||||||
|
Components.BIAS_DAY_ASSISTANT => false,
|
||||||
|
|
||||||
|
_ => true,
|
||||||
|
};
|
||||||
|
|
||||||
public static string Name(this Components component) => component switch
|
public static string Name(this Components component) => component switch
|
||||||
{
|
{
|
||||||
Components.GRAMMAR_SPELLING_ASSISTANT => "Grammar & Spelling Assistant",
|
Components.GRAMMAR_SPELLING_ASSISTANT => "Grammar & Spelling Assistant",
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
# v0.9.16, build 191 (2024-11-xx xx:xx UTC)
|
# v0.9.16, build 191 (2024-11-xx xx:xx UTC)
|
||||||
- Added our second financial contributor: Thanks `peerschuett` for supporting AI Studio financially.
|
- Added our second financial contributor: Thanks `peerschuett` for supporting AI Studio financially.
|
||||||
- Improved the layout of the app window, for example, in full-screen mode on large or high-resolution monitors.
|
- Improved the layout of the app window, for example, in full-screen mode on large or high-resolution monitors.
|
||||||
|
- Fixed the "send to" issue, where you could select the bias-of-the-day assistant as destination.
|
Loading…
Reference in New Issue
Block a user