Skip to content

fix(a11y): announce copy results without toggle semantics - #429

Merged
seonghobae merged 7 commits into
developmentalfrom
palette/improve-copy-prompt-button-a11y-16476077442093139511
Aug 12, 2026
Merged

fix(a11y): announce copy results without toggle semantics#429
seonghobae merged 7 commits into
developmentalfrom
palette/improve-copy-prompt-button-a11y-16476077442093139511

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 11, 2026

Copy link
Copy Markdown

What

Improves CopyPromptButton screen-reader behavior:

  • announces the transient copy result through an aria-live="polite" status label;
  • hides decorative copy/check icons from assistive technology;
  • keeps the copy control a momentary button instead of exposing an incorrect toggle state;
  • adds regression tests for default, custom, success, timeout, failure, icon, live-region, and button semantics;
  • records the accessibility contract in the project guidance.

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-pressed values, then the implementation removed the invalid toggle semantics. Exact-head CI is the acceptance boundary.

Summary by CodeRabbit

  • 접근성 개선

    • 복사 버튼의 상태 변화를 보조 기술에 알리도록 개선했습니다.
    • 버튼의 눌림 상태와 장식용 아이콘을 적절히 전달하도록 지원합니다.
  • 테스트

    • 기본·사용자 지정 라벨, 복사 성공 및 실패 상황을 검증하는 테스트를 추가했습니다.

- `CopyPromptButton`의 동적 텍스트를 `<span aria-live="polite">`로 감싸 스크린 리더에서 실시간 상태 변화를 알 수 있도록 수정.
- 장식용 아이콘(`<Copy>`, `<Check>`)에 `aria-hidden="true"`를 추가하여 스크린 리더 중복 낭독 방지.
- `<Button>`에 `aria-pressed={copied}` 속성을 추가하여 토글 상태를 명확히 함.
- 관련 테스트 코드 작성 및 100% 커버리지 달성.
@google-labs-jules

Copy link
Copy Markdown

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0c3e18a7-bc83-47b2-88d5-d0c40e11a107

📥 Commits

Reviewing files that changed from the base of the PR and between 95605a1 and ce042bb.

📒 Files selected for processing (1)
  • packages/web/src/components/copy-prompt-button.test.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/web/src/components/copy-prompt-button.test.tsx

📝 Walkthrough

Walkthrough

CopyPromptButton이 복사 상태를 aria-pressed로 알리고 상태별 레이블을 aria-live="polite"로 전달합니다. 장식용 아이콘을 접근성 트리에서 제외합니다. 렌더링, 성공·실패 상태, 타이머 동작을 테스트합니다.

Changes

CopyPromptButton 접근성 개선

Layer / File(s) Summary
접근성 상태와 동작 검증
packages/web/src/components/copy-prompt-button.tsx, packages/web/src/components/copy-prompt-button.test.tsx, .Jules/palette.md
버튼이 aria-pressed로 복사 상태를 노출합니다. 상태별 레이블을 aria-live="polite" 영역에서 업데이트합니다. 장식용 아이콘에 aria-hidden="true"를 적용합니다. 복사 성공·실패와 2초 후 상태 복귀를 테스트하고 접근성 지침을 문서화합니다.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 복사 결과를 알리고 토글 의미를 제거하는 접근성 변경을 정확하고 간결하게 설명합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch palette/improve-copy-prompt-button-a11y-16476077442093139511

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between dfe4767 and 95605a1.

📒 Files selected for processing (3)
  • .Jules/palette.md
  • packages/web/src/components/copy-prompt-button.test.tsx
  • packages/web/src/components/copy-prompt-button.tsx

Comment thread packages/web/src/components/copy-prompt-button.test.tsx Outdated
@seonghobae seonghobae changed the title 🎨 Palette: CopyPromptButton 접근성 개선 fix(a11y): announce copy results without toggle semantics Aug 11, 2026
seonghobae and others added 2 commits August 11, 2026 23:27
- `CopyPromptButton`의 동적 텍스트를 `<span aria-live="polite">`로 감싸 스크린 리더에서 실시간 상태 변화를 알 수 있도록 수정.
- 장식용 아이콘(`<Copy>`, `<Check>`)에 `aria-hidden="true"`를 추가하여 스크린 리더 중복 낭독 방지.
- `<Button>`에 `aria-pressed={copied}` 속성을 추가하여 토글 상태를 명확히 함.
- 관련 테스트 코드에서 `aria-pressed`의 속성 값이 불리언이 아닌 문자열 `'true'` / `'false'`로 렌더링되도록 테스트 코드 버그를 수정하여 CI 실패 해결.
@seonghobae
seonghobae merged commit 5558496 into developmental Aug 12, 2026
29 checks passed
@seonghobae
seonghobae deleted the palette/improve-copy-prompt-button-a11y-16476077442093139511 branch August 12, 2026 02:05
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