Repository navigation
fix(DropdownMenu): a finger's hold-slide-lift no longer flashes the focus outline on the menu button - #10079
Conversation
…s the focus outline on the menu button
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 1bc297e |
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| DropdownMenu | 97.3 kB (+11 B) · 17.6 kB CSS (0) | — | ✓ · ✓ · ✓ |
| MoreMenu | 97.5 kB (+6 B) · 17.6 kB CSS (0) | — | — · — · — |
| ContextMenuItem | 29.3 kB (0) · 6.3 kB CSS (0) | — | — · — · — |
9 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| DropdownMenuCheckboxItem | 22.8 kB (0) · 6.6 kB CSS (0) | — | ✓ · ✓ · ✓ |
| DropdownMenuDivider | 5.2 kB (0) · 548 B CSS (0) | — | ✓ · ✓ · — |
| DropdownMenuGroup | 6.3 kB (0) · 3.4 kB CSS (0) | — | ✓ · ✓ · — |
| DropdownMenuItem | 22.0 kB (0) · 6.3 kB CSS (0) | — | ✓ · ✓ · — |
| DropdownMenuRadioGroup | 6.5 kB (0) · 3.3 kB CSS (0) | — | ✓ · ✓ · — |
| DropdownMenuRadioItem | 22.8 kB (0) · 6.6 kB CSS (0) | — | ✓ · ✓ · — |
| DropdownMenuSubMenu | 70.4 kB (0) · 9.7 kB CSS (0) | — | ✓ · ✓ · ✓ |
| lab/Comments | 351.4 kB (new) · 2.5 kB CSS (new) | — | — · — · — |
| lab/CommentThread | 344.5 kB (new) · 2.4 kB CSS (new) | — | — · — · — |
Package size: measured; main has no measurement of the merge base to compare yet.
API changes: cli +22 · ~7 · −0 (against the merge base's committed report); theme-butter +1 · ~0 · −0 (against the merge base's committed report); theme-y2k +1 · ~0 · −0 (against the merge base's committed report)
Committed API report behind this build: cli 29 rows, core 36 rows, theme-butter 1 row, theme-y2k 1 row; run pnpm api:report.
31 API changes (advisory)
| Package | Where | Signature | Usage | |
|---|---|---|---|---|
| + | cli |
./api · Functions · function exportSearchIndex |
function exportSearchIndex @experimental: (options?: { cwd?: string | undefined; package?: string | undefined }) => Promise<SearchIndex> |
import {exportSearchIndex} from '@astryxdesign/cli/api'; exportSearchIndex(…) |
| + | cli |
./api · Functions · function rankSearchIndex |
function rankSearchIndex @experimental: (query: string, indexes: SearchIndex | SearchIndex[], options?: { type?: SearchDomain | undefined; limit?: number | undefined }) => Promise<SearchResponse> |
import {rankSearchIndex} from '@astryxdesign/cli/api'; rankSearchIndex(…) |
| + | cli |
./api · Types · type DocsListChild |
type DocsListChild = DocsNodeChild & { topic: string; description: string; children?: DocsListChild[]; childCount?: number } |
import type {DocsListChild} from '@astryxdesign/cli/api' |
| + | cli |
./api · Types · type DocsListNamespace |
childCount?: number | undefined |
import type {DocsListNamespace} from '@astryxdesign/cli/api'; const x: DocsListNamespace = {childCount: …} |
| + | cli |
./api · Types · type DocsListNamespace |
children?: DocsListChild[] | undefined |
import type {DocsListNamespace} from '@astryxdesign/cli/api'; const x: DocsListNamespace = {children: …} |
| + | cli |
./api · Types · type SearchIndex |
type SearchIndex |
import type {SearchIndex} from '@astryxdesign/cli/api' |
| + | cli |
./api · Types · type SearchResultEntry |
deprecated?: ComponentDeprecation | undefined |
import type {SearchResultEntry} from '@astryxdesign/cli/api'; const x: SearchResultEntry = {deprecated: …} |
| + | cli |
./authoring · Types · interface ComponentDeprecation |
interface ComponentDeprecation |
import type {ComponentDeprecation} from '@astryxdesign/cli/authoring' |
| + | cli |
./authoring · Types · interface ComponentIconSlotDoc |
interface ComponentIconSlotDoc |
import type {ComponentIconSlotDoc} from '@astryxdesign/cli/authoring' |
| + | cli |
./authoring · Types · interface ComponentIconSlotStateDoc |
interface ComponentIconSlotStateDoc |
import type {ComponentIconSlotStateDoc} from '@astryxdesign/cli/authoring' |
| + | cli |
./authoring · Types · interface MultiComponentDoc |
deprecated?: ComponentDeprecation |
import type {MultiComponentDoc} from '@astryxdesign/cli/authoring'; const x: MultiComponentDoc = {deprecated: …} |
| + | cli |
./authoring · Types · interface SingleComponentDoc |
deprecated?: ComponentDeprecation |
import type {SingleComponentDoc} from '@astryxdesign/cli/authoring'; const x: SingleComponentDoc = {deprecated: …} |
| + | cli |
./doc · Types · interface ComponentBaseDoc |
deprecated?: ComponentDeprecation |
import type {ComponentBaseDoc} from '@astryxdesign/cli/doc'; const x: ComponentBaseDoc = {deprecated: …} |
| + | cli |
./doc · Types · interface SubComponentDoc |
deprecated?: ComponentDeprecation |
import type {SubComponentDoc} from '@astryxdesign/cli/doc'; const x: SubComponentDoc = {deprecated: …} |
| + | cli |
./doc · Also exported from an earlier entry point · ComponentDeprecation |
ComponentDeprecation (./authoring) |
import {ComponentDeprecation} from '@astryxdesign/cli/doc' |
| + | cli |
./doc · Also exported from an earlier entry point · ComponentIconSlotDoc |
ComponentIconSlotDoc (./authoring) |
import {ComponentIconSlotDoc} from '@astryxdesign/cli/doc' |
| + | cli |
./doc · Also exported from an earlier entry point · ComponentIconSlotStateDoc |
ComponentIconSlotStateDoc (./authoring) |
import {ComponentIconSlotStateDoc} from '@astryxdesign/cli/doc' |
| + | cli |
./json · Also exported from an earlier entry point · DocsListChild |
DocsListChild (./api) |
import {DocsListChild} from '@astryxdesign/cli/json' |
| + | cli |
./json · Also exported from an earlier entry point · SearchIndex |
SearchIndex (./api) |
import {SearchIndex} from '@astryxdesign/cli/json' |
| + | cli |
./template · Also exported from an earlier entry point · ComponentDeprecation |
ComponentDeprecation (./authoring) |
import {ComponentDeprecation} from '@astryxdesign/cli/template' |
| + | cli |
./template · Also exported from an earlier entry point · ComponentIconSlotDoc |
ComponentIconSlotDoc (./authoring) |
import {ComponentIconSlotDoc} from '@astryxdesign/cli/template' |
| + | cli |
./template · Also exported from an earlier entry point · ComponentIconSlotStateDoc |
ComponentIconSlotStateDoc (./authoring) |
import {ComponentIconSlotStateDoc} from '@astryxdesign/cli/template' |
| ~ | cli |
./api · Functions · function search |
function search: (query: string, options?: { cwd?: string | undefined; type?: "template" | "component" | "hook" | "theme" | "doc" | undefined; limit?: number | undefined }) => Promise<SearchResponse> → function search: (query: string, options?: { cwd?: string | undefined; type?: "template" | "component" | "doc" | "theme" | "hook" | undefined; limit?: number | undefined }) => Promise<SearchResponse> |
import {search} from '@astryxdesign/cli/api'; search(…) |
| ~ | cli |
./api · Types · type SwizzleCopyResponse |
data: { component: string; package: string; outputDir: string; filesCopied: number; files: string[]; usesStyleX: boolean; feedback?: SwizzleFeedback | undefined } → data: { component: string; package: string; outputDir: string; filesCopied: number; files: string[]; usesStyleX: boolean; dependencies: Record<string, string>; marker … #84d9505b |
import type {SwizzleCopyResponse} from '@astryxdesign/cli/api'; const x: SwizzleCopyResponse = {data: …} |
| ~ | cli |
./authoring · Types · interface MultiComponentDoc |
theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[] } → theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[]; componentIcons?: ComponentIconSlotDoc[] } |
import type {MultiComponentDoc} from '@astryxdesign/cli/authoring'; const x: MultiComponentDoc = {theming: …} |
| ~ | cli |
./authoring · Types · interface SingleComponentDoc |
theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[] } → theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[]; componentIcons?: ComponentIconSlotDoc[] } |
import type {SingleComponentDoc} from '@astryxdesign/cli/authoring'; const x: SingleComponentDoc = {theming: …} |
| ~ | cli |
./authoring · Types · type TemplateCategory |
type TemplateCategory = | 'Dashboard - Analytics' | 'Dashboard - Comparison' | 'Dashboard - KPI Summary' | 'Dashboard - Monitoring' | 'Dashboard - Executive Summary' | 'Dashboard - Sco … #e7c18378 → type TemplateCategory = | 'Dashboard - Analytics' | 'Dashboard - Comparison' | 'Dashboard - KPI Summary' | 'Dashboard - Monitoring' | 'Dashboard - Executive Summary' | 'Dashboard - Sco … #a8be998f |
import type {TemplateCategory} from '@astryxdesign/cli/authoring' |
| ~ | cli |
./doc · Types · interface ComponentBaseDoc |
theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[] } → theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[]; componentIcons?: ComponentIconSlotDoc[] } |
import type {ComponentBaseDoc} from '@astryxdesign/cli/doc'; const x: ComponentBaseDoc = {theming: …} |
| ~ | cli |
./doc · Types · interface SubComponentDoc |
theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[] } → theming?: { container?: boolean; targets: ComponentThemingTarget[]; vars?: ComponentThemingVar[]; derived?: ComponentThemingDerivedVar[]; componentIcons?: ComponentIconSlotDoc[] } |
import type {SubComponentDoc} from '@astryxdesign/cli/doc'; const x: SubComponentDoc = {theming: …} |
| + | theme-butter |
Public attributes · attr data-astryx-pressable |
attr data-astryx-pressable (public data attribute) |
[data-astryx-pressable] { … } |
| + | theme-y2k |
Public attributes · attr data-astryx-pressable |
attr data-astryx-pressable (public data attribute) |
[data-astryx-pressable] { … } |
Touched components checked; add ci:run-visual or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Changes requested: the code fix is sound, but the title and changeset claim more than the change does.
- The title and
.changeset/dropdown-menu-touch-focus-ring.mdsay a finger's tap no longer flashes the focus outline and that sub-menu focus returns changed, but a tap opens the menu through the browser's click and never reaches the changed focus call (the PR's own measurement shows 0 ringed frames for a tap onmain) and nothing shows a sub-menu ring onmain, so please describe only the hold-slide-lift case, for example "a finger's hold-slide-lift no longer flashes the focus outline on the menu button".
Keep the tap test as a regression guard, and either drop the sub-menu sentence or add a case that fails on main for it. The same change also removes a one-frame ring on a mouse press-open, which follows the interaction-modality rule; mentioning it is optional.
[Automated review]
…focus returns stay as they were
|
/approve-spec 9517e72 |
There was a problem hiding this comment.
Approved pending CI: CI is still running on this head and has not finished yet.
The press-open focus now goes through the shared focusForLastInput, which matches the interaction-modality rule that programmatic focus after pointer input shows no outline. The new Chromium spec fails on main for the hold-slide-lift case and passes here, and the tap and keyboard guards still pass. The title and changeset now describe only the case the change fixes, which resolves the earlier request.
[Automated review]
|
/approve-spec 9517e72 |
# Conflicts: # packages/core/src/DropdownMenu/DropdownMenu.tsx
There was a problem hiding this comment.
Changes requested: the focus fix itself is right, but the new Chromium spec fails on this head.
- Regression: the tap case in
DropdownMenuTouchFocusRing.a11y.chromium.spec.ts(lines 159-166) taps "Duplicate" while the menu is still entering, which DropdownMenu's entrance hold ignores since the merge ofmain, soexpect(menu).toBeHidden()times out on every run; wait for the menu's entrance to rest before the row tap, asDropdownMenuEntranceHold.interaction.browser.spec.tsdoes withwaitForRest.
The hold-slide-lift case fails on main and passes here, and the keyboard case passes on both. With that wait added, the tap case passes with no ringed frame.
[Automated review]
…ntrance rests Since main's entrance hold, the menu ignores a tap while it is still entering, so the tap case waited forever for the menu to close. The proof now waits for the entrance to rest before the row tap, as the entrance hold's own proof does.
There was a problem hiding this comment.
Approved pending CI: heavy CI (build and tests) has not run on this head yet; it runs when the pull request is marked ready or queued to merge.
The press-open focus now goes through the shared focusForLastInput, so a finger's hold-slide-lift no longer rings the menu button, and the new Chromium spec fails on main and passes here. The tap case now waits for the menu's entrance to rest before tapping a row, which fixes the timeout from the previous review, and the keyboard ring after Escape is unchanged.
[Automated review]
|
/approve-spec 096b931 |
User impact
On a phone, opening a DropdownMenu with a press-and-hold, sliding onto a row and lifting flashes the focus outline on the menu button for a frame. The outline means "keyboard focus is here", but the person used a finger. After this change, a finger's hold-slide-lift shows no outline on the button at any frame. A tap, which opens through the browser's click, already showed none and still shows none. A keyboard open and close still show the outline.
Problem and solution fit
focus(). In Chromium a script focus after a touch press matches:focus-visible, so the button painted its ring for the frame before focus moved into the menu.architecture:interaction-modalityINV1: programmatic focus keeps the current modality, so after pointer input it shows no ring. The design owner's direction is that the outline appears only with keyboard modality.Fix: that one focus move goes through the shared
focusForLastInput(utils/focusReturn.ts), which the menu's row hover and list focus already use. It passesfocusVisible: falseafter pointer or touch input and keeps the ring after keyboard input. Other focus moves in the menu are unchanged.Expected behavior and authority
architecture:interaction-modalityINV1 and INV2.Smallest restoration
DropdownMenu.tsx: the press-open focus call usesfocusForLastInput.DropdownMenuTouchFocusRing.a11y.chromium.spec.ts(new): real Chromium touch and keyboard, with the trigger sampled every frame.Evidence
Real Chromium, touch emulation at 390×844, Storybook
core-dropdownmenu--default. A per-frame recorder reads whether the button matches:focus-visiblewhile focused.mainScope
Testing
DropdownMenuTouchFocusRing.a11y.chromium.spec.ts, red first. Onmainthe hold-slide-lift case fails ("1 of 92 frames ringed the trigger"), and the tap and keyboard cases pass. Here all 3 pass.vitest run packages/core/src/DropdownMenu: 13 files pass. Two a11y DOM-layer files timed out once under machine load and pass alone (17/17).pnpm -F @astryxdesign/core typecheck, eslint, Prettier,pnpm check:changesets.