fix(find): register the window shortcut before menus open

Keep the physical browser-focus shortcut test and identify collapsed browser headings separately from outline labels. Correct ADR spacing and record the terminal acceptance evidence.

Co-Authored-By: Codex (GPT-6) <noreply@openai.com>
Signed-off-by: James Maes <jmaes@dmdbrands.com>
This commit is contained in:
James MaesandCodex committed 2026-10-10 22:41:19 -05:00
1 parent 4f4280921c
commit 7d7c712c63
5 files changed
+45 -10

No files matched your search

+17
View File
@@ -168,3 +168,20 @@ also added. No local UI input. Observe exact new hosted handles after signed pus
Source heading/scroll/collapse synchronization and vim keys remain issue #10 scope.
Full PRODUCT.md, editor/print/multiwindow/activation/reference/standards/signing work
remain active. Do not claim new find acceptance or completed port before its evidence.
## Find shortcut and fragment acceptance correction
4f4280921cfc87551843a03e4067e6dfe7456ceb CI 38108596329 is terminal FAILURE:
36/38 native/UI and published tests pass. Installed channels were not reached.
Build/test, format, CodeQL 38108596346, scripts 38108595778, security 38108596376
and PR gates pass. Source selections, literal queries, real viewport wrap, reload
and temporary section restoration pass. Ctrl+F from browser focus did not open find;
fragment testing selected the visible sidebar label instead of its hidden browser
heading. Retained logs: artifacts/paired-find-ui-38108596329.log and
artifacts/paired-find-installed-38108596329.log.
Follow-up moves Ctrl+F to the always-loaded root accelerator and keeps the physical
browser-focus key test. Fragment lookup now requires the generated browser heading
ID and name; physical link click/reveal assertions remain. Also correct one ADR
heading's Markdown spacing. Neither correction is verified until hosted acceptance.
Full PRODUCT.md scope remains active; no local desktop input or release publication.
@@ -70,6 +70,7 @@ before applying results; repeat the current term after reload/theme navigation.
reveals sections temporarily and restores their saved choices on close, incorporating
explicit native section commands during search. Source synchronization, mirrored collapse
and vim keys remain separate work. Browser scripts, messages and host objects remain disabled.
## Verification and follow-up
Core regression tests cover GFM, hostile HTML and resource paths at 100% core line
+20 -2
View File
@@ -41,9 +41,27 @@ public sealed partial class MainWindow
/// <summary>Ctrl+F opens one native find toolbar and keeps keyboard focus in its text field.</summary>
private void Find_Click(object sender, RoutedEventArgs e)
/// <summary>The menu invokes the same command as the always-loaded window accelerator.</summary>
private void Find_Click(object sender, RoutedEventArgs e) => OpenFind();
/// <summary>Owns Ctrl+F independently of the closed menu flyout.</summary>
private void Find_Invoked(KeyboardAccelerator sender, KeyboardAcceleratorInvokedEventArgs args)
{
args.Handled = true;
OpenFind();
}
/// <summary>Opens one native find toolbar and keeps keyboard focus in its text field.</summary>
private void OpenFind()
{
if(_closed)
{
return;
}
FindBar.Visibility = Visibility.Visible;
FindText.Focus(FocusState.Programmatic);
FindText.SelectAll();
+5 -6
View File
@@ -9,7 +9,10 @@
<MicaBackdrop />
</Window.SystemBackdrop>
<Grid x:Name="RootGrid" SizeChanged="ReadingArea_SizeChanged">
<Grid x:Name="RootGrid" SizeChanged="ReadingArea_SizeChanged" KeyboardAcceleratorPlacementMode="Hidden">
<Grid.KeyboardAccelerators>
<KeyboardAccelerator Key="F" Modifiers="Control" Invoked="Find_Invoked" />
</Grid.KeyboardAccelerators>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
@@ -29,11 +32,7 @@
<MenuFlyoutItem x:Name="ExitMenuItem" Text="Exit" Click="Exit_Click" />
</MenuBarItem>
<MenuBarItem Title="Edit">
<MenuFlyoutItem x:Name="FindMenuItem" Text="Find..." Click="Find_Click">
<MenuFlyoutItem.KeyboardAccelerators>
<KeyboardAccelerator Key="F" Modifiers="Control" />
</MenuFlyoutItem.KeyboardAccelerators>
</MenuFlyoutItem>
<MenuFlyoutItem x:Name="FindMenuItem" Text="Find..." Click="Find_Click" KeyboardAcceleratorTextOverride="Ctrl+F" />
</MenuBarItem>
<MenuBarItem Title="View">
<ToggleMenuFlyoutItem x:Name="SourceToggle" Text="Markdown source" Click="Source_Click" />
@@ -442,7 +442,7 @@ public class AppTests
session.InvokeMenuItem("View", "OutlineToggle");
session.ClickElement("OutlineHeading:0");
session.ClickElement("ToggleSection");
AppSession.WaitUntilGone(() => session.FindInApp(cf => cf.ByName("Target heading")), "the heading inside its collapsed ancestor");
AppSession.WaitUntilGone(() => session.FindInApp(cf => cf.ByAutomationId("mv-heading-1").And(cf.ByName("Target heading"))), "the heading inside its collapsed ancestor");
AutomationElement link = session.WaitFor(() => session.MainWindow.FindFirstDescendant(cf => cf.ByControlType(FlaUI.Core.Definitions.ControlType.Hyperlink).And(cf.ByName("Jump to target"))), "the local fragment link");
session.MainWindow.SetForeground();
Assert.True(link.TryGetClickablePoint(out System.Drawing.Point point));
@@ -455,7 +455,7 @@ public class AppTests
FlaUI.Core.Input.Wait.UntilInputIsProcessed();
FlaUI.Core.Input.Mouse.Up(FlaUI.Core.Input.MouseButton.Left);
FlaUI.Core.Input.Wait.UntilInputIsProcessed();
session.WaitFor(() => session.FindInApp(cf => cf.ByName("Target heading")), "the fragment's revealed target heading");
session.WaitFor(() => session.FindInApp(cf => cf.ByAutomationId("mv-heading-1").And(cf.ByName("Target heading"))), "the fragment's revealed target heading");
session.WaitFor(() => session.FindInApp(cf => cf.ByName("Target body")), "the revealed target body");
Assert.NotNull(session.FindInApp(cf => cf.ByName("Fragment root")));
}