π¨ Palette: Add semantic disabled styles and event guards for async loading states - #1079
π¨ Palette: Add semantic disabled styles and event guards for async loading states#1079seonghobae wants to merge 1 commit into
Conversation
β¦ading states This commit adds semantic disabled styling (`opacity: 0.7; pointer-events: none;`) to elements with `button:disabled` and `[aria-busy="true"]`. It also adds explicit event guards to the `.scan` row click and keydown handlers in `scanner/dashboard/console.html` to prevent multiple overlapping requests when a row is already in a busy/loading state, fixing an issue where users could rapidly click/press enter on rows.
|
π 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 reachedNext included review available in 33 minutes. View limit detailsLimit 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. Review configuration: βοΈ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team 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 |
| tr.onclick=()=>detail(tr.dataset.id,tr); | ||
| tr.addEventListener('keydown', e => { if(e.key === 'Enter' || e.key === ' ') { e.preventDefault(); detail(tr.dataset.id,tr); } }); | ||
| tr.onclick=()=>{ if(tr.getAttribute("aria-busy") === "true") return; detail(tr.dataset.id,tr); }; | ||
| tr.addEventListener('keydown', e => { if(tr.getAttribute('aria-busy') === 'true') return; if(e.key === 'Enter' || e.key === ' ') { e.preventDefault(); detail(tr.dataset.id,tr); } }); |
There was a problem hiding this comment.
π‘ Busy rows scroll unexpectedly
Pressing Space on a busy row returns before preventDefault(), so the page scrolls instead of ignoring the repeated activation.
| tr.addEventListener('keydown', e => { if(tr.getAttribute('aria-busy') === 'true') return; if(e.key === 'Enter' || e.key === ' ') { e.preventDefault(); detail(tr.dataset.id,tr); } }); | |
| tr.addEventListener('keydown', e => { if(e.key === 'Enter' || e.key === ' ') { e.preventDefault(); if(tr.getAttribute('aria-busy') === 'true') return; detail(tr.dataset.id,tr); } }); |
Was this helpful? React with π or π to provide feedback.
π‘ What:
scanner/dashboard/console.htmlμμbutton:disabledλ°[aria-busy="true"]μμ±μ΄ νμ±νλ μνμ μμλ€μ μκ°μ μΌλ‘ λΉνμ±νλμμμ λͺ νν 보μ¬μ£ΌκΈ° μν΄ CSS μμ±(opacity: 0.7; pointer-events: none;)μ μΆκ°νμ΅λλ€. λν,tr.scanμμμ μ΄λ²€νΈ 리μ€λ(ν΄λ¦ λ° μν°/μ€νμ΄μ€ ν€λ³΄λ μ΄λ²€νΈ)μaria-busyμμ±μ νμΈνλ κ°λλ₯Ό μΆκ°νμ¬, λ°μ΄ν°κ° λ‘λ© μ€μΌ λ μ€λ³΅μΌλ‘ μμΈ μ 보λ₯Ό μμ²νμ§ μλλ‘ κ°μ νμ΅λλ€.π― Why: κΈ°μ‘΄μλ λ‘λ© μνκ° μκ°μ μΌλ‘λ§ νμλκ³ (νΉμ μκ°μ νΌλλ°±μ΄ λΆμ‘±νκ³ ) μ΄λ²€νΈλ κ³μ λ°μν μ μμ΄, μ¬μ©μκ° λΉ λ₯΄κ² μ¬λ¬ λ² ν΄λ¦νκ±°λ ν€λ₯Ό λλ₯Ό κ²½μ° λΆνμν λ€νΈμν¬ μμ²μ΄ μ€λ³΅μΌλ‘ λ°μν μ μμμ΅λλ€. μ΄λ₯Ό λ°©μ§νκ³ λ λ§€λλ¬μ΄ UXλ₯Ό μ 곡νκΈ° μν¨μ λλ€.
βΏ Accessibility:
pointer-events: noneμ λ§μ°μ€ μ΄λ²€νΈλ§ λ§μμ£ΌκΈ° λλ¬Έμ, ν€λ³΄λ μ΄λ²€νΈ(μν°/μ€νμ΄μ€λ°)λ₯Ό μ¬μ©νλ μ€ν¬λ¦° 리λ/ν€λ³΄λ μ¬μ©μλ μ€λ³΅ μ‘μ μ μ·¨νμ§ μλλ‘ JavaScript μ΄λ²€νΈ κ°λλ₯Ό ν΅ν΄ λμΌν λ‘μ§μ΄ μ μ©λλλ‘ λ³΄μ₯νμ΅λλ€.opacity: 0.7)μ ν΅ν΄ μκ°μ μΈ νΌλλ°±μ μ 곡νμ¬, νμ¬ μ‘μ μ΄ μ§ν μ€μμ λͺ νν μΈμ§ν μ μκ² νμ΅λλ€.PR created automatically by Jules for task 4461649168773865251 started by @seonghobae