Skip to content

๐ŸŽจ Palette: Accessible Disabled State for Save Project Button#629

Open
seonghobae wants to merge 2 commits into
developfrom
ux/accessible-disabled-buttons-4421559010746020837
Open

๐ŸŽจ Palette: Accessible Disabled State for Save Project Button#629
seonghobae wants to merge 2 commits into
developfrom
ux/accessible-disabled-buttons-4421559010746020837

Conversation

@seonghobae

Copy link
Copy Markdown
Collaborator

๐Ÿ’ก What

  • App.tsx์—์„œ 'Save Project' ๋ฒ„ํŠผ์˜ ๋น„ํ™œ์„ฑํ™” ์ƒํƒœ๋ฅผ ์ฒ˜๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉํ•˜๋˜ span ํƒœ๊ทธ ๋ž˜ํผ๋ฅผ ์ œ๊ฑฐํ–ˆ์Šต๋‹ˆ๋‹ค.
  • ๋Œ€์‹  <Button> ์ปดํฌ๋„ŒํŠธ์— ์ง์ ‘ aria-disabled="true"๋ฅผ ์ ์šฉํ•˜๊ณ  onClick={(e) => e.preventDefault()}๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ด๋ฒคํŠธ๋ฅผ ์ฐจ๋‹จํ–ˆ์Šต๋‹ˆ๋‹ค.
  • components/ui/button.tsx์˜ buttonVariants์— aria-disabled: Tailwind variant๋ฅผ ์ถ”๊ฐ€ํ•˜์—ฌ ๋„ค์ดํ‹ฐ๋ธŒ disabled์™€ ๋™์ผํ•œ ์‹œ๊ฐ์  ์Šคํƒ€์ผ์„ ๊ฐ–๋„๋ก ํ–ˆ์Šต๋‹ˆ๋‹ค.
  • App.test.tsx์— ์ด aria-disabled ๋ฒ„ํŠผ์ด ํด๋ฆญ ์ด๋ฒคํŠธ๋ฅผ ์ œ๋Œ€๋กœ ๋ฐฉ์ง€ํ•˜๋Š”์ง€ ํ™•์ธํ•˜๋Š” ํ…Œ์ŠคํŠธ๋ฅผ ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค.

๐ŸŽฏ Why

  • ์ด์ „ ๋ฐฉ์‹(span ๋ž˜ํผ)์€ ์Šคํฌ๋ฆฐ ๋ฆฌ๋”์™€ ํ‚ค๋ณด๋“œ ์‚ฌ์šฉ์ž์—๊ฒŒ ์œ ํšจํ•˜์ง€ ์•Š์€ ์ค‘์ฒฉ๋œ ์ƒํ˜ธ ์ž‘์šฉ ์š”์†Œ๋กœ ํ˜ผ๋ž€์„ ์ค„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • ์ƒˆ๋กœ์šด ๋ฐฉ์‹์€ ํฌ์ปค์Šค๋ฅผ ๋ฐ›์„ ์ˆ˜ ์žˆ์œผ๋ฉด์„œ ํด๋ฆญ ์ƒํ˜ธ์ž‘์šฉ์€ ์ฐจ๋‹จํ•˜๋Š” ์˜ฌ๋ฐ”๋ฅธ ์ ‘๊ทผ์„ฑ(A11y) ํŒจํ„ด์„ ๋”ฐ๋ฅด๋ฉฐ, React Testing Library ํ…Œ์ŠคํŠธ ๋ฐ ์‹ค์ œ ์Šคํฌ๋ฆฐ ๋ฆฌ๋”์—์„œ ์ผ๊ด€๋œ ๋™์ž‘์„ ๋ณด์žฅํ•ฉ๋‹ˆ๋‹ค.

โ™ฟ Accessibility

  • ๋น„ํ™œ์„ฑ ์ƒํƒœ ๋ฒ„ํŠผ์˜ ํ‚ค๋ณด๋“œ ํƒญ ์ˆœ์„œ(Focus)์™€ title ํˆดํŒ ํ‘œ์‹œ ๊ธฐ๋Šฅ์„ ์ •์ƒ์ ์œผ๋กœ ๋ณด์žฅํ•˜๋ฉฐ DOM ๊ตฌ์กฐ๋ฅผ ์‹œ๋งจํ‹ฑํ•˜๊ฒŒ ์œ ์ง€ํ–ˆ์Šต๋‹ˆ๋‹ค.

PR created automatically by Jules for task 4421559010746020837 started by @seonghobae

Replaces the invalid `span role="button"` wrapper around the disabled
Save Project button in `App.tsx`. Uses `aria-disabled="true"` directly
on the `<Button>` component and prevents click events manually.

Adds `aria-disabled:` variants to the generic `Button` component in
`components/ui/button.tsx` to handle identical styling to the native
`disabled` attribute. Includes an interaction test to verify disabled
click prevention.
@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.

Replaces the invalid `span role="button"` wrapper around the disabled
Save Project button in `App.tsx`. Uses `aria-disabled="true"` directly
on the `<Button>` component and prevents click events manually.

Adds `aria-disabled:` variants to the generic `Button` component in
`components/ui/button.tsx` to handle identical styling to the native
`disabled` attribute. Includes an interaction test to verify disabled
click prevention.
@opencode-agent

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: 7deafd41e8b47bdc8d139b5aeff9e66e340abdbd
  • Workflow run: 29139779529
  • Workflow attempt: 1
  • Gate result: APPROVE (exit 0)

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (4 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (4 files)"]
  R1 --> V1["required checks"]
Loading

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