Skip to content

Fix breadcrumb bridge keyboard-navigation defects: Enter-key binding, scroll-into-view, and #440 router-test coverage gap - #750

Merged
drmoisan merged 8 commits into
mainfrom
bug/breadcrumb-bridge-keyboard-navigation-defects-737
Sep 3, 2026
Merged

Fix breadcrumb bridge keyboard-navigation defects: Enter-key binding, scroll-into-view, and #440 router-test coverage gap#750
drmoisan merged 8 commits into
mainfrom
bug/breadcrumb-bridge-keyboard-navigation-defects-737

Conversation

@drmoisan

@drmoisan drmoisan commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Fix breadcrumb bridge keyboard-navigation defects: Enter-key binding, scroll-into-view, and #440 router-test coverage gap

Summary

  • Adds an Enter key branch to the breadcrumb WebView2 bridge's inline JS keydown map, posting { type: 'rowSelected', rowId: id } so keyboard-only users can commit a highlighted suggestion (Finding 2, source Bug: efc-enter-activates-valid-highlighted-suggestion #641).
  • Adds scroll-into-view logic to the same bridge's inbound message listener so arrow-key navigation keeps the selected row visible after a render/subfolderResult DOM update (Finding 1, source Bug: efc-keyboard-navigation-keeps-highlighted-row-visible #640).
  • Adds a new MSTest regression test asserting both JS behaviors are present in the BreadcrumbDocumentAssets.BridgeJs constant, following this repo's existing string-containment precedent for JS content with no headless-browser harness.
  • Closes a router-test coverage gap in FolderBreadcrumbBridgeRouterTests.Route_LeftArrow_NothingToCollapse_ReportsUnhandledLeft: the test previously discarded the results of its first two Arrange-phase ArrowAsync calls; it now asserts each parses to a RenderMessage, preserving the Bug: breadcrumb-left-right-arrow-parent-child-navigation #440 ancestor-walk contract (two presses to reach root, UnhandledArrowMessage only on the third) (Finding 3, source Bug: breadcrumb-router-test-cr1-defect-neutral #693).
  • No production wire-format, message-type, or router-case change is introduced; the Enter binding reuses the existing rowSelected/SelectRow infrastructure.
  • Full C# toolchain (CSharpier format/check, analyzer rebuild, nullable rebuild, vstest with coverage) passes cleanly in a single pass; repository-wide coverage is unchanged or improved (85.39% line-rate, 79.46% branch-rate), and the sole modified production file contributes zero new coverable lines (const-string-only edits).

Why

A code-review sweep of the breadcrumb WebView2 keyboard-bridge path found three related gaps, grouped into one issue because all three touch the same keyboard-routing path from WebView2 through to FolderBreadcrumbBridgeRouter: the inline JS keydown map was missing an Enter binding entirely, arrow-key navigation had no scroll-into-view feedback, and a router test masked a left-arrow collapse coverage gap by discarding two of its own Arrange-phase results. Findings 1 and 2 share a root cause: the inline JS keydown map in BreadcrumbDocumentAssets.cs was built out incrementally (arrow keys first) and was never extended with an Enter branch or scroll-into-view logic. Finding 3 is an unrelated test-coverage gap found during the same review pass. Full details are recorded in docs/features/active/2026-09-02-breadcrumb-bridge-keyboard-navigation-defects-737/issue.md and spec.md.

What Changed

Core feature (production):

  • UtilitiesCS/OutlookObjects/Folder/BreadcrumbDocumentAssets.cs — two additive insertions to the BridgeJs JS constant: (1) an Enter branch in the keydown listener that looks up the .rowwrap.selected element and posts { type: 'rowSelected', rowId: id }, mirroring the existing arrow-key handler's lookup pattern; (2) a scroll-into-view call (scrollTarget.scrollIntoView({ block: 'nearest' })) added to the inbound render/subfolderResult message listener.

Tests:

  • UtilitiesCS.Test/OutlookObjects/Folder/BreadcrumbHtmlRendererTests.cs — new [TestMethod] Issue737BridgeJsPostsRowSelectedOnEnterAndScrollsSelectedRowIntoView, asserting the BridgeJs constant contains the Enter-key branch and the scroll-into-view call, following the existing Issue439... string-containment precedent.
  • UtilitiesCS.Test/OutlookObjects/Folder/FolderBreadcrumbBridgeRouterTests.csRoute_LeftArrow_NothingToCollapse_ReportsUnhandledLeft now captures and asserts both previously-discarded ArrowAsync(router, "left") Arrange-phase results as RenderMessage, in addition to the pre-existing third-press UnhandledArrowMessage assertion. No helper method (ArrowAsync, PopulatedRouterAsync) or provider-mock factory was modified.

Docs/evidence:

  • docs/features/active/2026-09-02-breadcrumb-bridge-keyboard-navigation-defects-737/ — issue, spec, research, atomic plan, policy-audit, code-review, feature-audit, and full baseline/QA-gate evidence trail (Phase 0 through Phase 5).

Architecture / How It Fits Together

The breadcrumb bridge is a WebView2-hosted inline-JS component (BridgeJs, defined as a C# string constant in BreadcrumbDocumentAssets.cs) that posts messages to the host via window.chrome.webview.postMessage. The C# side (FolderBreadcrumbBridgeRouter) already recognizes and handles rowSelected messages from the existing mouse-click path; the new Enter-key branch reuses that same message shape and C#-side handling, so no new message type, codec branch, or router case is required. The scroll-into-view addition is a pure client-side DOM operation inside the same inbound message listener that already re-renders the document on render/subfolderResult; it has no C#-side counterpart. The router-test fix (FolderBreadcrumbBridgeRouterTests.cs) is test-only and does not touch QuickFiler/Controllers/BreadcrumbBridgeRouter.Arrows.cs (the #440 production logic) or any Qfc-pipeline file.

Verification

Completed (see docs/features/active/2026-09-02-breadcrumb-bridge-keyboard-navigation-defects-737/evidence/ for full artifacts):

  • CSharpier format (scoped to the Write Set) and repo-wide CSharpier check: exit 0.
  • .NET analyzer rebuild (-EnableNETAnalyzers -EnforceCodeStyleInBuild): exit 0.
  • Nullable rebuild (-TreatWarningsAsErrors): exit 0.
  • Scoped vstest run covering every touched/added test (FolderBreadcrumbBridgeRouterTests, FolderBreadcrumbBridgeRouterInFlightTests, BreadcrumbHtmlRendererTests): 41 total, 0 failed.
  • New/modified tests run in isolation: Issue737BridgeJsPostsRowSelectedOnEnterAndScrollsSelectedRowIntoView (1 passed), Route_LeftArrow_NothingToCollapse_ReportsUnhandledLeft (1 passed), and the sibling Bug: breadcrumb-left-right-arrow-parent-child-navigation #440 regression test ArrowAsync_QfcLeftOnMultiSegmentRow_RoutesParentSelectTransition (1 passed) to confirm consistency with the Bug: breadcrumb-left-right-arrow-parent-child-navigation #440 ancestor-walk contract.
  • Full-repository coverage capture: line-rate 85.3867%, branch-rate 79.4649% (both clear the repo's 85%/75% floors); the modified production file (BreadcrumbDocumentAssets.cs) is const-string-only and contributes zero new coverable lines, so the coverage delta reflects no regression on changed lines.
  • Independent feature-review pass (policy-audit, code-review, feature-audit) found 0 blocking findings; all 7 acceptance criteria independently re-verified against the diff and evidence, not just the executor's checkbox state.

Recommended: CI re-run of the full C# toolchain against the merge commit, as with any other PR in this repository.

Backward Compatibility / Migration Notes

No breaking changes. No public API, message-wire-format, or router-contract change. No renamed or removed paths.

Risks and Mitigations

  • Risk: The new Enter-key branch could interact unexpectedly with the existing arrow-key selection state. Mitigation: The branch reuses the identical .rowwrap.selected lookup and rowSelected post shape the mouse-click path already uses; no new C#-side handling was introduced, so existing rowSelected handling coverage applies unchanged.
  • Risk: The scroll-into-view call could fire when no row is selected. Mitigation: The call is guarded by an if (scrollTarget) check; it is a no-op when .rowwrap.selected does not resolve to an element.
  • Risk: The router-test fix could mask or alter the Bug: breadcrumb-left-right-arrow-parent-child-navigation #440 fix's behavior. Mitigation: The fix is test-only (no production code touched) and the sibling Bug: breadcrumb-left-right-arrow-parent-child-navigation #440 regression test was independently re-run and passed, confirming the ancestor-walk contract is unaffected.

Review Guide

Suggested order:

  1. UtilitiesCS/OutlookObjects/Folder/BreadcrumbDocumentAssets.cs — the two production JS insertions (Enter branch, scroll-into-view).
  2. UtilitiesCS.Test/OutlookObjects/Folder/BreadcrumbHtmlRendererTests.cs — the new string-containment test.
  3. UtilitiesCS.Test/OutlookObjects/Folder/FolderBreadcrumbBridgeRouterTests.cs — the router-test assertion fix.
  4. docs/features/active/2026-09-02-breadcrumb-bridge-keyboard-navigation-defects-737/ — issue/spec/plan/evidence, for traceability only.

No mechanical moves, renames, or large generated diffs are present; the change is small and self-contained.

Follow-ups

None. Issue #737 (all three consolidated findings) is fully resolved by this change.

drmoisan and others added 8 commits September 2, 2026 13:10
… keyboard-navigation defects

Preparation-mode delivery for issue #737: research confirms Findings 1/2
(scroll-into-view, Enter key) are Efc-pipeline-only in BreadcrumbDocumentAssets.cs,
while Finding 3 (discarded test assertions) is Qfc-pipeline-only, contradicting
the issue's single-chain framing. Verifies the #440 ancestor-walk fix remains
live on origin/main and documents no overlap with this fix's scope. Atomic plan
cleared atomic-executor preflight after three rounds (test-count arithmetic,
scope-verification gate exclusion, stray bootstrap-stub guard).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LTjXvNFHVh7Fo7kYGgWsx2
…440 router-test assertion fix

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LTjXvNFHVh7Fo7kYGgWsx2
…ion evidence

Housekeeping commit reconciling the plan checklist state that necessarily post-dates
the P5-T13 commit it records (plan-checkoff fixpoint), plus the P5-T14 evidence
artifact written after that commit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LTjXvNFHVh7Fo7kYGgWsx2
Records the confirmed-empty filtered git status --porcelain after the P5-T13/P5-T14
check-off housekeeping commit, closing the plan-checkoff fixpoint gap.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LTjXvNFHVh7Fo7kYGgWsx2
…ifacts

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@drmoisan
drmoisan merged commit 87233f8 into main Sep 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: breadcrumb-bridge-keyboard-navigation-defects

1 participant