Skip to content
This repository was archived by the owner on Mar 25, 2026. It is now read-only.

🎨 Palette: Improve keyboard accessibility in ChatHistory#123

Merged
TheRealAshik merged 2 commits intomainfrom
palette/chathistory-accessibility-9570211627747019151
Mar 25, 2026
Merged

🎨 Palette: Improve keyboard accessibility in ChatHistory#123
TheRealAshik merged 2 commits intomainfrom
palette/chathistory-accessibility-9570211627747019151

Conversation

@TheRealAshik
Copy link
Copy Markdown
Owner

💡 What:
Replaced <div> elements with <button type="button"> elements for the expandable sections (CommandArtifact and CodeChangeArtifact) in the ChatHistory component. Also added appropriate aria-expanded attributes and focus-visible styling.

🎯 Why:
Previously, these expandable sections used onClick on a <div>, making them completely inaccessible to keyboard-only users and screen readers, as <div> elements do not receive focus or respond to Enter/Space keys natively.

📸 Before/After:
Visual appearance remains identical, but users can now tab to the command and diff artifacts and expand/collapse them using the keyboard.

Accessibility:

  • Ensured keyboard navigation via Tab.
  • Added Enter/Space key support inherently by using semantic <button> elements.
  • Provided clear focus indicators via focus-visible utility classes.
  • Conveyed expanded/collapsed state to assistive technologies via aria-expanded.

PR created automatically by Jules for task 9570211627747019151 started by @TheRealAshik

… ChatHistory

- Changed `<div>` to `<button type="button">` for the toggle headers of `CommandArtifact` and `CodeChangeArtifact`.
- Added `aria-expanded` and `focus-visible` styling to improve keyboard navigation and screen reader support.
- Documented learning in `.Jules/palette.md`.
@google-labs-jules
Copy link
Copy Markdown
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.

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
julesagent Ready Ready Preview, Comment Mar 25, 2026 4:05pm

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, 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 keyboard accessibility and screen reader compatibility of interactive elements within the ChatHistory component. By transitioning from non-semantic div elements to native <button> elements for expandable sections, the changes ensure that users relying on keyboard navigation or assistive technologies can properly interact with and understand the state of these UI components. The update also includes consistent ARIA labeling and visual focus indicators, contributing to a more inclusive user experience.

Highlights

  • Enhanced Keyboard Accessibility: Replaced non-semantic <div> elements with <button type="button"> for expandable sections (CommandArtifact and CodeChangeArtifact) in ChatHistory, ensuring native keyboard focus and activation.
  • Improved Screen Reader Support: Added aria-expanded attributes to the new button elements, conveying the expanded/collapsed state to assistive technologies.
  • Visual Focus Indicators: Implemented focus-visible styling to provide clear visual cues for keyboard navigation, enhancing usability for all users.
  • Standardized ARIA Labels: Standardized aria-label attributes for artifact download and open links within ChatHistory.tsx for consistency and clarity.
  • Updated Accessibility Learnings: Modified the internal accessibility learning log to reflect best practices regarding div onClick accessibility.
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.

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
Copy Markdown

@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 effectively improves keyboard accessibility in the ChatHistory component by replacing non-semantic <div> elements with <button> elements for expandable sections. This is a great change that aligns with accessibility best practices. The changes also include adding appropriate aria-expanded attributes and focus-visible styling. My main concern is the presence and modification of the patch.diff file, which appears to be a stray artifact that should be removed from the repository.

Comment thread patch.diff
Comment on lines +1 to +36
--- web/components/ChatHistory.tsx
+++ web/components/ChatHistory.tsx
@@ -727,24 +727,16 @@
href={`data:${artifact.media.mimeType};base64,${artifact.media.data}`}
download={`artifact-${i}.${artifact.media.mimeType.split('/')[1] || 'png'}`}
className="text-zinc-500 hover:text-zinc-300 transition-colors p-1 hover:bg-white/10 rounded"
title="Download"
-<<<<<<< HEAD
- aria-label="Download generated artifact"
-=======
- aria-label="Download Generated Artifact"
->>>>>>> origin/palette/aria-labels-icon-buttons-6351807906965806055
+ aria-label="Download Generated Artifact"
>
<Download size={14} />
</a>
<a
onClick={(e) => {
e.preventDefault();
const win = window.open();
win?.document.write(
`<iframe src="data:${artifact.media.mimeType};base64,${artifact.media.data}" frameborder="0" style="border:0; top:0px; left:0px; bottom:0px; right:0px; width:100%; height:100%;" allowfullscreen></iframe>`
);
}}
href="#"
className="text-zinc-500 hover:text-zinc-300 transition-colors p-1 hover:bg-white/10 rounded"
title="Open in new window"
-<<<<<<< HEAD
- aria-label="Open generated artifact in new window"
-=======
- aria-label="Open Generated Artifact in new window"
->>>>>>> origin/palette/aria-labels-icon-buttons-6351807906965806055
+ aria-label="Open Generated Artifact in new window"
>
<ExternalLink size={14} />
</a>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

This file appears to be a diff file that has been accidentally committed to the repository. It contains patch information, which is not application code and can be confusing for developers. It seems to have been modified in this PR to resolve merge conflicts within its content. Such files should not be part of the source code. I recommend deleting this file from the repository to avoid confusion and keep the codebase clean.

@TheRealAshik TheRealAshik marked this pull request as ready for review March 25, 2026 16:03
@TheRealAshik TheRealAshik merged commit 24b5991 into main Mar 25, 2026
4 checks passed
@TheRealAshik TheRealAshik deleted the palette/chathistory-accessibility-9570211627747019151 branch March 25, 2026 16:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant