Fixed form validation

This commit is contained in:
Thorsten Sommer 2026-08-01 11:08:26 +02:00
parent bdb6c23324
commit 6eeb37625e
Signed by untrusted user who does not match committer: tsommer
GPG Key ID: 371BBA77A02C0108
7 changed files with 306 additions and 137 deletions

View File

@ -2299,6 +2299,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::
-- The visual briefing settings could not be saved.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T131371789"] = "The visual briefing settings could not be saved."
-- Please provide a custom target language.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T1330607941"] = "Please provide a custom target language."
-- AI Studio cannot read this visual briefing. Its files may be incompatible or damaged.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T138425430"] = "AI Studio cannot read this visual briefing. Its files may be incompatible or damaged."
@ -2338,6 +2341,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::
-- This briefing revision was already imported.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T1732858483"] = "This briefing revision was already imported."
-- Please select a provider.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T1809312323"] = "Please select a provider."
-- Cannot be opened
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T1981873292"] = "Cannot be opened"
@ -2452,6 +2458,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::
-- Export visual briefing
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T3261790455"] = "Export visual briefing"
-- The source '{0}' is no longer reachable. Restore or relink it.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T3270802829"] = "The source '{0}' is no longer reachable. Restore or relink it."
-- Could not open the visual briefing project folder.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T3290777125"] = "Could not open the visual briefing project folder."
@ -2518,6 +2527,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::
-- Actions
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T3865031940"] = "Actions"
-- The transcript for '{0}' is missing or outdated. Transcribe the media source again.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T3882911085"] = "The transcript for '{0}' is missing or outdated. Transcribe the media source again."
-- Export
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T3898821075"] = "Export"
@ -2623,6 +2635,12 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::
-- Visual briefing preview
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T740269027"] = "Visual briefing preview"
-- Please provide a custom protection level.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T799692129"] = "Please provide a custom protection level."
-- Please provide a briefing name.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T902674552"] = "Please provide a briefing name."
-- Build progress
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T909046610"] = "Build progress"

View File

@ -78,152 +78,160 @@
}
else
{
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center" Wrap="Wrap.Wrap" Class="mb-3">
<MudText Typo="Typo.h3">@this.projectName</MudText>
<MudStack Row="true" Spacing="1">
<MudButton StartIcon="@Icons.Material.Filled.DriveFileRenameOutline" OnClick="@this.RenameAsync" Disabled="@this.IsCurrentBusy">@T("Rename")</MudButton>
<MudButton StartIcon="@Icons.Material.Filled.DeleteForever" Color="Color.Error" OnClick="@this.DeleteAsync" Disabled="@this.IsCurrentBusy">@T("Delete")</MudButton>
<MudForm @ref="@(this.visualBriefingForm)"
@bind-IsValid="@(this.formIsValid)"
@bind-Errors="@(this.formIssues)">
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center" Wrap="Wrap.Wrap" Class="mb-3">
<MudText Typo="Typo.h3">@this.projectName</MudText>
<MudStack Row="true" Spacing="1">
<MudButton StartIcon="@Icons.Material.Filled.DriveFileRenameOutline" OnClick="@this.RenameAsync" Disabled="@this.IsCurrentBusy">@T("Rename")</MudButton>
<MudButton StartIcon="@Icons.Material.Filled.DeleteForever" Color="Color.Error" OnClick="@this.DeleteAsync" Disabled="@this.IsCurrentBusy">@T("Delete")</MudButton>
</MudStack>
</MudStack>
</MudStack>
<MudPaper Outlined="true" Class="pa-4 mb-4">
<MudGrid>
<MudItem xs="12" md="7">
<MudTextField T="string" @bind-Text="@this.projectName" Label="@T("Briefing name")" Required="true" Immediate="@true" Variant="Variant.Outlined" Disabled="@this.IsCurrentBusy"/>
<MudPaper Outlined="true" Class="pa-4 mb-4">
<MudGrid>
<MudItem xs="12" md="7">
<MudTextField T="string" @bind-Text="@this.projectName" Label="@T("Briefing name")" Validation="@this.ValidateProjectName" Immediate="@true" Variant="Variant.Outlined" Disabled="@this.IsCurrentBusy"/>
</MudItem>
<MudItem xs="12" md="5">
<MudTextField T="string" @bind-Text="@this.author" Label="@T("Author (optional)")" Variant="Variant.Outlined" Disabled="@this.IsCurrentBusy"/>
</MudItem>
</MudGrid>
<MudTextField T="string" @bind-Text="@this.instruction" Label="@T("Briefing scope, notes, or current change instruction (optional)")" Variant="Variant.Outlined" AutoGrow="true" Lines="3" Class="mt-3" Disabled="@this.IsCurrentBusy"/>
<EnumSelection T="VisualBriefingProtectionLevel"
NameFunc="@(level => this.ProtectionLevelName(level))"
@bind-Value="@this.protectionLevel"
Icon="@Icons.Material.Filled.Security"
Label="@T("Protection level")"
AllowOther="true"
OtherValue="VisualBriefingProtectionLevel.OTHER"
@bind-OtherInput="@this.customProtectionLevel"
ValidateOther="@this.ValidateCustomProtectionLevel"
SelectionUpdated="@(_ => this.ScheduleFormValidation())"
LabelOther="@T("Custom protection level")"
Disabled="@this.IsCurrentBusy"/>
</MudPaper>
<MudGrid Class="mb-4">
<MudItem xs="12" lg="6">
<MudPaper Outlined="true" Class="pa-4 h-100">
<MudText Typo="Typo.h5">@T("Source material")</MudText>
<MudText Typo="Typo.body2" Class="mb-2">@T("Documents, spreadsheets, images, audio, and video are considered as source context.")</MudText>
<AttachDocuments Name="Visual briefing source material"
Layer="@DropLayers.ASSISTANTS"
@bind-DocumentPaths="@this.sourceMaterial"
OnChange="@this.SourceMaterialChangedAsync"
CatchAllDocuments="true"
UseSmallForm="false"
Provider="@this.provider"
Disabled="@this.IsCurrentBusy"/>
</MudPaper>
</MudItem>
<MudItem xs="12" md="5">
<MudTextField T="string" @bind-Text="@this.author" Label="@T("Author (optional)")" Variant="Variant.Outlined" Disabled="@this.IsCurrentBusy"/>
<MudItem xs="12" lg="6">
<MudPaper Outlined="true" Class="pa-4 h-100">
<MudText Typo="Typo.h5">@T("Visual assets")</MudText>
<MudText Typo="Typo.body2" Class="mb-2">@T("PNG, JPEG, and WebP assets are analyzed and must appear visibly in the briefing.")</MudText>
<AttachDocuments Name="Visual briefing visual assets"
Layer="@DropLayers.ASSISTANTS"
@bind-DocumentPaths="@this.visualAssets"
OnChange="@this.VisualAssetsChangedAsync"
CatchAllDocuments="false"
UseSmallForm="false"
AllowedFileTypes="@(new[] { FileTypes.VISUAL_BRIEFING_IMAGE })"
Provider="@this.provider"
Disabled="@this.IsCurrentBusy"/>
</MudPaper>
</MudItem>
</MudGrid>
<MudTextField T="string" @bind-Text="@this.instruction" Label="@T("Briefing scope, notes, or current change instruction (optional)")" Variant="Variant.Outlined" AutoGrow="true" Lines="3" Class="mt-3" Disabled="@this.IsCurrentBusy"/>
<EnumSelection T="VisualBriefingProtectionLevel"
NameFunc="@(level => this.ProtectionLevelName(level))"
@bind-Value="@this.protectionLevel"
Icon="@Icons.Material.Filled.Security"
Label="@T("Protection level")"
AllowOther="true"
OtherValue="VisualBriefingProtectionLevel.OTHER"
@bind-OtherInput="@this.customProtectionLevel"
LabelOther="@T("Custom protection level")"
Disabled="@this.IsCurrentBusy"/>
</MudPaper>
<MudGrid Class="mb-4">
<MudItem xs="12" lg="6">
<MudPaper Outlined="true" Class="pa-4 h-100">
<MudText Typo="Typo.h5">@T("Source material")</MudText>
<MudText Typo="Typo.body2" Class="mb-2">@T("Documents, spreadsheets, images, audio, and video are considered as source context.")</MudText>
<AttachDocuments Name="Visual briefing source material"
Layer="@DropLayers.ASSISTANTS"
@bind-DocumentPaths="@this.sourceMaterial"
OnChange="@this.SourceMaterialChangedAsync"
CatchAllDocuments="true"
UseSmallForm="false"
Provider="@this.provider"
Disabled="@this.IsCurrentBusy"/>
</MudPaper>
</MudItem>
<MudItem xs="12" lg="6">
<MudPaper Outlined="true" Class="pa-4 h-100">
<MudText Typo="Typo.h5">@T("Visual assets")</MudText>
<MudText Typo="Typo.body2" Class="mb-2">@T("PNG, JPEG, and WebP assets are analyzed and must appear visibly in the briefing.")</MudText>
<AttachDocuments Name="Visual briefing visual assets"
Layer="@DropLayers.ASSISTANTS"
@bind-DocumentPaths="@this.visualAssets"
OnChange="@this.VisualAssetsChangedAsync"
CatchAllDocuments="false"
UseSmallForm="false"
AllowedFileTypes="@(new[] { FileTypes.VISUAL_BRIEFING_IMAGE })"
Provider="@this.provider"
Disabled="@this.IsCurrentBusy"/>
</MudPaper>
</MudItem>
</MudGrid>
@if (this.selectedBriefing.Sources.Count > 0)
{
<MudPaper Outlined="true" Class="pa-4 mb-4">
<MudStack Row="true" AlignItems="AlignItems.Center" Justify="Justify.SpaceBetween" Class="mb-2">
<MudText Typo="Typo.h5">@T("Linked sources")</MudText>
<MudButton StartIcon="@Icons.Material.Filled.Refresh" OnClick="@this.RefreshSourceStatusAsync" Disabled="@this.IsCurrentBusy">@T("Refresh status")</MudButton>
</MudStack>
<MudTable Items="@this.selectedBriefing.Sources" Dense="true" Hover="true" Breakpoint="Breakpoint.Sm">
<HeaderContent>
<MudTh>@T("File")</MudTh>
<MudTh>@T("Kind")</MudTh>
<MudTh>@T("Status")</MudTh>
<MudTh>@T("Actions")</MudTh>
</HeaderContent>
<RowTemplate>
<MudTd DataLabel="@T("File")">@Path.GetFileName(context.Path)</MudTd>
<MudTd DataLabel="@T("Kind")">@context.Kind</MudTd>
<MudTd DataLabel="@T("Status")">
<MudChip T="string" Size="Size.Small" Color="@SourceStatusColor(context.Status)">@this.SourceStatusName(context.Status)</MudChip>
</MudTd>
<MudTd DataLabel="@T("Actions")">
<MudTooltip Text="@T("Relink")" Placement="Placement.Bottom">
<MudIconButton Icon="@Icons.Material.Filled.Link" OnClick="@(() => this.RelinkAsync(context))" Disabled="@this.IsCurrentBusy"/>
</MudTooltip>
@if (context.IsMedia && context.Status is VisualBriefingSourceStatus.TRANSCRIPT_OUTDATED)
{
<MudTooltip Text="@T("Transcribe again")" Placement="Placement.Bottom">
<MudIconButton Icon="@Icons.Material.Filled.RecordVoiceOver" OnClick="@(() => this.RetranscribeAsync(context))" Disabled="@this.IsCurrentBusy"/>
@if (this.selectedBriefing.Sources.Count > 0)
{
<MudPaper Outlined="true" Class="pa-4 mb-4">
<MudStack Row="true" AlignItems="AlignItems.Center" Justify="Justify.SpaceBetween" Class="mb-2">
<MudText Typo="Typo.h5">@T("Linked sources")</MudText>
<MudButton StartIcon="@Icons.Material.Filled.Refresh" OnClick="@this.RefreshSourceStatusAsync" Disabled="@this.IsCurrentBusy">@T("Refresh status")</MudButton>
</MudStack>
<MudTable Items="@this.selectedBriefing.Sources" Dense="true" Hover="true" Breakpoint="Breakpoint.Sm">
<HeaderContent>
<MudTh>@T("File")</MudTh>
<MudTh>@T("Kind")</MudTh>
<MudTh>@T("Status")</MudTh>
<MudTh>@T("Actions")</MudTh>
</HeaderContent>
<RowTemplate>
<MudTd DataLabel="@T("File")">@Path.GetFileName(context.Path)</MudTd>
<MudTd DataLabel="@T("Kind")">@context.Kind</MudTd>
<MudTd DataLabel="@T("Status")">
<MudChip T="string" Size="Size.Small" Color="@SourceStatusColor(context.Status)">@this.SourceStatusName(context.Status)</MudChip>
</MudTd>
<MudTd DataLabel="@T("Actions")">
<MudTooltip Text="@T("Relink")" Placement="Placement.Bottom">
<MudIconButton Icon="@Icons.Material.Filled.Link" OnClick="@(() => this.RelinkAsync(context))" Disabled="@this.IsCurrentBusy"/>
</MudTooltip>
}
<MudTooltip Text="@T("Remove")" Placement="Placement.Bottom">
<MudIconButton Icon="@Icons.Material.Filled.RemoveCircle" Color="Color.Error" OnClick="@(() => this.RemoveSourceAsync(context))" Disabled="@this.IsCurrentBusy"/>
</MudTooltip>
</MudTd>
</RowTemplate>
</MudTable>
@if (context.IsMedia && context.Status is VisualBriefingSourceStatus.TRANSCRIPT_OUTDATED)
{
<MudTooltip Text="@T("Transcribe again")" Placement="Placement.Bottom">
<MudIconButton Icon="@Icons.Material.Filled.RecordVoiceOver" OnClick="@(() => this.RetranscribeAsync(context))" Disabled="@this.IsCurrentBusy"/>
</MudTooltip>
}
<MudTooltip Text="@T("Remove")" Placement="Placement.Bottom">
<MudIconButton Icon="@Icons.Material.Filled.RemoveCircle" Color="Color.Error" OnClick="@(() => this.RemoveSourceAsync(context))" Disabled="@this.IsCurrentBusy"/>
</MudTooltip>
</MudTd>
</RowTemplate>
</MudTable>
</MudPaper>
}
<MudPaper Outlined="true" Class="pa-4 mb-4">
<MudText Typo="Typo.h5" Class="mb-3">@T("Briefing settings")</MudText>
<ProviderSelection @bind-ProviderSettings="@this.provider" ValidateProvider="@this.ValidateProvider" ExplicitMinimumConfidence="@this.MinimumProviderConfidence" Disabled="@this.IsCurrentBusy"/>
<ProfileSelection @bind-CurrentProfile="@this.profile" MarginLeft="" Disabled="@this.IsCurrentBusy"/>
<EnumSelection T="CommonLanguages" NameFunc="@(language => language.Name())" @bind-Value="@this.targetLanguage" Icon="@Icons.Material.Filled.Translate" Label="@T("Target language")" AllowOther="true" @bind-OtherInput="@this.customTargetLanguage" OtherValue="CommonLanguages.OTHER" LabelOther="@T("Custom target language")" ValidateOther="@this.ValidateCustomTargetLanguage" SelectionUpdated="@(_ => this.ScheduleFormValidation())" Disabled="@this.IsCurrentBusy"/>
<EnumSelection T="AudienceProfile" NameFunc="@(value => value.Name())" @bind-Value="@this.audienceProfile" Label="@T("Audience profile")" Disabled="@this.IsCurrentBusy"/>
<EnumSelection T="AudienceAgeGroup" NameFunc="@(value => value.Name())" @bind-Value="@this.audienceAgeGroup" Label="@T("Audience age group")" Disabled="@this.IsCurrentBusy"/>
<EnumSelection T="AudienceOrganizationalLevel" NameFunc="@(value => value.Name())" @bind-Value="@this.audienceOrganizationalLevel" Label="@T("Audience organizational level")" Disabled="@this.IsCurrentBusy"/>
<EnumSelection T="AudienceExpertise" NameFunc="@(value => value.Name())" @bind-Value="@this.audienceExpertise" Label="@T("Audience expertise")" Disabled="@this.IsCurrentBusy"/>
<MudSwitch T="bool" @bind-Value="@this.showSourceReferences" Color="Color.Primary" Disabled="@this.IsCurrentBusy">@T("Show source references")</MudSwitch>
<MudSwitch T="bool" @bind-Value="@this.optimizeImages" Color="Color.Primary" Disabled="@this.IsCurrentBusy">@T("Optimize large visual assets")</MudSwitch>
</MudPaper>
}
<MudPaper Outlined="true" Class="pa-4 mb-4">
<MudText Typo="Typo.h5" Class="mb-3">@T("Briefing settings")</MudText>
<ProviderSelection @bind-ProviderSettings="@this.provider" ExplicitMinimumConfidence="@this.MinimumProviderConfidence" Disabled="@this.IsCurrentBusy"/>
<ProfileSelection @bind-CurrentProfile="@this.profile" MarginLeft="" Disabled="@this.IsCurrentBusy"/>
<EnumSelection T="CommonLanguages" NameFunc="@(language => language.Name())" @bind-Value="@this.targetLanguage" Icon="@Icons.Material.Filled.Translate" Label="@T("Target language")" AllowOther="true" @bind-OtherInput="@this.customTargetLanguage" OtherValue="CommonLanguages.OTHER" LabelOther="@T("Custom target language")" Disabled="@this.IsCurrentBusy"/>
<EnumSelection T="AudienceProfile" NameFunc="@(value => value.Name())" @bind-Value="@this.audienceProfile" Label="@T("Audience profile")" Disabled="@this.IsCurrentBusy"/>
<EnumSelection T="AudienceAgeGroup" NameFunc="@(value => value.Name())" @bind-Value="@this.audienceAgeGroup" Label="@T("Audience age group")" Disabled="@this.IsCurrentBusy"/>
<EnumSelection T="AudienceOrganizationalLevel" NameFunc="@(value => value.Name())" @bind-Value="@this.audienceOrganizationalLevel" Label="@T("Audience organizational level")" Disabled="@this.IsCurrentBusy"/>
<EnumSelection T="AudienceExpertise" NameFunc="@(value => value.Name())" @bind-Value="@this.audienceExpertise" Label="@T("Audience expertise")" Disabled="@this.IsCurrentBusy"/>
<MudSwitch T="bool" @bind-Value="@this.showSourceReferences" Color="Color.Primary" Disabled="@this.IsCurrentBusy">@T("Show source references")</MudSwitch>
<MudSwitch T="bool" @bind-Value="@this.optimizeImages" Color="Color.Primary" Disabled="@this.IsCurrentBusy">@T("Optimize large visual assets")</MudSwitch>
</MudPaper>
<MudStack Row="true" Spacing="2" Wrap="Wrap.Wrap" Class="mb-4">
@if (this.selectedBriefing.Versions.Count == 0)
{
<MudButton Variant="Variant.Filled" Color="Color.Primary" StartIcon="@Icons.Material.Filled.AutoAwesome" OnClick="@(() => this.GenerateAsync(VisualBriefingEditMode.INITIAL))" Disabled="@this.CannotGenerate(VisualBriefingEditMode.INITIAL)">@T("Create briefing")</MudButton>
}
else
{
<MudTooltip Text="@T("Creates a new version with a different design while keeping the current structure, content, and visual assets.")">
<span>
<MudButton Variant="Variant.Filled" StartIcon="@Icons.Material.Filled.Palette" OnClick="@(() => this.GenerateAsync(VisualBriefingEditMode.CHANGE_DESIGN))" Disabled="@this.CannotGenerate(VisualBriefingEditMode.CHANGE_DESIGN)">@T("Change design")</MudButton>
</span>
</MudTooltip>
<MudTooltip Text="@T("Creates a new version from the current sources and instructions while keeping the current structure and design.")">
<span>
<MudButton Variant="Variant.Filled" StartIcon="@Icons.Material.Filled.Update" OnClick="@(() => this.GenerateAsync(VisualBriefingEditMode.UPDATE_CONTENT))" Disabled="@this.CannotGenerate(VisualBriefingEditMode.UPDATE_CONTENT)">@T("Update content")</MudButton>
</span>
</MudTooltip>
<MudTooltip Text="@(this.SelectedVersionSupportsEdits
? T("Recompile this version with the current AI Studio version without AI model calls.")
: T("This version has no compatible semantic artifacts. Rebuild the briefing instead."))">
<span>
<MudButton Variant="Variant.Filled" StartIcon="@Icons.Material.Filled.Code" OnClick="@(() => this.RecompileAsync())" Disabled="@this.CannotRecompile">@T("Recompile briefing")</MudButton>
</span>
</MudTooltip>
<MudTooltip Text="@T("Creates a new version from the current sources and instructions. The structure, content, and design may all change.")">
<span>
<MudButton Variant="Variant.Filled" Color="Color.Primary" StartIcon="@Icons.Material.Filled.AutoAwesome" OnClick="@(() => this.GenerateAsync(VisualBriefingEditMode.REBUILD))" Disabled="@this.CannotGenerate(VisualBriefingEditMode.REBUILD)">@T("Rebuild briefing")</MudButton>
</span>
</MudTooltip>
}
</MudStack>
</MudForm>
<MudStack Row="true" Spacing="2" Wrap="Wrap.Wrap" Class="mb-4">
@if (this.selectedBriefing.Versions.Count == 0)
{
<MudButton Variant="Variant.Filled" Color="Color.Primary" StartIcon="@Icons.Material.Filled.AutoAwesome" OnClick="@(() => this.GenerateAsync(VisualBriefingEditMode.INITIAL))" Disabled="@this.CannotGenerate(VisualBriefingEditMode.INITIAL)">@T("Create briefing")</MudButton>
}
else
{
<MudTooltip Text="@T("Creates a new version with a different design while keeping the current structure, content, and visual assets.")">
<span>
<MudButton Variant="Variant.Filled" StartIcon="@Icons.Material.Filled.Palette" OnClick="@(() => this.GenerateAsync(VisualBriefingEditMode.CHANGE_DESIGN))" Disabled="@this.CannotGenerate(VisualBriefingEditMode.CHANGE_DESIGN)">@T("Change design")</MudButton>
</span>
</MudTooltip>
<MudTooltip Text="@T("Creates a new version from the current sources and instructions while keeping the current structure and design.")">
<span>
<MudButton Variant="Variant.Filled" StartIcon="@Icons.Material.Filled.Update" OnClick="@(() => this.GenerateAsync(VisualBriefingEditMode.UPDATE_CONTENT))" Disabled="@this.CannotGenerate(VisualBriefingEditMode.UPDATE_CONTENT)">@T("Update content")</MudButton>
</span>
</MudTooltip>
<MudTooltip Text="@(this.SelectedVersionSupportsEdits
? T("Recompile this version with the current AI Studio version without AI model calls.")
: T("This version has no compatible semantic artifacts. Rebuild the briefing instead."))">
<span>
<MudButton Variant="Variant.Filled" StartIcon="@Icons.Material.Filled.Code" OnClick="@(() => this.RecompileAsync())" Disabled="@this.CannotRecompile">@T("Recompile briefing")</MudButton>
</span>
</MudTooltip>
<MudTooltip Text="@T("Creates a new version from the current sources and instructions. The structure, content, and design may all change.")">
<span>
<MudButton Variant="Variant.Filled" Color="Color.Primary" StartIcon="@Icons.Material.Filled.AutoAwesome" OnClick="@(() => this.GenerateAsync(VisualBriefingEditMode.REBUILD))" Disabled="@this.CannotGenerate(VisualBriefingEditMode.REBUILD)">@T("Rebuild briefing")</MudButton>
</span>
</MudTooltip>
}
</MudStack>
<Issues IssuesData="@this.ValidationIssues"/>
@if (this.latestBuild is not null)
{
@ -294,7 +302,7 @@
Color="Color.Warning"
StartIcon="@Icons.Material.Filled.Refresh"
OnClick="@(() => this.GenerateAsync(VisualBriefingEditMode.REBUILD, reusableBuildId))"
Disabled="@this.IsCurrentBusy">
Disabled="@this.CannotGenerate(VisualBriefingEditMode.REBUILD)">
@T("Continue as rebuild")
</MudButton>
</MudStack>

View File

@ -295,6 +295,9 @@ public partial class VisualBriefingAssistant
}
this.lastPersistedState = this.BuildPersistenceFingerprint();
this.formIssues = [];
this.formIsValid = false;
this.formValidationPending = true;
}
/// <summary>
@ -328,6 +331,10 @@ public partial class VisualBriefingAssistant
this.lastBuildDiagnostics = null;
this.reusableContentBuildId = null;
this.lastPersistedState = string.Empty;
this.formIssues = [];
this.formIsValid = false;
this.formValidationPending = false;
this.visualBriefingForm?.ResetValidation();
}
/// <summary>

View File

@ -0,0 +1,82 @@
using AIStudio.Provider;
using ProviderSettings = AIStudio.Settings.Provider;
namespace AIStudio.Assistants.VisualBriefing;
public partial class VisualBriefingAssistant
{
/// <summary>Gets all current field, source, and revision issues shown below the actions.</summary>
private IReadOnlyList<string> ValidationIssues
{
get
{
List<string> issues = [.. this.formIssues];
AddIssue(issues, this.ValidateProjectName(this.projectName));
AddIssue(issues, this.ValidateProvider(this.provider));
AddIssue(issues, this.ValidateCustomTargetLanguage(this.customTargetLanguage));
AddIssue(issues, this.ValidateCustomProtectionLevel(this.customProtectionLevel));
if (this.selectedBriefing is not null)
{
foreach (var source in this.selectedBriefing.Sources)
{
var fileName = Path.GetFileName(source.Path);
switch (source.Status)
{
case VisualBriefingSourceStatus.UNREACHABLE:
issues.Add(string.Format(T("The source '{0}' is no longer reachable. Restore or relink it."), fileName));
break;
case VisualBriefingSourceStatus.TRANSCRIPT_OUTDATED:
issues.Add(string.Format(T("The transcript for '{0}' is missing or outdated. Transcribe the media source again."), fileName));
break;
}
}
if (this.selectedBriefing.Versions.Count > 0 && !this.SelectedVersionSupportsEdits)
issues.Add(T("This version has no compatible semantic artifacts. Rebuild the briefing instead."));
}
return [.. issues.Where(issue => !string.IsNullOrWhiteSpace(issue)).Distinct(StringComparer.Ordinal)];
}
}
/// <summary>Validates the briefing name.</summary>
private string? ValidateProjectName(string name) => string.IsNullOrWhiteSpace(name) ? T("Please provide a briefing name.") : null;
/// <summary>Validates the selected generation provider.</summary>
private string? ValidateProvider(ProviderSettings value) =>
value == ProviderSettings.NONE || value.UsedLLMProvider is LLMProviders.NONE
? T("Please select a provider.")
: null;
/// <summary>Validates the free-form target language when Other is selected.</summary>
private string? ValidateCustomTargetLanguage(string language) =>
this.targetLanguage is CommonLanguages.OTHER && string.IsNullOrWhiteSpace(language)
? T("Please provide a custom target language.")
: null;
/// <summary>Validates the free-form protection level when Other is selected.</summary>
private string? ValidateCustomProtectionLevel(string level) =>
this.protectionLevel is VisualBriefingProtectionLevel.OTHER && string.IsNullOrWhiteSpace(level)
? T("Please provide a custom protection level.")
: null;
/// <summary>Revalidates after a conditional Other field has been added or removed.</summary>
private Task ScheduleFormValidation()
{
this.formValidationPending = true;
this.StateHasChanged();
return Task.CompletedTask;
}
/// <summary>Adds one optional validation message.</summary>
private static void AddIssue(ICollection<string> issues, string? issue)
{
if (!string.IsNullOrWhiteSpace(issue))
issues.Add(issue);
}
}

View File

@ -178,6 +178,18 @@ public partial class VisualBriefingAssistant : MSGComponentBase
/// <summary>Stores incompatible validated content offered for rebuild continuation.</summary>
private Guid? reusableContentBuildId;
/// <summary>Owns MudBlazor validation for the selected briefing editor.</summary>
private MudForm? visualBriefingForm;
/// <summary>Stores whether all MudBlazor fields in the editor are currently valid.</summary>
private bool formIsValid;
/// <summary>Stores the current MudBlazor validation messages.</summary>
private string[] formIssues = [];
/// <summary>Requests validation after conditional form controls have rendered.</summary>
private bool formValidationPending;
/// <summary>
/// Defines <c>IsCurrentBusy</c> for the visual briefing feature.
/// </summary>
@ -240,6 +252,12 @@ public partial class VisualBriefingAssistant : MSGComponentBase
protected override async Task OnAfterRenderAsync(bool firstRender)
{
await base.OnAfterRenderAsync(firstRender);
if (this.formValidationPending && this.visualBriefingForm is not null)
{
this.formValidationPending = false;
await this.visualBriefingForm.Validate();
}
if (this.selectedBriefing is null || this.IsCurrentBusy)
return;

View File

@ -2301,6 +2301,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::
-- The visual briefing settings could not be saved.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T131371789"] = "Die Einstellungen für das visuelle Briefing konnten nicht gespeichert werden."
-- Please provide a custom target language.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T1330607941"] = "Bitte geben Sie eine benutzerdefinierte Zielsprache an."
-- AI Studio cannot read this visual briefing. Its files may be incompatible or damaged.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T138425430"] = "AI Studio kann dieses visuelle Briefing nicht lesen. Die Dateien sind möglicherweise inkompatibel oder beschädigt."
@ -2340,6 +2343,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::
-- This briefing revision was already imported.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T1732858483"] = "Diese Briefing-Revision wurde bereits importiert."
-- Please select a provider.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T1809312323"] = "Bitte wählen Sie einen Anbieter aus."
-- Cannot be opened
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T1981873292"] = "Kann nicht geöffnet werden"
@ -2454,6 +2460,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::
-- Export visual briefing
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T3261790455"] = "Visuelles Briefing exportieren"
-- The source '{0}' is no longer reachable. Restore or relink it.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T3270802829"] = "Die Quelle „{0}“ ist nicht mehr erreichbar. Stelle sie wieder her oder verknüpfe sie erneut."
-- Could not open the visual briefing project folder.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T3290777125"] = "Der Projektordner für das visuelle Briefing konnte nicht geöffnet werden."
@ -2520,6 +2529,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::
-- Actions
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T3865031940"] = "Aktionen"
-- The transcript for '{0}' is missing or outdated. Transcribe the media source again.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T3882911085"] = "Das Transkript für „{0}“ fehlt oder ist nicht mehr aktuell. Transkribieren Sie die Medienquelle erneut."
-- Export
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T3898821075"] = "Exportieren"
@ -2625,6 +2637,12 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::
-- Visual briefing preview
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T740269027"] = "Vorschau des visuellen Briefings"
-- Please provide a custom protection level.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T799692129"] = "Bitte geben Sie eine benutzerdefinierte Schutzstufe an."
-- Please provide a briefing name.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T902674552"] = "Bitte geben Sie einen Namen für das Briefing ein."
-- Build progress
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T909046610"] = "Erstellungsfortschritt"

View File

@ -2301,6 +2301,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::
-- The visual briefing settings could not be saved.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T131371789"] = "The visual briefing settings could not be saved."
-- Please provide a custom target language.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T1330607941"] = "Please provide a custom target language."
-- AI Studio cannot read this visual briefing. Its files may be incompatible or damaged.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T138425430"] = "AI Studio cannot read this visual briefing. Its files may be incompatible or damaged."
@ -2340,6 +2343,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::
-- This briefing revision was already imported.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T1732858483"] = "This briefing revision was already imported."
-- Please select a provider.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T1809312323"] = "Please select a provider."
-- Cannot be opened
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T1981873292"] = "Cannot be opened"
@ -2454,6 +2460,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::
-- Export visual briefing
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T3261790455"] = "Export visual briefing"
-- The source '{0}' is no longer reachable. Restore or relink it.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T3270802829"] = "The source '{0}' is no longer reachable. Restore or relink it."
-- Could not open the visual briefing project folder.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T3290777125"] = "Could not open the visual briefing project folder."
@ -2520,6 +2529,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::
-- Actions
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T3865031940"] = "Actions"
-- The transcript for '{0}' is missing or outdated. Transcribe the media source again.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T3882911085"] = "The transcript for '{0}' is missing or outdated. Transcribe the media source again."
-- Export
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T3898821075"] = "Export"
@ -2625,6 +2637,12 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::
-- Visual briefing preview
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T740269027"] = "Visual briefing preview"
-- Please provide a custom protection level.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T799692129"] = "Please provide a custom protection level."
-- Please provide a briefing name.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T902674552"] = "Please provide a briefing name."
-- Build progress
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::VISUALBRIEFING::VISUALBRIEFINGASSISTANT::T909046610"] = "Build progress"