Skip to content

fix: restore Angular Components submenu interactions - #91

Open
Banegasn wants to merge 3 commits into
mainfrom
codex/fix-angular-components-submenu
Open

fix: restore Angular Components submenu interactions#91
Banegasn wants to merge 3 commits into
mainfrom
codex/fix-angular-components-submenu

Conversation

@Banegasn

Copy link
Copy Markdown
Owner

Reproduction

On the Angular demo desktop rail, hover Components, then move through the positioning offset into the submenu. The previous implementation could dismiss before the pointer reached the overlay; the Components rail item also navigated immediately instead of acting as a submenu trigger, and keyboard activation did not establish an Escape return-focus target.

Fix

  • add an offset bridge and preserve focus for pointer-driven opens
  • make Components a submenu trigger that supports click, Enter, Space, and ArrowRight
  • route menu-item selections and restore trigger focus on Escape
  • repair WebKit menu Tab traversal by moving focus before hiding its shadow-tree item

Validation

  • pnpm --filter @banegasn/m3-menu test (18 browser tests, including WebKit)
  • pnpm --filter @banegasn/m3-menu lint
  • pnpm --filter @banegasn/m3-menu typecheck
  • pnpm --filter @apps/angular-app test
  • pnpm --filter @apps/angular-app lint
  • pnpm --filter @apps/angular-app typecheck
  • pnpm --filter @apps/angular-app build
  • Playwright smoke: hover/overlay crossing, selection navigation, Enter, and Escape focus return

@Banegasn

Copy link
Copy Markdown
Owner Author

Acceptance review found two P1 blockers:

  1. The m3-menu Tab workaround replaces browser sequential focus with a light-DOM query heuristic, which skips shadow-root controls and breaks reverse Tab/no-destination behavior. Preserve native/composed-tree sequential navigation and add forward/reverse shadow-neighbor and no-destination coverage.
  2. The Angular submenu spec is synthetic/unit-only. Add a committed real-browser interaction regression covering pointer trigger → bridge → overlay after the hover delay, physical click plus Enter/Space/ArrowRight activation, routed selection, and Escape focus return.

Implementation has been returned for these focused fixes.

@Banegasn

Copy link
Copy Markdown
Owner Author

Addressed both P1s in 5d7d326.

  • Replaced manual document.querySelectorAll Tab targeting with native sequential Tab plus a Tab-gated focusout dismissal. The browser suite now covers forward/reverse traversal across neighboring shadow-root controls and the no-destination case.
  • Fixed the live Angular cause: app-seo-link wrappers are the assigned slot elements, so menu item discovery now descends each wrapper while preserving direct-item and disabled filtering.
  • Added runnable Chromium Playwright coverage (pnpm --filter @apps/angular-app test:e2e) for trigger → bridge → overlay after 225ms, routed selection, physical click, Enter/Space/ArrowRight, and Escape focus return.
  • Cleans desktop/mobile pending timers on Angular teardown.

Validated: m3-menu browser tests (24 across Chromium/Firefox/WebKit), m3-menu lint/typecheck/build; Angular unit tests, lint/typecheck/build, and Playwright e2e (2/2). Angular build retains its pre-existing budget warnings.

@Banegasn

Copy link
Copy Markdown
Owner Author

Re-review found two remaining P1 blockers:

  1. Multi-item menus no longer close on Tab: native focus moves First → Second, focus stays inside, and the menu remains open. Preserve native composed-tree destination while atomically removing menu items from sequential focus (or otherwise satisfy the documented Tab-close contract), with multi-item forward/reverse regressions.
  2. The committed Playwright submenu suite is not run by root tests or Quality. Wire test:e2e into turbo/root CI so the hover bridge, click, keyboard, route, and Escape paths are enforced.

Wrapper-slotted discovery, shadow-tree one-item/no-destination paths, and timer cleanup are accepted.

@Banegasn
Banegasn force-pushed the codex/fix-angular-components-submenu branch from 20bc512 to 9fab7df Compare July 30, 2026 08:01
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.

1 participant