Skip to content

feat(frontend): 접근성 - 모달 포커스 복귀, 화면 이동 포커스, 움직임 줄이기 - #200

Merged
sunwoo162 merged 2 commits into
developfrom
sunwoo162/a11y-focus-motion
Nov 28, 2026
Merged

sunwoo162 merged 2 commits into
developfrom
sunwoo162/a11y-focus-motion

Conversation

@sunwoo162

Copy link
Copy Markdown
Collaborator

개요

코드 감사에서 나온 접근성 항목 중 디자인을 바꾸지 않는 것들입니다.

변경 사항

모달을 닫으면 원래 위치로 포커스 복귀

  • 네이티브 <dialog>를 띄우는 곳은 shared/ui/feedback/ModalSurface와 앱 화면의 Modal(pages/apps/DemoAppDialog.tsx) 두 곳입니다. 둘 다 닫히면 포커스가 BODY로 가서 키보드나 스크린 리더 사용자가 위치를 잃었습니다.
  • 열기 전 포커스가 있던 요소를 기억했다가 닫힐 때 돌려주도록 고쳤습니다.
  • 확인: 앱 설정에서 「환경 추가」를 Enter로 열고 Esc로 닫으면, 전에는 BODY였고 이제는 BUTTON "환경 추가"로 돌아갑니다.
  • 자체 구현 대화상자(VM 네트워크 등)는 useOverlayDismiss가 이미 같은 처리를 하고 있어 측정에서도 문제가 없었습니다.

화면 이동 시 새 화면 제목으로 포커스 (shared/lib/useRouteFocus)

  • SPA라 화면이 바뀌어도 스크린 리더에 알림이 없었습니다.
  • 경로가 바뀌면(첫 진입 제외) 새 화면의 첫 h1로 포커스를 옮깁니다. 화면 코드나 목데이터가 늦게 오면 최대 3초 기다립니다. 대화상자가 열려 있거나 사용자가 이미 다른 곳으로 포커스를 옮겼으면 건드리지 않습니다.
  • 이 포커스에는 테두리를 그리지 않아 화면은 그대로입니다.
  • 확인: 홈 첫 진입은 BODY, Apps로 이동하면 H1 "Apps", outline은 none입니다.

움직임 줄이기

  • OS에서 움직임 줄이기를 켠 사용자에게는 애니메이션과 전환 효과를 사실상 끕니다(prefers-reduced-motion: reduce). 전에는 일부 컴포넌트에만 적용돼 있었습니다.

FSD

  • useOverlayDismiss를 pages/vm에서 shared/lib로 옮겼습니다. VM 네트워크 페이지가 다른 페이지 slice 내부를 import하던 경로 하나가 없어졌습니다.

확인

  • npm run check, 전체 화면 e2e 통과
  • 로컬 시각 회귀 통과: develop 빌드와 69개 화면 바이트 동일, 기본 상태의 화면 변화 없음

🤖 Generated with Claude Code

@vercel

vercel Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
gsmsv-client-v2 Ready Ready Preview Nov 28, 2026 5:14pm UTC
gsmsv-client-v2-main Ready Ready Preview Nov 28, 2026 5:14pm UTC

@sandrone-code-review

sandrone-code-review Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Pull Request 요약

router.tsx에서 useRouteFocus 훅을 import하고 AppRoot 컴포넌트에서 호출하도록 추가하여 라우트 전환 시 h1 요소에 포커스를 이동하도록 했습니다. useOverlayDismiss를 shared/lib 디렉터리로 이동하고 해당 경로로 import를 수정했으나, index에서 재export되지 않아 컴파일 오류가 발생할 가능성이 있습니다. 모달 닫힘 시 이전 포커스로 복귀하고, prefers‑reduced‑motion을 적용했으며, VM 설정·스냅샷 페이지의 import 경로를 새로운 위치에 맞게 업데이트했습니다.

복수 모델 · 입력 62,299 · 출력 8,011 · 합계 70,310 토큰

import { VmUnavailablePage } from '../vm/VmUnavailablePage';
import { findDeletedDemoVm } from '../vm/vmDemoHelpers';
import { useOverlayDismiss } from '../vm/useOverlayDismiss';
import { useOverlayDismiss } from '../../shared/lib';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

중요 useOverlayDismiss import 경로 누락

import 구문이 '../../shared/lib' 폴더를 가리키지만, 현재 index.ts에 useOverlayDismiss가 재export되지 않아 모듈을 찾을 수 없습니다. 이는 빌드 단계에서 'Module not found' 오류를 일으켜 애플리케이션이 정상 동작하지 못하게 합니다.

제안:

import { useOverlayDismiss } from '../../shared/lib/useOverlayDismiss';

복수 모델

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 PR에서 src/shared/lib/index.ts에 export { useOverlayDismiss } from './useOverlayDismiss';를 추가했습니다(같은 PR의 useOverlayDismiss.ts 이동과 함께). npm run typecheck, vite build, CI(typecheck·e2e·시각 회귀) 모두 통과해 모듈 해석 문제는 없습니다. 공개 API(index)로 import하는 게 FSD 규칙이라 경로는 그대로 둡니다.

Comment thread src/shared/lib/useRouteFocus.ts Outdated

useEffect(() => {
if (firstRender.current) {
firstRender.current = false;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

경미 StrictMode에서 첫 진입에도 포커스가 이동함','title':'StrictMode에서 첫 진입에도 포커스가 이동함

firstRender ref는 effect가 실행될 때마다 첫 호출만 건너뛴다. React StrictMode(개발 빌드)에서는 마운트 직후 effect가 한 번 더 실행되므로, 첫 진입에서도 두 번째 실행이 포커스 이동 로직을 타서 h1로 포커스가 옮겨진다. 운영 빌드에서는 재현되지 않는다. 확인된 사실은 ref 가드가 StrictMode 이중 실행을 막지 못한다는 점이다. 이 파일 밖의 StrictMode 설정은 확인하지 못했다.

복수 모델

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

d919757에서 반영했습니다. src/main.tsx가 StrictMode를 씁니다. 첫 렌더 플래그 대신 마지막으로 처리한 경로를 기억해서, 경로가 같으면(첫 진입과 StrictMode 재실행) 건너뜁니다.

sunwoo162 and others added 2 commits November 29, 2026 02:13
- 네이티브 <dialog> 모달(ModalSurface, 앱 화면 Modal)이 닫히면 열기 전 포커스 위치로 돌려줌
  (전에는 BODY로 가서 키보드 사용자가 위치를 잃었다)
- 화면 이동 시(첫 진입 제외) 새 화면 h1로 포커스를 옮겨 스크린 리더가 새 화면을 알리게 함
- prefers-reduced-motion: reduce 사용자에게 애니메이션·전환 효과를 끔
- useOverlayDismiss를 pages/vm에서 shared/lib로 옮김(페이지 간 import 제거)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sunwoo162
sunwoo162 force-pushed the sunwoo162/a11y-focus-motion branch from f98ee05 to d919757 Compare November 28, 2026 17:14
@sunwoo162
sunwoo162 merged commit f882297 into develop Nov 28, 2026
6 checks passed
@sunwoo162
sunwoo162 deleted the sunwoo162/a11y-focus-motion branch November 28, 2026 17:18
sunwoo162 added a commit that referenced this pull request Nov 29, 2026
Co-authored-by: sunwoo162 <205418898+sunwoo162@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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