made datasource selection more user friendly

This commit is contained in:
PaulKoudelka committed 2026-08-13 15:51:28 +02:00
1 parent 647c428ebf
commit 786b106096
6 files changed
+156 -42

No files matched your search

@@ -1,4 +1,5 @@
@using AIStudio.Settings
@using AIStudio.Provider
@inherits MSGComponentBase
@if (this.SelectionMode is DataSourceSelectionMode.SELECTION_MODE)
{
@@ -92,7 +93,18 @@
@foreach (var source in this.availableDataSources)
{
<MudListItem Value="@source">
@source.Name
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="1" Style="min-width: 0; width: 100%;">
<MudText Typo="Typo.body1" Style="min-width: 0; white-space: normal; overflow-wrap: anywhere;">
@source.Name
</MudText>
@if (source is IInternalDataSource)
{
<MudSpacer/>
<MudTooltip Text="@source.ComplianceLevel.GetName()">
<MudIcon Icon="@Icons.Material.Filled.Security" Class="confidence-icon" Style="@this.GetConfidenceIconStyle(source)"/>
</MudTooltip>
}
</MudStack>
</MudListItem>
}
</MudList>
@@ -106,7 +118,18 @@
@foreach (var source in this.availableDataSources)
{
<MudListItem Value="@source">
@source.Name
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="1" Style="min-width: 0; width: 100%;">
<MudText Typo="Typo.body1" Style="min-width: 0; white-space: normal; overflow-wrap: anywhere;">
@source.Name
</MudText>
@if (source is IInternalDataSource)
{
<MudSpacer/>
<MudTooltip Text="@source.ComplianceLevel.GetName()">
<MudIcon Icon="@Icons.Material.Filled.Security" Class="confidence-icon" Style="@this.GetConfidenceIconStyle(source)"/>
</MudTooltip>
}
</MudStack>
</MudListItem>
}
</MudList>
@@ -117,9 +140,18 @@
{
<MudListItem Value="@source">
<ChildContent>
<MudText Typo="Typo.body1">
@source.DataSource.Name
</MudText>
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="1" Style="min-width: 0; width: 100%;">
<MudText Typo="Typo.body1" Style="min-width: 0; white-space: normal; overflow-wrap: anywhere;">
@source.DataSource.Name
</MudText>
@if (source.DataSource is IInternalDataSource)
{
<MudSpacer/>
<MudTooltip Text="@source.DataSource.ComplianceLevel.GetName()">
<MudIcon Icon="@Icons.Material.Filled.Security" Class="confidence-icon" Style="@this.GetConfidenceIconStyle(source.DataSource)"/>
</MudTooltip>
}
</MudStack>
<MudProgressLinear Color="Color.Info" Min="0" Max="1" Value="@source.AIDecision.Confidence"/>
<MudJustifiedText Typo="Typo.body2">
@@ -170,7 +202,18 @@ else if (this.SelectionMode is DataSourceSelectionMode.CONFIGURATION_MODE)
@foreach (var source in this.availableDataSources)
{
<MudListItem Value="@source">
@source.Name
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="1" Style="min-width: 0; width: 100%;">
<MudText Typo="Typo.body1" Style="min-width: 0; white-space: normal; overflow-wrap: anywhere;">
@source.Name
</MudText>
@if (source is IInternalDataSource)
{
<MudSpacer/>
<MudTooltip Text="@source.ComplianceLevel.GetName()">
<MudIcon Icon="@Icons.Material.Filled.Security" Class="confidence-icon" Style="@this.GetConfidenceIconStyle(source)"/>
</MudTooltip>
}
</MudStack>
</MudListItem>
}
</MudList>
@@ -1,4 +1,5 @@
using AIStudio.Dialogs.Settings;
using AIStudio.Provider;
using AIStudio.Settings;
using AIStudio.Settings.DataModel;
using AIStudio.Tools.Services;
@@ -141,6 +142,8 @@ public partial class DataSourceSelection : MSGComponentBase
private IReadOnlyCollection<DataSourceAgentSelected> GetSelectedDataSourcesWithAI() => this.DataSourcesAISelected.Where(n => n.Selected).ToList();
private string GetAIReasoning(DataSourceAgentSelected source) => $"AI reasoning (confidence {source.AIDecision.Confidence:P0}): {source.AIDecision.Reason}";
private string GetConfidenceIconStyle(IDataSource source) => $"{source.ComplianceLevel.SetColorStyle(this.SettingsManager)} flex-shrink: 0;";
public void ChangeOptionWithoutSaving(DataSourceOptions options, IReadOnlyList<DataSourceAgentSelected>? aiSelectedDataSources = null)
{
@@ -308,4 +311,4 @@ public partial class DataSourceSelection : MSGComponentBase
}
#endregion
}
}