fix(uploader): visible password error, no sign-in from the settings panel, installer screenshots in CI
- A refused password draws the Error border over the password box, so it stays visible while the box has focus (the shared template paints its focus border over the box's own). - Enter in the settings panel no longer triggers the sign-in form's default button underneath. - Queue rows the list has not realized are named by their file name; the retry arrow is not mirrored. - CI's Screenshots step also runs Titano.Setup.exe --capture. - Smoke test: the password box shows no error before use; Sign in is the default only outside the panel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
4 files changed
+45
-18
No files matched your search
@@ -98,7 +98,8 @@ jobs:
|
|||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
run: |
|
run: |
|
||||||
set +e
|
set +e
|
||||||
for exe in src/Titano.App/bin/Release/net10.0-windows/Titano.exe src/Titano.Uploader/bin/Release/net10.0-windows/Titano.Uploader.exe; do
|
for exe in src/Titano.App/bin/Release/net10.0-windows/Titano.exe src/Titano.Uploader/bin/Release/net10.0-windows/Titano.Uploader.exe \
|
||||||
|
src/Titano.Setup/bin/Release/net10.0-windows/Titano.Setup.exe; do
|
||||||
name=$(basename "$exe" .exe)
|
name=$(basename "$exe" .exe)
|
||||||
before=$(ls out/screenshots/*.png 2>/dev/null | wc -l)
|
before=$(ls out/screenshots/*.png 2>/dev/null | wc -l)
|
||||||
"$exe" --capture out/screenshots 2> "out/capture-$name.log" &
|
"$exe" --capture out/screenshots 2> "out/capture-$name.log" &
|
||||||
|
|||||||
@@ -188,20 +188,15 @@
|
|||||||
ToolTip="{l:Loc Tooltips.Uploader.User}" AutomationProperties.Name="{l:Loc Uploader.Connect.User}" />
|
ToolTip="{l:Loc Tooltips.Uploader.User}" AutomationProperties.Name="{l:Loc Uploader.Connect.User}" />
|
||||||
|
|
||||||
<TextBlock Grid.Row="3" Text="{l:Loc Uploader.Connect.Password}" Style="{StaticResource Text.Label}" Margin="0,12,12,0" />
|
<TextBlock Grid.Row="3" Text="{l:Loc Uploader.Connect.Password}" Style="{StaticResource Text.Label}" Margin="0,12,12,0" />
|
||||||
<!-- The password box has no binding to validate: a wrong password colours its border from the view model. -->
|
|
||||||
<PasswordBox x:Name="Password" Grid.Row="3" Grid.Column="1" Margin="0,12,0,0" PasswordChanged="OnPasswordChanged"
|
<PasswordBox x:Name="Password" Grid.Row="3" Grid.Column="1" Margin="0,12,0,0" PasswordChanged="OnPasswordChanged"
|
||||||
ToolTip="{Binding PasswordToolTip}" AutomationProperties.Name="{l:Loc Uploader.Connect.Password}">
|
ToolTip="{Binding PasswordToolTip}" AutomationProperties.Name="{l:Loc Uploader.Connect.Password}" />
|
||||||
<PasswordBox.Style>
|
<!--
|
||||||
<Style TargetType="PasswordBox" BasedOn="{StaticResource {x:Type PasswordBox}}">
|
A wrong password: the Error border (DESIGN §4), drawn over the box because the password box has no binding
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource Brush.Error}" />
|
to validate and its template paints the focus border over its own; the message is the tooltip.
|
||||||
<Style.Triggers>
|
-->
|
||||||
<DataTrigger Binding="{Binding PasswordError}" Value="{x:Null}">
|
<Border x:Name="PasswordErrorRing" Grid.Row="3" Grid.Column="1" Margin="0,12,0,0" BorderBrush="{DynamicResource Brush.Error}" BorderThickness="1"
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource Brush.Stroke}" />
|
CornerRadius="{StaticResource Radius.Control}" SnapsToDevicePixels="True" IsHitTestVisible="False"
|
||||||
</DataTrigger>
|
Visibility="{Binding PasswordError, Converter={x:Static ui:NullToCollapsedConverter.Instance}}" />
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
|
||||||
</PasswordBox.Style>
|
|
||||||
</PasswordBox>
|
|
||||||
|
|
||||||
<Border Grid.Row="4" Grid.Column="1" Margin="0,12,0,0" Padding="10,6,6,6" CornerRadius="{StaticResource Radius.Control}" Background="{DynamicResource Brush.ErrorSubtle}"
|
<Border Grid.Row="4" Grid.Column="1" Margin="0,12,0,0" Padding="10,6,6,6" CornerRadius="{StaticResource Radius.Control}" Background="{DynamicResource Brush.ErrorSubtle}"
|
||||||
Visibility="{Binding ErrorText, Converter={x:Static ui:NullToCollapsedConverter.Instance}}">
|
Visibility="{Binding ErrorText, Converter={x:Static ui:NullToCollapsedConverter.Instance}}">
|
||||||
@@ -213,9 +208,23 @@
|
|||||||
</DockPanel>
|
</DockPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<Button Grid.Row="5" Grid.Column="1" Margin="0,20,0,0" HorizontalAlignment="Left" Style="{StaticResource Button.Primary}" MinWidth="120"
|
<!-- Enter signs in while the form is on screen, but not from the settings panel drawn over it. -->
|
||||||
IsDefault="{Binding IsVisible, RelativeSource={RelativeSource Self}}"
|
<Button Grid.Row="5" Grid.Column="1" Margin="0,20,0,0" HorizontalAlignment="Left" MinWidth="120"
|
||||||
Content="{l:Loc Uploader.Connect.SignIn}" Command="{Binding SignInCommand}" ToolTip="{l:Loc Tooltips.Uploader.SignIn}" />
|
Content="{l:Loc Uploader.Connect.SignIn}" Command="{Binding SignInCommand}" ToolTip="{l:Loc Tooltips.Uploader.SignIn}">
|
||||||
|
<Button.Style>
|
||||||
|
<Style TargetType="Button" BasedOn="{StaticResource Button.Primary}">
|
||||||
|
<Setter Property="IsDefault" Value="True" />
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsVisible" Value="False">
|
||||||
|
<Setter Property="IsDefault" Value="False" />
|
||||||
|
</Trigger>
|
||||||
|
<DataTrigger Binding="{Binding DataContext.IsSettingsOpen, RelativeSource={RelativeSource AncestorType=Window}}" Value="True">
|
||||||
|
<Setter Property="IsDefault" Value="False" />
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</Button.Style>
|
||||||
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -413,8 +422,12 @@
|
|||||||
</MultiBinding>
|
</MultiBinding>
|
||||||
</ui:StatusGlyph.ToolTip>
|
</ui:StatusGlyph.ToolTip>
|
||||||
</ui:StatusGlyph>
|
</ui:StatusGlyph>
|
||||||
<!-- Mouse shortcut; keyboard users press Enter on the row, so the button is not a tab stop of its own. -->
|
<!--
|
||||||
|
Mouse shortcut; keyboard users press Enter on the row, so the button is not a tab stop of its own.
|
||||||
|
The retry arrow turns clockwise, like a clock, in every language: it is not mirrored.
|
||||||
|
-->
|
||||||
<Button Grid.Column="3" Style="{StaticResource Button.IconSubtle}" Width="26" Height="26" MinWidth="26" Margin="4,0,0,0" IsTabStop="False"
|
<Button Grid.Column="3" Style="{StaticResource Button.IconSubtle}" Width="26" Height="26" MinWidth="26" Margin="4,0,0,0" IsTabStop="False"
|
||||||
|
FlowDirection="LeftToRight"
|
||||||
ui:ButtonIcon.Glyph="{StaticResource Icon.Retry}" CommandParameter="{Binding}"
|
ui:ButtonIcon.Glyph="{StaticResource Icon.Retry}" CommandParameter="{Binding}"
|
||||||
Command="{Binding DataContext.RetryItemCommand, RelativeSource={RelativeSource AncestorType=ListBox}}"
|
Command="{Binding DataContext.RetryItemCommand, RelativeSource={RelativeSource AncestorType=ListBox}}"
|
||||||
Visibility="{Binding State, Converter={x:Static s:FailedToVisibleConverter.Instance}}"
|
Visibility="{Binding State, Converter={x:Static s:FailedToVisibleConverter.Instance}}"
|
||||||
|
|||||||
@@ -130,6 +130,9 @@ public sealed class UploadItem : INotifyPropertyChanged
|
|||||||
|
|
||||||
public event PropertyChangedEventHandler? PropertyChanged;
|
public event PropertyChangedEventHandler? PropertyChanged;
|
||||||
|
|
||||||
|
/// <summary>The file name: what UI Automation reads for a queue row the list has not realized (virtualized).</summary>
|
||||||
|
public override string ToString() => FileName;
|
||||||
|
|
||||||
private void Set<T>(ref T field, T value, [CallerMemberName] string? name = null)
|
private void Set<T>(ref T field, T value, [CallerMemberName] string? name = null)
|
||||||
{
|
{
|
||||||
if (EqualityComparer<T>.Default.Equals(field, value)) return;
|
if (EqualityComparer<T>.Default.Equals(field, value)) return;
|
||||||
|
|||||||
@@ -42,8 +42,18 @@ public sealed class UploaderScreenSmokeTests
|
|||||||
Assert.Null(vm.Connect.ErrorText);
|
Assert.Null(vm.Connect.ErrorText);
|
||||||
foreach (var box in screen.Visible<TextBox>())
|
foreach (var box in screen.Visible<TextBox>())
|
||||||
Assert.False(Validation.GetHasError(box), $"{AutomationProperties.GetName(box)} shows an error before use");
|
Assert.False(Validation.GetHasError(box), $"{AutomationProperties.GetName(box)} shows an error before use");
|
||||||
|
Assert.False(screen.Named<Border>("PasswordErrorRing").IsVisible, "the password box shows no error before use");
|
||||||
screen.AssertIconButtonsNamed("connect");
|
screen.AssertIconButtonsNamed("connect");
|
||||||
|
|
||||||
|
// Enter signs in from the form, not from the settings panel drawn over it.
|
||||||
|
var signIn = screen.Visible<Button>().Single(b => Equals(b.Content, Loc.L("Uploader.Connect.SignIn")));
|
||||||
|
Assert.True(signIn.IsDefault, "Enter signs in");
|
||||||
|
vm.IsSettingsOpen = true;
|
||||||
|
await screen.SettleAsync();
|
||||||
|
Assert.False(signIn.IsDefault, "Enter in the settings panel does not sign in");
|
||||||
|
vm.IsSettingsOpen = false;
|
||||||
|
await screen.SettleAsync();
|
||||||
|
|
||||||
screen.Sample.ShowQueue();
|
screen.Sample.ShowQueue();
|
||||||
await screen.SettleAsync();
|
await screen.SettleAsync();
|
||||||
screen.AssertIconButtonsNamed("queue");
|
screen.AssertIconButtonsNamed("queue");
|
||||||
|
|||||||
Reference in new issue
Block a user