fix(a11y): announce copy results without toggle semantics - #429
Conversation
- `CopyPromptButton`의 동적 텍스트를 `<span aria-live="polite">`로 감싸 스크린 리더에서 실시간 상태 변화를 알 수 있도록 수정.
- 장식용 아이콘(`<Copy>`, `<Check>`)에 `aria-hidden="true"`를 추가하여 스크린 리더 중복 낭독 방지.
- `<Button>`에 `aria-pressed={copied}` 속성을 추가하여 토글 상태를 명확히 함.
- 관련 테스트 코드 작성 및 100% 커버리지 달성.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesCopyPromptButton 접근성 개선
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/web/src/components/copy-prompt-button.test.tsx`:
- Around line 42-43: Update the CopyPromptButton tests to expect
aria-pressed="false" during initial, failed-copy, and post-timeout states, and
aria-pressed="true" after a successful copy. Apply these assertions to the
referenced test cases and also verify the dynamic label element has
aria-live="polite", while preserving the existing text assertions.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f0bd950d-494e-42d2-9576-0ab2ff6ae406
📒 Files selected for processing (3)
.Jules/palette.mdpackages/web/src/components/copy-prompt-button.test.tsxpackages/web/src/components/copy-prompt-button.tsx
- `CopyPromptButton`의 동적 텍스트를 `<span aria-live="polite">`로 감싸 스크린 리더에서 실시간 상태 변화를 알 수 있도록 수정.
- 장식용 아이콘(`<Copy>`, `<Check>`)에 `aria-hidden="true"`를 추가하여 스크린 리더 중복 낭독 방지.
- `<Button>`에 `aria-pressed={copied}` 속성을 추가하여 토글 상태를 명확히 함.
- 관련 테스트 코드에서 `aria-pressed`의 속성 값이 불리언이 아닌 문자열 `'true'` / `'false'`로 렌더링되도록 테스트 코드 버그를 수정하여 CI 실패 해결.
…a11y-16476077442093139511
What
Improves
CopyPromptButtonscreen-reader behavior:aria-live="polite"status label;Why
The visual icon and label changed after a successful copy without a reliable announcement. The original patch also used
aria-pressed, which is reserved for toggle buttons and misrepresented this one-shot action.Verification
The tests first failed on the committed
aria-pressedvalues, then the implementation removed the invalid toggle semantics. Exact-head CI is the acceptance boundary.Summary by CodeRabbit
접근성 개선
테스트