Skip to content

Fix FocusZone Shift+Tab traversal from first-child containers - #4320

Merged
Jason Morse (JasonVMo) merged 2 commits into
mainfrom
user/jasonvmo/issue-4317
Sep 22, 2026
Merged

Jason Morse (JasonVMo) merged 2 commits into
mainfrom
user/jasonvmo/issue-4317

Conversation

@JasonVMo

@JasonVMo Jason Morse (JasonVMo) commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Fixes #4317

Platforms Impacted

  • iOS
  • macOS
  • win32 (Office)
  • windows
  • android

The production fix is Windows Fabric-only. Native regression coverage is shared across Windows, Win32, and macOS because outside-zone Tab navigation is a shared contract. macOS uses an independent AppKit key-view loop that excludes the zone; Win32 uses its host-provided FocusZone. Neither native implementation is changed.

Description of changes

  • Keep reverse-preorder traversal, but accept a focus candidate only when it is the visited node itself. Searching an ancestor's entire subtree could previously re-enter the zone or select a later sibling.
  • Add a native first-child regression scene with nested non-collapsible containers, later siblings at both levels, and a preceding focusable subtree. Assert Shift+Tab exits from both the first and last zone items to the preceding outside control.
  • Cover preceding-sibling backward exit and forward Tab exit while retaining the existing linear and geometric navigation cases.
  • Update the FocusZone specification and add a patch changeset.

Verification

Before After
The new Windows Fabric regression fails: Shift+Tab does not focus the preceding outside button. The same native regression passes with the fix.
  • Windows Fabric: native build/bundle and smoke lifecycle pass; 156 stories render; all 5 FocusZone native cases pass, 0 fail, 0 skip.
  • Win32 Paper: smoke lifecycle passes; 150 stories render; all 5 FocusZone native cases pass, 0 fail, 0 skip.
  • macOS: production story bundle and test discovery pass. Native macOS execution was not available on the Windows development host.
  • FocusZone package: format, lint, build, and 9 tests pass.
  • Agentic components: format, lint, build, story type checks, 440 tests, and 8 snapshots pass.
  • Storybook format/lint, changeset validation, and diff checks pass.

Native smoke runs used a temporary wdio.story: 'native-focuszone--*' selector, removed before this commit. Owned app, Metro, and driver processes were cleaned up.

Pull request checklist

This PR has considered (when applicable):

  • Automated Tests
  • Documentation and examples
  • Keyboard Accessibility
  • Voiceover
  • Internationalization and Right-to-left Layouts

Windows CI follow-up

Commit 279722f8f fixes the separate legacy Windows E2E startup failure. The failed job installed windows@6.3.0 outside the Yarn lockfile, then could not import the driver's appium/driver.js peer dependency; no UI tests ran.

Both Windows endpoints now use APPIUM_HOME=. and the existing Yarn-managed Windows driver. Preparation validates its registered version, resolved package path, and actual dynamic import, and WDIO loads only the Windows driver. Other platforms retain their existing setup.

The three setup regression checks pass through both preparation commands. The old isolated Appium home is rejected as expected. A real Appium server successfully loaded the locked driver and answered /status, then was stopped. E2E lint/build, the root build, formatting, and changeset validation pass. Broader local repository lint reports Knip unused-dependency errors in untouched workspaces; this follow-up does not alter those packages. Full native Windows E2E confirmation is delegated to the new CI run because WinAppDriver is not installed locally.

Prevent Windows Fabric Shift+Tab from searching ancestor descendants. Add shared native regression coverage and document platform behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Bundle size report

Tree-shaken production Metro bundles. Component costs are relative to their platform shell; shell costs are absolute.

Platform Scenario Baseline cost Current cost Cost delta Change Gzip delta Module delta
macos shell 801.3 KiB 801.3 KiB 0.0 KiB 0.00% 0.0 KiB +0
macos components-button 50.1 KiB 57.4 KiB +7.3 KiB +14.58% +2.3 KiB +17
macos components-catalog 267.3 KiB 281.6 KiB +14.3 KiB +5.35% +5.1 KiB +24
macos design-theme-state 33.3 KiB 33.7 KiB +0.4 KiB +1.34% +0.2 KiB +6
macos design-themed-root New 36.1 KiB New New New New
macos design-color-lib 7.1 KiB 7.1 KiB 0.0 KiB 0.00% 0.0 KiB +0
macos design-theme-state-legacy-source 35.3 KiB 35.8 KiB +0.4 KiB +1.26% +0.1 KiB +6
macos design-legacy-theme-from-flex 100.2 KiB 100.7 KiB +0.4 KiB +0.45% +0.1 KiB +6
windows shell 810.2 KiB 810.2 KiB 0.0 KiB 0.00% 0.0 KiB +0
windows components-button 50.0 KiB 57.2 KiB +7.2 KiB +14.43% +2.4 KiB +17
windows components-catalog 267.0 KiB 281.2 KiB +14.2 KiB +5.31% +5.1 KiB +24
windows design-theme-state 33.2 KiB 33.7 KiB +0.5 KiB +1.36% +0.1 KiB +6
windows design-themed-root New 36.0 KiB New New New New
windows design-color-lib 7.1 KiB 7.1 KiB 0.0 KiB 0.00% 0.0 KiB +0
windows design-theme-state-legacy-source 35.3 KiB 35.7 KiB +0.4 KiB +1.27% +0.1 KiB +6
windows design-legacy-theme-from-flex 100.0 KiB 100.4 KiB +0.4 KiB +0.44% +0.1 KiB +6

The job is advisory: size changes are reported but do not fail the pull request. Bundle or analysis errors still fail.


View bundle-size workflow run

Keep Windows and Win32 setup on the lockfile-managed driver instead of installing an unversioned extension. Validate driver discovery and dynamic import before launching E2E tests, and scope Appium loading to the Windows driver.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@JasonVMo
Jason Morse (JasonVMo) merged commit bc0ba37 into main Sep 22, 2026
17 checks passed
@JasonVMo
Jason Morse (JasonVMo) deleted the user/jasonvmo/issue-4317 branch September 22, 2026 23:38
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.

Possible FocusZone logic error

2 participants