Skip to content

fix(ui): modal に focus trap を足し、SuccessOverlay の focus 奪取を直す (B-R11f・a11y) - #652

Merged
cipherwebllc merged 1 commit into
mainfrom
fix/r6-b-r11f-modal-focus-trap
Sep 25, 2026
Merged

cipherwebllc merged 1 commit into
mainfrom
fix/r6-b-r11f-modal-focus-trap

Conversation

@cipherwebllc

Copy link
Copy Markdown
Owner

概要

B-R11e (#639) の follow-up (計画 B-R11f)。a11y の修正で money-path は不変。

変更

  • lib/trapModalFocus.ts (新規): Tab / Shift+Tab を DOM 順で自前制御 (Safari 既定の Tab 設定でも循環)・一覧外の active (disabled 化等) は DOM 位置から直後/直前・focusable が無ければ dialog に留める・IME (isComposing / keyCode 229) は奪わない・visibility は要素自身の computed 値・display:none と inert は祖先を遡る。対応範囲 (contenteditable / iframe / media[controls] / area は対象外) をコメントに明記。
  • QrPreviewModal / CsvPassModal / SuccessOverlay に適用。Escape・初期 focus・閉じた後の復元は fix(ui): 共通 modal が親の再描画ごとに dialog へ focus を戻すのを modal 側で直し、閉じたら元の要素に戻す (B-R11e) #639 の契約のまま。
  • SuccessOverlay: inline onDismiss に依存する focus effect を latest-ref・mount 時のみ focus・guard 付き復元に (TipForm / CheckoutForm / PaymentForm からの再描画で focus を奪わない)。aria-live は毎秒更新の時計を含む dialog 全体から見出しだけに限定し、aria-labelledby で可視見出しから名前を導く (掟 8)。
  • QrGenerator の不要な useCallback とコメントを整理。
  • 対象外: FX 期限切れの modal 内表示 (文言に承認が要る・計画 (3))。

レビュー

Codex 実装 → Opus レビュー (修正必須なし・中 2 = SuccessOverlay にも trap / 自前の Tab 順・軽 4・既存 a11y 2 件) → 全て反映 → Fable 監査: typecheck / eslint / modal・overlay・form 系 8 file 688 件 pass・next build + bundle 予算 OK。full vitest は Codex 実行で pass。

🤖 Generated with Claude Code

https://claude.ai/code/session_01HeizmagJBgL5peL5mQpxkc

@vercel

vercel Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
openpay Ignored Ignored Preview Sep 25, 2026 4:47am UTC

Request Review

…a11y)

B-R11e (#639) の follow-up。
- lib/trapModalFocus.ts (新規): Tab/Shift+Tab を DOM 順で自前制御 (Safari 既定の Tab 設定でも循環)・
  一覧外の active (disabled 化等) は DOM 位置から直後/直前・focusable が無ければ dialog に留める・
  IME (isComposing / 229) は奪わない・visibility は要素自身の computed 値・display:none と inert は祖先を遡る。
- QrPreviewModal / CsvPassModal / SuccessOverlay に trap を適用。Escape・初期 focus・閉じた後の復元は
  #639 の契約のまま。
- SuccessOverlay: inline onDismiss に依存する focus effect を latest-ref・mount 時のみ focus・guard 付き復元に
  (TipForm/CheckoutForm/PaymentForm からの再描画で focus を奪わない)。aria-live は毎秒更新の時計を含む
  dialog 全体から見出しに限定し、aria-labelledby で可視見出しから名前を導く (掟 8)。
- QrGenerator の不要な useCallback とコメントを整理。FX 期限切れの modal 内表示 (文言要) は対象外。
tests: ModalFocusTrap (Tab 循環・一覧外 active・除外判定)・SuccessOverlay の再描画で focus 不動。

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HeizmagJBgL5peL5mQpxkc
@cipherwebllc
cipherwebllc force-pushed the fix/r6-b-r11f-modal-focus-trap branch from c591343 to bb0ef71 Compare September 25, 2026 04:47
@cipherwebllc
cipherwebllc merged commit 6f111c8 into main Sep 25, 2026
8 checks passed
@cipherwebllc
cipherwebllc deleted the fix/r6-b-r11f-modal-focus-trap branch September 25, 2026 05:15
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