Files
Chronos/src/Titano.App/Shell/MainWindow.xaml
T
Claude a48ed8ed72 fix(app): captures render RTL windows as they are; the rail's check binds one way
- As the Uploader and Setup captures now do: the content of a right-to-left window already renders
  mirrored, so no second flip.
- The rail's buttons share a GroupName across its two lists; their check binds one way, so a window not
  yet on screen cannot write another's selection back into the shell.
- The Arabic smoke test also checks that the rail is drawn on the right.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-06 08:20:20 +00:00

102 lines
6.7 KiB
XML

<ui:TitanoWindow x:Class="Titano.App.Shell.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="clr-namespace:Titano.Ui.Controls;assembly=Titano.Ui"
xmlns:l="clr-namespace:Titano.Ui.Localization;assembly=Titano.Ui"
xmlns:shell="clr-namespace:Titano.App.Shell"
xmlns:infra="clr-namespace:Titano.App.Infrastructure"
xmlns:s="clr-namespace:Titano.App.Sections"
Title="{Binding WindowTitle}"
Width="1440" Height="900" MinWidth="1200" MinHeight="760"
WindowStartupLocation="CenterScreen">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!-- Navigation rail: full names, collapsible to icons (BRIEF §12.1). Expanded it is at least 128 px and grows with
the longest label of the language (up to 200 px); collapsed it is 48 px of icons. While the first-run dialog is
open the shell behind it takes no input. The buttons of both lists form one group (GroupName); their check
binds one way, the section the shell navigates to (a GroupName spans every window not yet on screen). -->
<Border x:Name="Rail" Background="{DynamicResource Brush.Chrome}" ui:NavRail.IsCollapsed="{Binding IsRailCollapsed}"
IsEnabled="{Binding IsShellEnabled}">
<Border.Style>
<Style TargetType="Border">
<Setter Property="MinWidth" Value="128" />
<Setter Property="MaxWidth" Value="200" />
<Style.Triggers>
<DataTrigger Binding="{Binding IsRailCollapsed}" Value="True">
<Setter Property="MinWidth" Value="0" />
<Setter Property="Width" Value="48" />
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<DockPanel Margin="8,8,8,8" LastChildFill="False">
<Button DockPanel.Dock="Top" Style="{StaticResource Button.IconSubtle}" HorizontalAlignment="Left" Margin="0,0,0,6"
ui:ButtonIcon.Glyph="{StaticResource Icon.Menu}" Command="{Binding ToggleRailCommand}"
ToolTip="{Binding RailToggleToolTip}" AutomationProperties.Name="{Binding RailToggleToolTip}" />
<ItemsControl DockPanel.Dock="Top" ItemsSource="{Binding TopSections}" Focusable="False">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type shell:SectionViewModel}">
<ui:NavRailButton GroupName="Rail" Glyph="{Binding Glyph}" Content="{Binding Label}" Badge="{Binding Badge}"
IsChecked="{Binding IsSelected, Mode=OneWay}" ToolTip="{Binding ToolTip}" AutomationProperties.Name="{Binding Label}"
Command="{Binding DataContext.NavigateCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}" CommandParameter="{Binding}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<ItemsControl DockPanel.Dock="Bottom" ItemsSource="{Binding BottomSections}" Focusable="False">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type shell:SectionViewModel}">
<ui:NavRailButton GroupName="Rail" Glyph="{Binding Glyph}" Content="{Binding Label}" Badge="{Binding Badge}"
IsChecked="{Binding IsSelected, Mode=OneWay}" ToolTip="{Binding ToolTip}" AutomationProperties.Name="{Binding Label}"
Command="{Binding DataContext.NavigateCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}" CommandParameter="{Binding}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DockPanel>
</Border>
<Grid Grid.Column="1" IsEnabled="{Binding IsShellEnabled}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<!-- Job bar (DESIGN §4): current job, progress, time left, pause; "Ready" when idle, hidden when idle in the editor.
Screen readers hear which job starts and when the queue empties, not its progress ticks. -->
<ui:JobBar x:Name="JobBar" Text="{Binding JobText}" Progress="{Binding JobProgress}" IsActive="{Binding IsJobActive}" IsIndeterminate="{Binding IsJobIndeterminate}"
StopCommand="{Binding StopJobCommand}" StopToolTip="{l:Loc Tooltips.Shell.PauseJob}" StopName="{l:Loc Shell.JobBar.Pause}" ActionGlyph="{StaticResource Icon.Pause}"
Visibility="{Binding IsJobBarVisible, Converter={StaticResource BoolToVisibility}}"
AutomationProperties.LiveSetting="Polite" infra:LiveRegion.Text="{Binding JobAnnouncement}" />
<ContentControl Grid.Row="1" Content="{Binding Current}" Focusable="False" />
<!-- Status strip -->
<Border Grid.Row="2" Height="30" Background="{DynamicResource Brush.Chrome}" Padding="20,0">
<StackPanel Orientation="Horizontal" TextElement.FontSize="12" TextElement.Foreground="{DynamicResource Brush.TextMuted}">
<TextBlock Text="{Binding SequencesText}" Margin="0,0,18,0" VerticalAlignment="Center" />
<TextBlock Text="{Binding PhotosText}" Margin="0,0,18,0" VerticalAlignment="Center" />
<TextBlock Text="{Binding StorageText}" Margin="0,0,18,0" VerticalAlignment="Center" />
<TextBlock x:Name="Connection" Text="{Binding ConnectionText}" Margin="0,0,18,0" VerticalAlignment="Center"
AutomationProperties.LiveSetting="Polite" infra:LiveRegion.Text="{Binding ConnectionText}" />
<TextBlock Text="{Binding JobsText}" VerticalAlignment="Center" />
</StackPanel>
</Border>
</Grid>
<!-- First run (Welcome.html): the shell dimmed behind one dialog that keeps the keyboard. -->
<Grid x:Name="WelcomeOverlay" Grid.ColumnSpan="2" Visibility="{Binding IsWelcomeOpen, Converter={StaticResource BoolToVisibility}}"
KeyboardNavigation.TabNavigation="Cycle" KeyboardNavigation.ControlTabNavigation="Cycle" KeyboardNavigation.DirectionalNavigation="Contained">
<Border Background="{DynamicResource Brush.Scrim}" />
<s:WelcomeView DataContext="{Binding Welcome}" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,114,0,0"
AutomationProperties.Name="{l:Loc Shell.Welcome.Title}" />
</Grid>
<!-- Above the first-run dialog too, so a card inserted meanwhile can still be acted on (Welcome.html). -->
<ui:ToastHost x:Name="Toasts" Grid.ColumnSpan="2" />
</Grid>
</ui:TitanoWindow>