Skip to content

Comments

🎨 Palette: Improve accessibility for PriorityTaskRow#518

Open
matta wants to merge 4 commits intomainfrom
palette/accessibility-fix-priority-task-row-12046804879058787749
Open

🎨 Palette: Improve accessibility for PriorityTaskRow#518
matta wants to merge 4 commits intomainfrom
palette/accessibility-fix-priority-task-row-12046804879058787749

Conversation

@matta
Copy link
Owner

@matta matta commented Feb 22, 2026

💡 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

- 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>
@google-labs-jules
Copy link
Contributor

👋 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.

@trunk-io
Copy link
Contributor

trunk-io bot commented Feb 22, 2026

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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 PriorityTaskRow component by making its interactive task title fully navigable and operable via keyboard. It addresses a critical accessibility gap by adding semantic roles, tab focus, and keyboard event handling, ensuring that users relying on screen readers or keyboard navigation can interact with task titles effectively. The changes also include documenting these accessibility best practices for future reference.

Highlights

  • Accessibility Enhancements: Implemented role="button", tabindex="0", and aria_label attributes for the task title span within the PriorityTaskRow component to improve semantic meaning and screen reader compatibility.
  • Keyboard Navigation Support: Added an onkeydown event handler to the task title, enabling users to activate the task editing functionality using the Enter and Space keys, thus providing full keyboard accessibility.
  • Accessibility Documentation: Created a new documentation entry in .Jules/palette.md to capture learnings and best practices for ensuring keyboard accessibility on custom interactive elements across the codebase.
Changelog
  • .Jules/palette.md
    • Added a new markdown file documenting accessibility best practices for custom interactive elements, specifically focusing on span elements used as buttons.
  • crates/tasklens-ui/src/app_components/priority_task_row.rs
    • Introduced a new task_id_tap_keydown variable to facilitate keyboard event handling for the task title.
    • Applied role="button", tabindex="0", and a dynamic aria_label to the task title span to enhance its semantic meaning and provide context for assistive technologies.
    • Implemented an onkeydown event handler that triggers the on_title_tap action when the Enter or Space keys are pressed on the task title.
    • Added evt.prevent_default() for the Space key within the onkeydown handler to prevent unintended page scrolling when activating the button.
Activity
  • The pull request was automatically created by Jules for task 12046804879058787749, initiated by @matta.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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.

Comment on lines +68 to +75
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());
}
},
Copy link
Contributor

Choose a reason for hiding this comment

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

high

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());
                    }
                },

Copy link
Owner Author

Choose a reason for hiding this comment

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

@jules, make this change

Copy link
Contributor

Choose a reason for hiding this comment

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

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.

google-labs-jules bot and others added 3 commits February 22, 2026 19:43
- 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>
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