Files
HC_APTBS/Views/UserControls/TestDoneView.xaml
LucianoDev 0280a2fad1 feat: page-based navigation shell + Tests page wizard
Replace the monolithic MainWindow with a SelectedPage-driven shell
(Dashboard / Pump / Bench / Tests / Results / Settings). The Tests
page gets the Plan -> Preconditions -> Running -> Done wizard from
ui-structure.md \u00a74, backed by a 7-item precondition gate and
shared sub-views (PhaseCardView / TestSectionView / GraphicIndicatorView)
extracted from the now-deleted monolithic TestPanelView.

New VMs / views:
- Tests wizard: TestPreconditions, PhaseCard, GraphicIndicator,
  TestSection, TestPlan, TestRunning, TestDone
- Dashboard panels: DashboardConnection, DashboardReadings,
  DashboardAlarms, InterlockBanner, ResultHistory
- Pump / bench panels: PumpIdentificationPanel, PumpLiveData,
  UnlockPanel, BenchDriveControl, BenchReadings, RelayBank,
  TemperatureControl, DtcList, AuthGate
- Dialogs: generic ConfirmDialog, UserManageDialog, UserPromptDialog

Supporting changes:
- IsOilPumpOn exposed on MainViewModel for precondition evaluation
- RequiresAuth added to TestDefinition (XML round-trip)
- BipStatusDefinition + CompletedTestRun models
- ~35 new Test.* localization keys (en + es)
- Settings moved from modal dialog to full page
- Pause / Retry / Skip stubs in TestRunningView; full spec in
  docs/gap-test-running-controls.md for follow-up implementation
- docs/ui-structure.md captures the wizard design

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-18 13:11:34 +02:00

92 lines
4.4 KiB
XML

<UserControl x:Class="HC_APTBS.Views.UserControls.TestDoneView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:uc="clr-namespace:HC_APTBS.Views.UserControls"
xmlns:vmp="clr-namespace:HC_APTBS.ViewModels.Pages"
mc:Ignorable="d"
d:DesignHeight="560" d:DesignWidth="900"
Background="#FFEDEDED" Foreground="Black"
d:DataContext="{d:DesignInstance Type=vmp:TestsPageViewModel, IsDesignTimeCreatable=False}">
<!--
Done step of the Tests wizard. DataContext: TestsPageViewModel.
Shows PASS/FAIL banner, embedded ResultDisplayView, and navigation buttons.
-->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Overall pass/fail banner -->
<Border Padding="16,12" Margin="0,0,0,4">
<Border.Style>
<Style TargetType="Border">
<Setter Property="Background" Value="#FFCDD2"/>
<Style.Triggers>
<DataTrigger Binding="{Binding ResultDisplay.OverallPassed}" Value="True">
<Setter Property="Background" Value="#C8E6C9"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<StackPanel Orientation="Horizontal">
<TextBlock FontSize="26" FontWeight="Bold" VerticalAlignment="Center">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="#B71C1C"/>
<Setter Property="Text" Value="{DynamicResource Test.Done.Failed}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding ResultDisplay.OverallPassed}" Value="True">
<Setter Property="Foreground" Value="#2E7D32"/>
<Setter Property="Text" Value="{DynamicResource Test.Done.Passed}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Text="{Binding ResultDisplay.TestName}"
FontSize="14" FontStyle="Italic"
Foreground="#555"
VerticalAlignment="Bottom"
Margin="16,0,0,4"/>
</StackPanel>
</Border>
<!-- Inline results table -->
<uc:ResultDisplayView Grid.Row="1"
DataContext="{Binding ResultDisplay}"
Margin="4"/>
<!-- Action row -->
<Border Grid.Row="2" Padding="10,8"
BorderBrush="#DDD" BorderThickness="0,1,0,0"
Background="White">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button Grid.Column="0"
Content="{DynamicResource Test.Done.ViewFullResults}"
Command="{Binding ViewFullResultsCommand}"
Padding="14,6" FontSize="12"/>
<StackPanel Grid.Column="2" Orientation="Horizontal">
<Button Content="{DynamicResource Test.Report}"
Command="{Binding Root.GenerateReportCommand}"
Padding="14,6" FontSize="12" Margin="0,0,8,0"/>
<Button Content="{DynamicResource Test.Done.RunAgain}"
Command="{Binding RunAgainCommand}"
Padding="18,6" FontSize="14" FontWeight="Bold"
Background="#1565C0" Foreground="White" BorderThickness="0"/>
</StackPanel>
</Grid>
</Border>
</Grid>
</UserControl>