Skip to content

Interactive 2D wave optics simulator. Turn any image into a refractive scene, add sources, watch waves refract, diffract and interfere. Probes, intensity maps, video export.

C#

Keyboard gaps closed: the pane toolbars in the Tab cycle, dock titles visible to UI Automation

Alexander Graef7a8896c4c0e9
diff --git a/CLAUDE.md b/CLAUDE.md
index 6ebd7d7..363e2f5 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -555,15 +555,20 @@ WPF shell as it stands:
execute `SetInPoint`/`SetOutPoint` with the frame as parameter). Playback stops at the out point
or wraps to the in point while looping.
- **Keyboard first.** Every control must be reachable and operable with Tab and the arrow keys and
- show its keyboard focus (accent border); the user tests without the mouse. The preview pane is
+ show its keyboard focus (accent border); the user tests without the mouse. The base `Button` style shows
+ the focus as the accent border and drops WPF's dotted rectangle (2026-10-15). The preview pane is
the model: explicit `TabIndex` order, the menu bar is not in the Tab cycle (F10 focuses it,
2026-10-14), the radio group is one tab stop (`IsTabStop` bound to
`IsChecked`, arrows handled in code because WPF's directional navigation skips non-tab-stops),
Play/Pause hand focus to each other when they get disabled, `AutomationProperties.AutomationId`
on everything a harness needs. Every shortcut a harness must press needs an **unmodified** key
- (posted messages cannot carry Shift/Ctrl/Alt), which is why Stop also has Esc. Toolbar buttons
- in `ProjectTree`/`MessagesPane` are still `Focusable=False` (reachable only through
- menus/shortcuts), not yet brought in line.
+ (posted messages cannot carry Shift/Ctrl/Alt), which is why Stop also has Esc. The toolbars of
+ `ProjectTree` (ids `ToolAddSource`, `ToolAddProbe`, `ToolMoveUp`, `ToolMoveDown`, `ToolRemove`; the `ToolGlyphButton`
+ style) and `MessagesPane` (`MessagesLevel:<name>`, `MessagesSearch`, `MessagesRegex`, `MessagesAutoScroll`,
+ `MessagesClear`, left to right through `TabIndex`, whatever the dock order says; the list is `MessagesList`) are in
+ the Tab cycle since 2026-10-15 (`KeyboardCheck.ps1`); the buttons on the tree's rows stay out of it, since the
+ toolbar and the context menu do the same. **Dock pane titles** are visible to UI Automation as
+ `DockTitle:<pane id>` (a `TextBlock` inside a template is out of the control view unless it carries an id).
- File type: `FileAssociation.Register` (called from `App.OnStartup`) registers `.wdproj` → ProgId
`WaveDudeNext.Project` → `"exe" "%1"` under HKCR when elevated, else HKCU\Software\Classes (same order
as DTCODataSimulator), idempotently; a double-click arrives as `e.Args[0]` and goes to
@@ -727,6 +732,10 @@ passing harnesses for comfort, never all of them after an edit.
popup's own window is captured as `%TEMP%\wavedude_color_picker.popup.png`.
A `Rectangle` has no automation peer (the gradient's id `SchemeGradient` is invisible to UIA; the "Add stop"
button marks the editor instead).
+ `_tools/ui_check/KeyboardCheck.ps1` (2026-10-15, about 12 checks, about 15 s) walks the Project pane's toolbar with
+ Tab (the disabled buttons skipped), adds a source with Space on "+ Source" and removes it with Space on the remove
+ button, opens the Messages pane through View > Panes by keyboard, walks its toolbar left to right, flips a level
+ with Space, clears the list with Space on the clear button (`MessagesList` empty), and reads both dock titles.
`_tools/ui_check/AboutCheck.ps1` (2026-10-15, 18 checks, about 10 s) opens Help > About by keyboard (F10, Left wraps
to the Help header, Down, Enter), finds the dialog as a child of the main window, posts its keys to the dialog's own
handle (`DKey`), and checks the version line against `git rev-parse --short=7 HEAD`, the copyright and credit lines,
@@ -994,7 +1003,7 @@ canvases, HEVC (Media Foundation has it on some machines). Author's point 10.
**Also open, smaller.** base64 vs BaseXML for the embedded image; the RAM-first frame store (numbers above);
dropping the 9-point Laplacian (author's suggestion, user undecided); timeline event tracks, zoom and
-pan (roadmap); dock pane titles are not exposed to UI Automation.
+pan (roadmap).
## Roadmap
diff --git a/WaveDudeNext.WPF/Panes/MessagesPane.xaml b/WaveDudeNext.WPF/Panes/MessagesPane.xaml
index 61952cc..9d7f512 100644
--- a/WaveDudeNext.WPF/Panes/MessagesPane.xaml
+++ b/WaveDudeNext.WPF/Panes/MessagesPane.xaml
@@ -27,12 +27,13 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<UserControl.Resources>
<StreamGeometry x:Key="ClearGeometry">M1,2 L9,2 M3,2 L3,9 L7,9 L7,2 M4,0 L6,0</StreamGeometry>
+ <!-- in the Tab cycle since 2026-10-15 (the keyboard-first rule); keyboard focus is the accent border -->
<Style x:Key="ToolToggle" TargetType="{x:Type ToggleButton}">
<Setter Property="Foreground" Value="{DynamicResource WindowForeground}" />
<Setter Property="Padding" Value="6,1" />
<Setter Property="Margin" Value="1,0" />
<Setter Property="MinHeight" Value="20" />
- <Setter Property="Focusable" Value="False" />
+ <Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
@@ -51,6 +52,9 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<Trigger Property="IsChecked" Value="False">
<Setter Property="Foreground" Value="{DynamicResource GrayText}" />
</Trigger>
+ <Trigger Property="IsKeyboardFocused" Value="True">
+ <Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Accent}" />
+ </Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
@@ -60,7 +64,7 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<!-- one toggle per level, "Level (count)", colour of the level -->
<DataTemplate DataType="{x:Type local:LevelFilter}">
<ToggleButton Style="{StaticResource ToolToggle}" IsChecked="{Binding IsVisible, Mode=TwoWay}"
- ToolTip="{DynamicResource TipMessagesLevel}">
+ ToolTip="{DynamicResource TipMessagesLevel}" AutomationProperties.AutomationId="{Binding Name, StringFormat='MessagesLevel:{0}'}">
<ToggleButton.Content>
<TextBlock>
<Run Text="{Binding Name, Mode=OneWay}" /><Run Text=" (" /><Run Text="{Binding Count, Mode=OneWay}" /><Run Text=")" />
@@ -79,44 +83,13 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<DockPanel>
<!-- toolbar: level filters, search, auto-scroll, clear -->
<Border DockPanel.Dock="Top" BorderBrush="{DynamicResource ToolWindowBorder}" BorderThickness="0,0,0,1" Padding="2,2">
- <DockPanel>
- <Button DockPanel.Dock="Right" Width="18" Height="18" Margin="1,0" Focusable="False" ToolTip="{DynamicResource TipMessagesClear}"
- AutomationProperties.Name="{DynamicResource TipMessagesClear}" Command="{x:Static local:MessagesPane.Clear}">
- <Button.Template>
- <ControlTemplate TargetType="{x:Type Button}">
- <Border x:Name="Bd" Background="Transparent" SnapsToDevicePixels="True">
- <Path Data="{StaticResource ClearGeometry}" Stroke="{DynamicResource WindowForeground}" StrokeThickness="1.2"
- HorizontalAlignment="Center" VerticalAlignment="Center" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="Bd" Property="Background" Value="{DynamicResource ButtonHover}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Button.Template>
- </Button>
- <ToggleButton DockPanel.Dock="Right" Style="{StaticResource ToolToggle}" Content="{DynamicResource MessagesAutoScroll}"
- ToolTip="{DynamicResource TipMessagesAutoScroll}" IsChecked="{Binding AutoScroll, Mode=TwoWay}" />
- <CheckBox DockPanel.Dock="Right" Content="{DynamicResource MessagesRegex}" ToolTip="{DynamicResource TipMessagesRegex}"
- IsChecked="{Binding UseRegex, Mode=TwoWay}" Margin="6,0" VerticalAlignment="Center" />
- <Grid DockPanel.Dock="Right" Width="180" Margin="6,0,0,0">
- <TextBox x:Name="searchBox" Text="{Binding SearchText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
- AutomationProperties.Name="{DynamicResource MessagesSearchHint}" />
- <TextBlock Text="{DynamicResource MessagesSearchHint}" Margin="5,0" VerticalAlignment="Center" IsHitTestVisible="False"
- Foreground="{DynamicResource GrayText}">
- <TextBlock.Style>
- <Style TargetType="{x:Type TextBlock}">
- <Setter Property="Visibility" Value="Collapsed" />
- <Style.Triggers>
- <DataTrigger Binding="{Binding Text, ElementName=searchBox}" Value="">
- <Setter Property="Visibility" Value="Visible" />
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </TextBlock.Style>
- </TextBlock>
- </Grid>
+ <!-- declared left to right, levels first, so the Tab order is the visual order (TabIndex across nested panels
+ was not honoured by WPF: the list came between the levels and the search box) -->
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*" />
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
<ItemsControl ItemsSource="{Binding Levels}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
@@ -124,10 +97,52 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
- </DockPanel>
+ <StackPanel Grid.Column="1" Orientation="Horizontal">
+ <Grid Width="180" Margin="6,0,0,0">
+ <TextBox x:Name="searchBox" Text="{Binding SearchText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+ AutomationProperties.Name="{DynamicResource MessagesSearchHint}" AutomationProperties.AutomationId="MessagesSearch" />
+ <TextBlock Text="{DynamicResource MessagesSearchHint}" Margin="5,0" VerticalAlignment="Center" IsHitTestVisible="False"
+ Foreground="{DynamicResource GrayText}">
+ <TextBlock.Style>
+ <Style TargetType="{x:Type TextBlock}">
+ <Setter Property="Visibility" Value="Collapsed" />
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding Text, ElementName=searchBox}" Value="">
+ <Setter Property="Visibility" Value="Visible" />
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </TextBlock.Style>
+ </TextBlock>
+ </Grid>
+ <CheckBox Content="{DynamicResource MessagesRegex}" ToolTip="{DynamicResource TipMessagesRegex}"
+ IsChecked="{Binding UseRegex, Mode=TwoWay}" Margin="6,0" VerticalAlignment="Center" AutomationProperties.AutomationId="MessagesRegex" />
+ <ToggleButton Style="{StaticResource ToolToggle}" Content="{DynamicResource MessagesAutoScroll}"
+ ToolTip="{DynamicResource TipMessagesAutoScroll}" IsChecked="{Binding AutoScroll, Mode=TwoWay}" AutomationProperties.AutomationId="MessagesAutoScroll" />
+ <Button Width="18" Height="18" Margin="1,0" FocusVisualStyle="{x:Null}" ToolTip="{DynamicResource TipMessagesClear}"
+ AutomationProperties.Name="{DynamicResource TipMessagesClear}" AutomationProperties.AutomationId="MessagesClear" Command="{x:Static local:MessagesPane.Clear}">
+ <Button.Template>
+ <ControlTemplate TargetType="{x:Type Button}">
+ <Border x:Name="Bd" Background="Transparent" BorderBrush="Transparent" BorderThickness="1" SnapsToDevicePixels="True">
+ <Path Data="{StaticResource ClearGeometry}" Stroke="{DynamicResource WindowForeground}" StrokeThickness="1.2"
+ HorizontalAlignment="Center" VerticalAlignment="Center" />
+ </Border>
+ <ControlTemplate.Triggers>
+ <Trigger Property="IsMouseOver" Value="True">
+ <Setter TargetName="Bd" Property="Background" Value="{DynamicResource ButtonHover}" />
+ </Trigger>
+ <Trigger Property="IsKeyboardFocused" Value="True">
+ <Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Accent}" />
+ </Trigger>
+ </ControlTemplate.Triggers>
+ </ControlTemplate>
+ </Button.Template>
+ </Button>
+ </StackPanel>
+ </Grid>
</Border>
- <ListView x:Name="list" ItemsSource="{Binding View}" SelectionMode="Extended"
+ <ListView x:Name="list" ItemsSource="{Binding View}" SelectionMode="Extended" AutomationProperties.AutomationId="MessagesList"
ScrollViewer.HorizontalScrollBarVisibility="Auto" VirtualizingPanel.IsVirtualizing="True">
<ListView.ItemContainerStyle>
<Style TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource {x:Type ListViewItem}}">
diff --git a/WaveDudeNext.WPF/Panes/ProjectTree.xaml b/WaveDudeNext.WPF/Panes/ProjectTree.xaml
index 7a833a7..ce4cea2 100644
--- a/WaveDudeNext.WPF/Panes/ProjectTree.xaml
+++ b/WaveDudeNext.WPF/Panes/ProjectTree.xaml
@@ -37,18 +37,20 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<StreamGeometry x:Key="ChevronUpGeometry">M0,6 L4,2 L8,6</StreamGeometry>
<StreamGeometry x:Key="ChevronDownGeometry">M0,2 L4,6 L8,2</StreamGeometry>
- <!-- stroked-glyph button for the rows and the toolbar; Content is the geometry -->
+ <!-- stroked-glyph button for the rows (out of the Tab cycle: the toolbar and the context menu do the same) and,
+ through ToolGlyphButton, for the toolbar; Content is the geometry -->
<Style x:Key="GlyphButton" TargetType="{x:Type Button}">
<Setter Property="Width" Value="18" />
<Setter Property="Height" Value="18" />
<Setter Property="Margin" Value="1,0" />
<Setter Property="Focusable" Value="False" />
<Setter Property="IsTabStop" Value="False" />
+ <Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Foreground" Value="{DynamicResource WindowForeground}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
- <Border x:Name="Bd" Background="Transparent" SnapsToDevicePixels="True">
+ <Border x:Name="Bd" Background="Transparent" BorderBrush="Transparent" BorderThickness="1" SnapsToDevicePixels="True">
<Path Data="{TemplateBinding Content}" Stroke="{TemplateBinding Foreground}" StrokeThickness="1.2"
HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
@@ -56,6 +58,9 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource ButtonHover}" />
</Trigger>
+ <Trigger Property="IsKeyboardFocused" Value="True">
+ <Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Accent}" />
+ </Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{DynamicResource GrayText}" />
<Setter Property="Opacity" Value="0.5" />
@@ -65,11 +70,15 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
</Setter.Value>
</Setter>
</Style>
+ <!-- the toolbar's buttons are in the Tab cycle (2026-10-15, the keyboard-first rule) -->
+ <Style x:Key="ToolGlyphButton" TargetType="{x:Type Button}" BasedOn="{StaticResource GlyphButton}">
+ <Setter Property="Focusable" Value="True" />
+ <Setter Property="IsTabStop" Value="True" />
+ </Style>
<Style x:Key="TextButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Padding" Value="6,0" />
<Setter Property="MinHeight" Value="20" />
<Setter Property="Margin" Value="1,0" />
- <Setter Property="Focusable" Value="False" />
</Style>
</UserControl.Resources>
@@ -79,16 +88,16 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<Border DockPanel.Dock="Top" BorderBrush="{DynamicResource ToolWindowBorder}" BorderThickness="0,0,0,1" Padding="2,2">
<StackPanel Orientation="Horizontal">
<Button Style="{StaticResource TextButton}" Content="{DynamicResource ToolAddSource}" ToolTip="{DynamicResource TipAddSource}" AutomationProperties.Name="{DynamicResource TipAddSource}"
- Command="{x:Static commands:ProjectCommands.AddSource}" />
+ Command="{x:Static commands:ProjectCommands.AddSource}" AutomationProperties.AutomationId="ToolAddSource" />
<Button Style="{StaticResource TextButton}" Content="{DynamicResource ToolAddProbe}" ToolTip="{DynamicResource TipAddProbe}" AutomationProperties.Name="{DynamicResource TipAddProbe}"
- Command="{x:Static commands:ProjectCommands.AddProbe}" />
+ Command="{x:Static commands:ProjectCommands.AddProbe}" AutomationProperties.AutomationId="ToolAddProbe" />
<Rectangle Width="1" Margin="4,2" Fill="{DynamicResource ToolWindowBorder}" />
- <Button Style="{StaticResource GlyphButton}" Content="{StaticResource ChevronUpGeometry}" ToolTip="{DynamicResource TipMoveUp}" AutomationProperties.Name="{DynamicResource TipMoveUp}"
- Command="{x:Static commands:ProjectCommands.MoveUp}" />
- <Button Style="{StaticResource GlyphButton}" Content="{StaticResource ChevronDownGeometry}" ToolTip="{DynamicResource TipMoveDown}" AutomationProperties.Name="{DynamicResource TipMoveDown}"
- Command="{x:Static commands:ProjectCommands.MoveDown}" />
- <Button Style="{StaticResource GlyphButton}" Content="{StaticResource MinusGeometry}" ToolTip="{DynamicResource TipRemove}" AutomationProperties.Name="{DynamicResource TipRemove}"
- Command="{x:Static commands:ProjectCommands.Remove}" />
+ <Button Style="{StaticResource ToolGlyphButton}" Content="{StaticResource ChevronUpGeometry}" ToolTip="{DynamicResource TipMoveUp}" AutomationProperties.Name="{DynamicResource TipMoveUp}"
+ Command="{x:Static commands:ProjectCommands.MoveUp}" AutomationProperties.AutomationId="ToolMoveUp" />
+ <Button Style="{StaticResource ToolGlyphButton}" Content="{StaticResource ChevronDownGeometry}" ToolTip="{DynamicResource TipMoveDown}" AutomationProperties.Name="{DynamicResource TipMoveDown}"
+ Command="{x:Static commands:ProjectCommands.MoveDown}" AutomationProperties.AutomationId="ToolMoveDown" />
+ <Button Style="{StaticResource ToolGlyphButton}" Content="{StaticResource MinusGeometry}" ToolTip="{DynamicResource TipRemove}" AutomationProperties.Name="{DynamicResource TipRemove}"
+ Command="{x:Static commands:ProjectCommands.Remove}" AutomationProperties.AutomationId="ToolRemove" />
</StackPanel>
</Border>
diff --git a/WaveDudeNext.WPF/Themes/Controls.xaml b/WaveDudeNext.WPF/Themes/Controls.xaml
index f160c9f..3d8c1f4 100644
--- a/WaveDudeNext.WPF/Themes/Controls.xaml
+++ b/WaveDudeNext.WPF/Themes/Controls.xaml
@@ -543,6 +543,8 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Padding" Value="10,3" />
<Setter Property="MinHeight" Value="23" />
+ <!-- keyboard focus is the accent border (the user's rule), not WPF's dotted rectangle -->
+ <Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
@@ -554,6 +556,9 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource ButtonHover}" />
</Trigger>
+ <Trigger Property="IsKeyboardFocused" Value="True">
+ <Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Accent}" />
+ </Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource ButtonPressed}" />
<Setter Property="Foreground" Value="White" />
@@ -720,8 +725,11 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
Background="{DynamicResource TitleBarButtonHoverInactive}"
Visibility="{Binding Group.ActiveItem.CanClose, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BoolToVisibility}}" />
</StackPanel>
- <TextBlock DockPanel.Dock="Left" Text="{Binding Group.ActiveItem.Title, RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="Center"
- TextTrimming="CharacterEllipsis" />
+ <!-- a Label, not a TextBlock: a TextBlock inside a template stays out of the UI Automation control view, id or
+ not, while a Label is a control with a peer; the title is read as DockTitle:<pane id> -->
+ <Label DockPanel.Dock="Left" Content="{Binding Group.ActiveItem.Title, RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="Center"
+ Padding="0" Foreground="{Binding (TextElement.Foreground), RelativeSource={RelativeSource AncestorType={x:Type Border}}}"
+ AutomationProperties.AutomationId="{Binding Group.ActiveItem.Id, RelativeSource={RelativeSource TemplatedParent}, StringFormat='DockTitle:{0}'}" />
<Rectangle x:Name="Grip" Height="5" Margin="6,0,4,0" VerticalAlignment="Center"
Fill="{StaticResource DockGripInactiveBrush}" />
</DockPanel>
diff --git a/_tools/ui_check/KeyboardCheck.ps1 b/_tools/ui_check/KeyboardCheck.ps1
new file mode 100644
index 0000000..0ef2c05
--- /dev/null
+++ b/_tools/ui_check/KeyboardCheck.ps1
@@ -0,0 +1,120 @@
+# SPDX-License-Identifier: GPL-3.0-or-later
+# Copyright (C) 2026 Alexander Graef <[email protected]>
+#
+# This file is part of WaveDude Next, a 2D wave simulator.
+#
+# Based on the work of
+# JJM Vleggaar (Huygens Optics), author of Wave Dude 2D, Copyright (C) 2026
+# <https://www.youtube.com/@HuygensOptics>, <https://www.huygensoptics.com>
+# Manuel (0x23, Diffraction Limited), author of WaveSimulator2D
+# <https://www.youtube.com/@DiffractionLimited>, <https://github.com/0x23/WaveSimulator2D>
+#
+# WaveDude Next is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation, either version 3 of the License, or (at your option) any later
+# version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
+# <https://www.gnu.org/licenses/>.
+
+# The keyboard gaps closed on 2026-10-15: the toolbars of the Project and Messages panes are in the Tab cycle and the
+# dock pane titles are visible to UI Automation. On the default project: Tab walks the Project toolbar (the disabled
+# buttons skipped) into the tree, Space on "+ Source" adds Source 2 and Space on the remove button takes it away, the
+# Messages pane is opened through View > Panes by keyboard, Tab walks its toolbar left to right, Space flips a level
+# and clears the list, and both pane titles read through their ids. See Common.ps1 for the rules (no mouse, no
+# activation, no UIA patterns). Prints PASS/FAIL per check and exits with the failure count.
+#
+# powershell -ExecutionPolicy Bypass -File _tools\ui_check\KeyboardCheck.ps1 [-Exe <path>] [-Trace]
+
+param(
+ [string]$Exe = (Join-Path $PSScriptRoot "..\..\WaveDudeNext.WPF\bin\Debug\net10.0-windows\WaveDudeNext.WPF.exe"),
+ [switch]$Trace
+)
+
+. (Join-Path $PSScriptRoot "Common.ps1")
+
+function Has([string]$id) { try { (Find $id) -ne $null } catch { $false } }
+function ListCount() {
+ $c = New-Object System.Windows.Automation.PropertyCondition($A::ControlTypeProperty, [System.Windows.Automation.ControlType]::DataItem) # a ListView's rows
+ return (Find "MessagesList").FindAll([System.Windows.Automation.TreeScope]::Children, $c).Count
+}
+function Step([string]$what, [int]$vk, [int]$settle) {
+ Key $vk $settle
+ if ($Trace) { " {0,-8} focus {1} foreground {2}" -f $what, (FocusedId), (Foreground) }
+}
+
+Start-App $Exe
+try {
+ Check "the Project pane's title reads through its id" ((Find "DockTitle:project").Current.Name -eq "Project") (Find "DockTitle:project").Current.Name
+
+ # ------------------------------------------------------------ the Project toolbar (the default project has no sources)
+ FocusOn "ToolAddSource"
+ $order = @(); for ($i = 0; $i -lt 2; $i++) { Key $VK_TAB 120; $order += (FocusedId) }
+ Check "Tab walks + Source > + Probe > the tree (move and remove are disabled with nothing selected and skipped)" (($order -join ",") -eq "ToolAddProbe,tree") ($order -join ",")
+ FocusOn "ToolAddSource"
+ Step "Space" $VK_SPACE 400
+ $null = WaitFor { Has "Tree:Source 1" } 3000 100
+ Check "Space on + Source adds Source 1, selected in the tree, the focus on its first editor" ((Has "Tree:Source 1") -and (TreeItemSelected "Source 1")) (FocusedId)
+ FocusOn "ToolAddSource" # round through the preview pane and back
+ Step "Space" $VK_SPACE 400
+ $null = WaitFor { Has "Tree:Source 2" } 3000 100
+ Check "a second Space adds Source 2" ((Has "Tree:Source 2") -and (TreeItemSelected "Source 2"))
+ # the walk to the toolbar passes the preview's source handles, and focusing a handle selects its source: the toolbar
+ # acts on whatever is selected when it is reached, so that is read first and the action checked against it
+ FocusOn "ToolAddProbe"
+ Key $VK_TAB 150
+ $move = FocusedId
+ $sel = if (TreeItemSelected "Source 2") { "Source 2" } else { "Source 1" }
+ $other = if ($sel -eq "Source 2") { "Source 1" } else { "Source 2" }
+ $selBelow = (Find "Tree:$sel").Current.BoundingRectangle.Top -gt (Find "Tree:$other").Current.BoundingRectangle.Top
+ Check "after + Probe, Tab reaches the one move button that applies: up for the lower item, down for the upper (the other is disabled and skipped)" (($move -eq "ToolMoveUp") -eq $selBelow -and ($move -eq "ToolMoveDown") -eq (-not $selBelow)) ("{0}, {1} selected, below: {2}" -f $move, $sel, $selBelow)
+ Step "Space" $VK_SPACE 300
+ $selBelowNow = (Find "Tree:$sel").Current.BoundingRectangle.Top -gt (Find "Tree:$other").Current.BoundingRectangle.Top
+ Check "Space on it swaps the two sources, the selection kept" ($selBelowNow -ne $selBelow -and (TreeItemSelected $sel)) ("{0} below: {1} -> {2}" -f $sel, $selBelow, $selBelowNow)
+ FocusOn "ToolRemove"
+ $victim = if (TreeItemSelected "Source 2") { "Source 2" } else { "Source 1" }
+ $kept = if ($victim -eq "Source 2") { "Source 1" } else { "Source 2" }
+ Step "Space" $VK_SPACE 400
+ Check "Space on the remove button takes the selected source away and selects the other" ((-not (Has "Tree:$victim")) -and (Has "Tree:$kept") -and (TreeItemSelected $kept)) ("removed {0}, focus {1}" -f $victim, (FocusedId))
+
+ # ------------------------------------------------------------ the Messages pane, toggled through View > Panes
+ # the dock layout is a persisted user setting, so the pane may be open from the last run: the menu entry toggles it,
+ # the toggle is checked either way, and the pane is opened for the rest when the toggle closed it
+ function ToggleMessagesPane() {
+ FocusOn "PreviewPlay"
+ Step "F10" 0x79 150 # the menu bar, File header
+ Step "Down" $VK_DOWN 150 # opens File
+ Step "Right" $VK_RIGHT 150 # moves to View and opens it on its first entry (Panes)
+ Step "Right" $VK_RIGHT 150 # opens the Panes submenu on its first entry
+ for ($i = 0; $i -lt 5 -and (FocusedId) -notlike "*'Messages')"; $i++) { Step "Down" $VK_DOWN 120 }
+ $listed = (FocusedId) -like "*'Messages')"
+ Step "Enter" $VK_RETURN 500
+ Start-Sleep -Milliseconds 600 # the dock host rebuilds its tree when a pane opens or closes
+ return $listed
+ }
+ $openBefore = Has "MessagesSearch"
+ $listed = ToggleMessagesPane
+ Check "View > Panes lists Messages" $listed (FocusedId)
+ $openAfter = Has "MessagesSearch"
+ Check ("Enter toggles the Messages pane (it was {0} to begin with)" -f $(if ($openBefore) { "open" } else { "closed" })) ($openAfter -ne $openBefore)
+ if (-not $openAfter) { $null = ToggleMessagesPane; $null = WaitFor { Has "MessagesSearch" } 5000 100; Start-Sleep -Milliseconds 800 }
+ Check "the Messages pane is open, titled" ((Has "MessagesSearch") -and ((Find "DockTitle:messages").Current.Name -eq "Messages"))
+ FocusOn "MessagesLevel:Trace"
+ $order = @(); for ($i = 0; $i -lt 9; $i++) { Key $VK_TAB 150; $order += (FocusedId) }
+ Check "Tab walks the levels, then search, regex, auto-scroll and clear, left to right" (($order -join ",") -eq "MessagesLevel:Debug,MessagesLevel:Info,MessagesLevel:Warn,MessagesLevel:Error,MessagesLevel:Fatal,MessagesSearch,MessagesRegex,MessagesAutoScroll,MessagesClear") ($order -join ",")
+ FocusOn "MessagesLevel:Info"
+ $was = ToggleOn "MessagesLevel:Info"
+ Step "Space" $VK_SPACE 200
+ Check "Space flips a level toggle" ((ToggleOn "MessagesLevel:Info") -ne $was)
+ Step "Space" $VK_SPACE 200
+ $before = ListCount
+ FocusOn "MessagesClear"
+ Step "Space" $VK_SPACE 400
+ Check "Space on the clear button empties the list" ($before -gt 0 -and (ListCount) -eq 0) ("{0} -> {1} entries" -f $before, (ListCount))
+ Check "app never became the foreground window" ((Foreground) -ne "APP") (Foreground)
+ # leave the layout as it was found
+ if (-not $openBefore) { $null = ToggleMessagesPane }
+}
+finally {
+ Stop-App
+}
+Write-Output ("{0} failure(s)" -f $script:failures)
+exit $script:failures
diff --git a/_tools/ui_check/LanguageCheck.ps1 b/_tools/ui_check/LanguageCheck.ps1
index b046264..00f021a 100644
--- a/_tools/ui_check/LanguageCheck.ps1
+++ b/_tools/ui_check/LanguageCheck.ps1
@@ -67,6 +67,8 @@ try {
Check "the Properties pane's labels follow (Frequenz)" ($script:win.FindFirst([System.Windows.Automation.TreeScope]::Descendants, $c) -ne $null)
# the dock pane titles are not exposed to UI Automation by name, so only the tree folders are checked here
Check "the tree's folders follow at once (Sonden, Farbschemata)" ((MenuItemVisible "Sonden") -and (MenuItemVisible "Farbschemata") -and -not (MenuItemVisible "Probes"))
+ # the dock pane titles are exposed to UI Automation since 2026-10-15 (id DockTitle:<pane id>)
+ Check "the dock pane titles follow (Projekt, Eigenschaften)" (((Find "DockTitle:project").Current.Name -eq "Projekt") -and ((Find "DockTitle:properties").Current.Name -eq "Eigenschaften")) ((Find "DockTitle:project").Current.Name)
Check "the app never took the foreground" ((Foreground) -ne "APP") (Foreground)
}
finally { Stop-App }