improved visual representation of SelectFile component with errors

This commit is contained in:
PaulKoudelka 2026-04-24 11:48:42 +02:00
parent aa554d4a53
commit 54ef68466a
2 changed files with 26 additions and 8 deletions

View File

@ -1,6 +1,19 @@
@inherits MSGComponentBase
@inherits MSGComponentBase
<MudStack Row="@true" Spacing="3" Class="mb-3" StretchItems="StretchItems.None" AlignItems="AlignItems.Center">
<style>
.select-file-button-wrapper {
height: 56px;
min-height: 56px;
max-height: 56px;
display: flex;
align-items: center;
align-self: flex-start;
flex-shrink: 0;
margin-top: 8px;
}
</style>
<MudStack Row="@true" Spacing="3" Class="mb-3" StretchItems="StretchItems.None" AlignItems="AlignItems.Start">
<MudTextField
T="string"
Text="@this.File"
@ -11,13 +24,19 @@
AdornmentIcon="@Icons.Material.Filled.AttachFile"
UserAttributes="@SPELLCHECK_ATTRIBUTES"
Variant="Variant.Outlined"
Clearable="this.IsClearable"
Clearable="@this.IsClearable"
Error="@this.Error"
ErrorText="@this.ErrorText"
OnClearButtonClick="@this.OnClear"
/>
<MudButton StartIcon="@Icons.Material.Filled.FolderOpen" Variant="Variant.Outlined" Color="Color.Primary" Disabled="this.Disabled" OnClick="@this.OpenFileDialog">
@T("Choose File")
</MudButton>
</MudStack>
<div class="select-file-button-wrapper">
<MudButton StartIcon="@Icons.Material.Filled.FolderOpen"
Variant="Variant.Outlined"
Color="Color.Primary"
Disabled="@this.Disabled"
OnClick="@this.OpenFileDialog">
@T("Choose File")
</MudButton>
</div>
</MudStack>

View File

@ -9,7 +9,6 @@ use serde::Deserialize;
use tauri::PathResolver;
use tokenizers::Error;
use tokenizers::tokenizer::{Tokenizer, Error as TokenizerError};
use tokio::fs::try_exists;
use crate::api_token::APIToken;
use crate::environment::DATA_DIRECTORY;