๐จ Palette: [UX improvement] Add ARIA disabled state to editor save button - #577
๐จ Palette: [UX improvement] Add ARIA disabled state to editor save button#577seonghobae wants to merge 1 commit into
Conversation
โฆtton ๋ค์ดํฐ๋ธ `disabled` ์์ฑ์ ์ฌ์ฉํ ๊ฒฝ์ฐ ๋ฒํผ์ด ํญ ์ด๋ ์์์์ ์ ์ธ๋์ด, ํผ ์ ํจ์ฑ ๊ฒ์ฌ ์คํจ ์ ํ๋ฉด ํ๋ ๊ธฐ ์ฌ์ฉ์๊ฐ ๋ฒํผ์ด ๋นํ์ฑํ๋ ์ด์ (ํดํ ๋ฑ)๋ฅผ ํ์ ํ๊ธฐ ์ด๋ ค์ด ์ ๊ทผ์ฑ ๋ฌธ์ ๊ฐ ์์์ต๋๋ค. ์ด๋ฅผ ๊ฐ์ ํ๊ธฐ ์ํด ์ ๋ ๋ค์๊ณผ ๊ฐ์ด ์์ ํ์ต๋๋ค: - ์ ์ฅ ๋ฒํผ์ `disabled` ์์ฑ ๋์ `aria-disabled="true"`๋ฅผ ์ฌ์ฉํ๋๋ก ๋ณ๊ฒฝํ์ฌ ํฌ์ปค์ค ๊ฐ๋ฅ ์ํ๋ฅผ ์ ์งํ์ต๋๋ค. - ๋ฒํผ์ด `aria-disabled="true"`์ธ ์ํ์์ ํด๋ฆญํ๊ฑฐ๋ ์ํฐ๋ฅผ ๋๋ฌ ํผ์ด ์ ์ถ๋ ๋, ๋ค์ดํฐ๋ธ HTML5 ์ ํจ์ฑ ๊ฒ์ฌ ํ์ ์ด ๋จ๊ฑฐ๋ ์ก์ ์ด ์คํ๋์ง ์๋๋ก ํด๋ฆญ ๋ฐ ํผ ์ ์ก ์ด๋ฒคํธ์ ๋ฐฉ์ด ๋ก์ง(`event.preventDefault()`)์ ์ถ๊ฐํ์ต๋๋ค. - E2E ํ ์คํธ์์ ๋ฐ์ํ๋ `modulepreload` ๋๋ฝ ๋ฌธ์ ๋ฅผ ์์ ํ์ต๋๋ค. - `.jules/palette.md` ํ์ผ์ ์ด๋ฒ ์ ๊ทผ์ฑ ๊ฐ์ ์ ํตํด ์ป์ ๋ฐฐ์์ ๊ธฐ๋กํด ๋์์ต๋๋ค.
|
๐ 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. |
|
Warning Review limit reached
Next review available in: 42 minutes Limit details: Youโve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review detailsโ๏ธ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ๐ Files selected for processing (3)
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 |
| const saveButton = event.target.closest('button[type="submit"]'); | ||
| if (saveButton && saveButton.getAttribute('aria-disabled') === 'true') { | ||
| event.preventDefault(); | ||
| return; | ||
| } |
There was a problem hiding this comment.
๐ก Native browser validation popup still appears when clicking the disabled save button
The guard meant to swallow clicks on the disabled save button (event.target.closest('button[type="submit"]') at app.js:404-408) is placed after an early return that only continues for rows carrying a task id, but the editor form sits in a row without one, so the guard never runs and the browser's native validation bubble pops up on click.
Impact: A user who clicks the greyed-out save button while required fields are invalid sees the native browser validation popup, the exact jarring behavior this change set out to eliminate.
Why the click guard is unreachable
The click listener starts with const row = event.target.closest('tr[data-task-id]'); if (!row) return; (app.js:387-390). The editor form is rendered inside renderEditorRow, whose <tr> gets row.dataset.editorAnchor = anchorId (app.js:797) and is a sibling of task rows, not a descendant. Task rows are the only ones with data-task-id (app.js:687). Therefore, when the save button is clicked, closest('tr[data-task-id]') returns null, the handler returns at line 389, and the new block at app.js:404-408 never executes. Because the click's default action is not prevented, the browser runs constraint validation for required fields (set at app.js:887) and shows the native popup before any submit event is dispatched. The submit-event guard at app.js:439-442 cannot help here because constraint-validation failure suppresses the submit event entirely. Previously the native disabled attribute made the click a no-op, so this is a regression against the PR's goal.
Prompt for agents
The click guard added in bindTableEvents (app.js:404-408) that calls event.preventDefault() when the submit button has aria-disabled="true" is never reached. The tableBody click handler returns early at app.js:387-390 whenever event.target has no ancestor tr[data-task-id]. The editor form's row is created in renderEditorRow with row.dataset.editorAnchor (app.js:797) and has no data-task-id, so clicks on the save button hit the early return before reaching the guard. As a result, clicking the aria-disabled save button is not prevented at the click level, and the browser's native constraint-validation popup (for required fields set at app.js:887) still appears โ defeating the purpose of the change. Fix by relocating the save-button aria-disabled check to run before the `if (!row) return` early return at the top of the click handler (or otherwise ensure the guard executes for clicks originating inside the editor row), so event.preventDefault() is called on the click before the browser attempts form submission.
Was this helpful? React with ๐ or ๐ to provide feedback.
|
Closing as superseded by the existing canonical editor-validation lane #468 after exact semantic comparison against current The overlap is complete for the valuable buyer surface ( No unique product behavior from this branch needs to be preserved separately. The |
Understood. Acknowledging that this work is superseded by #468 and stopping work on this task. I will not push any further updates to this branch. |
๋ค์ดํฐ๋ธ
disabled์์ฑ์ ์ฌ์ฉํ ๊ฒฝ์ฐ ๋ฒํผ์ด ํญ ์ด๋ ์์์์ ์ ์ธ๋์ด, ํผ ์ ํจ์ฑ ๊ฒ์ฌ ์คํจ ์ ํ๋ฉด ํ๋ ๊ธฐ ์ฌ์ฉ์๊ฐ ๋ฒํผ์ด ๋นํ์ฑํ๋ ์ด์ (ํดํ ๋ฑ)๋ฅผ ํ์ ํ๊ธฐ ์ด๋ ค์ด ์ ๊ทผ์ฑ ๋ฌธ์ ๊ฐ ์์์ต๋๋ค.์ด๋ฅผ ๊ฐ์ ํ๊ธฐ ์ํด:
disabled์์ฑ ๋์aria-disabled="true"๋ฅผ ์ฌ์ฉํ๋๋ก ๋ณ๊ฒฝํ์ฌ ํฌ์ปค์ค ๊ฐ๋ฅ ์ํ๋ฅผ ์ ์งํ์ต๋๋ค.aria-disabled="true"์ธ ์ํ์์ ํด๋ฆญํ๊ฑฐ๋ ์ํฐ๋ฅผ ๋๋ฌ ํผ์ด ์ ์ถ๋ ๋, ๋ค์ดํฐ๋ธ HTML5 ์ ํจ์ฑ ๊ฒ์ฌ ํ์ ์ด ๋จ๊ฑฐ๋ ์ก์ ์ด ์คํ๋์ง ์๋๋กclick๋ฐsubmit์ด๋ฒคํธ์ ๋ฐฉ์ด ๋ก์ง(event.preventDefault())์ ์ถ๊ฐํ์ต๋๋ค.modulepreload๋๋ฝ ๋ฌธ์ ๋ฅผ ์์ ํ์ต๋๋ค..jules/palette.mdํ์ผ์ ์ ๊ทผ์ฑ ๊ฐ์ ์ ๋ํ ๋ฐฐ์์ ๊ธฐ๋กํ์ต๋๋ค.PR created automatically by Jules for task 5071278339747262059 started by @seonghobae