🎨 Palette: Improve accessibility for PriorityTaskRow#518
Conversation
- Added `role="button"` and `tabindex="0"` to the task title span. - Added `aria_label` with the task title for better screen reader context. - Added `onkeydown` handler to support activating the title with `Enter` or `Space` keys. - Cloned task ID for the `onkeydown` closure to ensure thread safety. This change ensures that keyboard users and screen readers can interact with the task title on the Work page, matching the accessibility pattern used in the Plan page. Co-authored-by: matta <37314+matta@users.noreply.github.com>
|
👋 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. |
|
Merging to
|
Summary of ChangesHello @matta, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly improves the accessibility of the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request improves accessibility for PriorityTaskRow by making the task title keyboard-focusable and interactive. The changes are generally good, adding the necessary ARIA attributes and an onkeydown handler. However, I found a bug in the onkeydown handler where the check for the spacebar key is incorrect, which would prevent it from working as intended. I've provided a suggestion to fix this bug and also improve the code's clarity.
| onkeydown: move |evt: KeyboardEvent| { | ||
| if evt.key() == Key::Enter || evt.key() == Key::Character(" ".to_string()) { | ||
| if evt.key() == Key::Character(" ".to_string()) { | ||
| evt.prevent_default(); | ||
| } | ||
| on_title_tap.call(task_id_tap_keydown.clone()); | ||
| } | ||
| }, |
There was a problem hiding this comment.
There's a bug in the onkeydown handler. The KeyboardEvent::key() method returns Key::Space for the spacebar, not Key::Character(" ".to_string()). Because these are different enum variants, the current check for the space key will always evaluate to false, meaning the action will not be triggered on a spacebar press as intended.
I suggest refactoring the handler to use the correct Key::Space variant. The proposed change also improves readability by caching the result of evt.key() and avoiding redundant checks.
onkeydown: move |evt: KeyboardEvent| {
let key = evt.key();
let is_space = key == Key::Space;
if key == Key::Enter || is_space {
if is_space {
evt.prevent_default();
}
on_title_tap.call(task_id_tap_keydown.clone());
}
},There was a problem hiding this comment.
I attempted to use Key::Space as requested, but it caused a compilation error (no variant or associated item named Space found for enum dioxus::prelude::Key). I have reverted to Key::Character(" ".to_string()), which matches the established pattern in TaskRow. I have also verified that on_title_tap.call(task_id_tap_keydown.clone()) is correctly using the cloned ID for thread safety.
- Added `role="button"` and `tabindex="0"` to the task title span. - Added `aria_label` with the task title for better screen reader context. - Added `onkeydown` handler to support activating the title with `Enter` or `Space` keys. - Cloned task ID and title for the closures to ensure thread safety. - Formatted `.Jules/palette.md` to pass CI checks. This change ensures that keyboard users and screen readers can interact with the task title on the Work page, matching the accessibility pattern used in the Plan page. Co-authored-by: matta <37314+matta@users.noreply.github.com>
- Added `role="button"` and `tabindex="0"` to the task title span. - Added `aria_label` with the task title for better screen reader context. - Added `onkeydown` handler to support activating the title with `Enter` or `Space` keys. - Cloned task ID and title for the closures to ensure thread safety. - Renamed `.Jules` directory to `.jules` to comply with project naming conventions. - Appended new accessibility learning to `.jules/palette.md`. This change ensures that keyboard users and screen readers can interact with the task title on the Work page, matching the accessibility pattern used in the Plan page. Co-authored-by: matta <37314+matta@users.noreply.github.com>
- Reverted attempted use of `Key::Space` as it is not supported in this Dioxus version.
- Confirmed `Key::Character(" ".to_string())` is the correct pattern.
- Fixed directory naming issue for `.jules/`.
- Restored and appended to `.jules/palette.md` to preserve history.
- Ensured formatting compliance.
Co-authored-by: matta <37314+matta@users.noreply.github.com>
💡 What: Added role="button", tabindex="0", aria_label, and onkeydown handler to the task title in PriorityTaskRow.
🎯 Why: The task title was interactive (onclick) but lacked keyboard accessibility and semantic role, making it inaccessible to screen reader and keyboard users.
♿ Accessibility: Added full keyboard support (Enter/Space) and proper ARIA attributes.
PR created automatically by Jules for task 12046804879058787749 started by @matta