From 7137e582494b20911761eba322efe98aa25ffa61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peer=20Sch=C3=BCtt?= <20603780+peerschuett@users.noreply.github.com> Date: Mon, 10 Mar 2025 13:29:55 +0100 Subject: [PATCH] Switching to settings works now. Scrolling doesnt --- .../Components/Settings/SettingsPanelBase.cs | 8 +- app/MindWork AI Studio/Pages/Settings.razor | 82 ++++++++++--------- .../Pages/Settings.razor.cs | 4 +- 3 files changed, 48 insertions(+), 46 deletions(-) diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelBase.cs b/app/MindWork AI Studio/Components/Settings/SettingsPanelBase.cs index 391d97e7..117bd554 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelBase.cs +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelBase.cs @@ -8,11 +8,11 @@ namespace AIStudio.Components.Settings; public abstract class SettingsPanelBase : ComponentBase { - [Parameter] - public Func>> AvailableLLMProvidersFunc { get; set; } = () => []; + [CascadingParameter] + public Pages.Settings Settings { get; set; } = null!; [Parameter] - public SettingsPanel ChosenPanel { get; set; } + public Func>> AvailableLLMProvidersFunc { get; set; } = () => []; protected abstract SettingsPanel Type { get; } @@ -28,5 +28,5 @@ public abstract class SettingsPanelBase : ComponentBase [Inject] protected RustService RustService { get; init; } = null!; - protected bool IsExtended() => this.Type == this.ChosenPanel; + protected bool IsExtended() => this.Type == this.Settings.ChosenSettingsPanel; } \ No newline at end of file diff --git a/app/MindWork AI Studio/Pages/Settings.razor b/app/MindWork AI Studio/Pages/Settings.razor index 0fe9b176..91d9d0fc 100644 --- a/app/MindWork AI Studio/Pages/Settings.razor +++ b/app/MindWork AI Studio/Pages/Settings.razor @@ -6,45 +6,47 @@ Settings - - - - @if (PreviewFeatures.PRE_RAG_2024.IsEnabled(this.SettingsManager)) - { - - - } - - - - - - - - - @if (PreviewFeatures.PRE_RAG_2024.IsEnabled(this.SettingsManager)) - { - - } - - - - - - - - - - - - - @if (PreviewFeatures.PRE_RAG_2024.IsEnabled(this.SettingsManager)) - { - - - } - - - + + + + + @if (PreviewFeatures.PRE_RAG_2024.IsEnabled(this.SettingsManager)) + { + + + } + + + + + + + + + @if (PreviewFeatures.PRE_RAG_2024.IsEnabled(this.SettingsManager)) + { + + } + + + + + + + + + + + + + @if (PreviewFeatures.PRE_RAG_2024.IsEnabled(this.SettingsManager)) + { + + + } + + + + \ No newline at end of file diff --git a/app/MindWork AI Studio/Pages/Settings.razor.cs b/app/MindWork AI Studio/Pages/Settings.razor.cs index a2e2c180..45bc4d2c 100644 --- a/app/MindWork AI Studio/Pages/Settings.razor.cs +++ b/app/MindWork AI Studio/Pages/Settings.razor.cs @@ -16,7 +16,7 @@ public partial class Settings : ComponentBase, IMessageBusReceiver, IDisposable private List> availableLLMProviders = new(); private List> availableEmbeddingProviders = new(); private List> availableDataSources = new(); - private SettingsPanel chosenSettingsPanel { get; set; } + public SettingsPanel ChosenSettingsPanel { get; private set; } #region Overrides of ComponentBase @@ -26,7 +26,7 @@ public partial class Settings : ComponentBase, IMessageBusReceiver, IDisposable this.MessageBus.RegisterComponent(this); this.MessageBus.ApplyFilters(this, [], [ Event.CONFIGURATION_CHANGED ]); - this.chosenSettingsPanel = MessageBus.INSTANCE.CheckDeferredMessages(Event.SWITCH_TO_SETTINGS_PANEL).FirstOrDefault(); + this.ChosenSettingsPanel = MessageBus.INSTANCE.CheckDeferredMessages(Event.SWITCH_TO_SETTINGS_PANEL).FirstOrDefault(); // var deferredContent = MessageBus.INSTANCE.CheckDeferredMessages(Event.SWITCH_TO_SETTINGS_PANEL).FirstOrDefault(); //if (deferredContent != default) //{