Repository navigation
fix(platform): focus task dialogs when they open - #3562
Conversation
yannickmonney
left a comment
There was a problem hiding this comment.
Reviewed 8d2e9d4a4397e657023462856655e4ab10e7231d and independently exercised the exact task-modal source in a separate localhost frontend (with #3559's list opener source).
Observed in the full local app: Board Enter focuses the dialog container, Tab reaches Title, Shift+Tab wraps to Close, and Escape restores the original card. List keyboard opening and restoration also work. At 390×844 the real mobile drawer gets initial focus, Tab reaches Title, Escape restores the task title, and there is no document horizontal overflow. The copied task-modal source checksum matches this PR head. No production testing.
The source change is confined to the existing dialog focus contract; create mode keeps its autofocus. The regression suite covers loading, warm/deep-linked dialogs and the actual mobile breakpoint rather than the previous ineffective media-query mock. No remaining defect found in this focused review.
Full-gate acceptance is still pending the pinned Bun 1.4.2 rerun/CI. The two initially failing runtime files now pass with that runtime; this comment does not convert the interrupted full check into a green check. No merge performed.
Opening an existing task cancelled Radix autofocus without moving focus anywhere. The board card stayed focused behind the modal, so Tab could reach background controls. Explicitly focus the dialog container using the existing shared-dialog contract; Radix retains trapping and opener restoration, while creation still focuses the title.
Add real-Chromium coverage for desktop/mobile keyboard entry, both Tab directions, Escape restoration, loading-to-loaded and warm openings, deep links, pointer-opened list rows, and create-title autofocus. Correct the shared dialog tests to select the actual mobile breakpoint.
Validation:
services/platform/messages/en.yml. Focused changed-file scan passes.bun run checkunder pinned Bun 1.4.2 withTURBO_CONCURRENCY=1: 55/55 tasks pass (45 cached), unchanged source. The preceding concurrency-2 run was 54/55, with 9 timing-related UI failures in 6 files; a one-worker rerun of those files passed 167/167 before the full green rerun. No timeout changes.Fixes #3557