Skip to content

🎨 Palette: Add accessible data table attributes in Telemetry Timeline#91

Draft
igor-holt wants to merge 1 commit into
mainfrom
palette-telemetry-table-a11y-18297350507240726525
Draft

🎨 Palette: Add accessible data table attributes in Telemetry Timeline#91
igor-holt wants to merge 1 commit into
mainfrom
palette-telemetry-table-a11y-18297350507240726525

Conversation

@igor-holt
Copy link
Copy Markdown
Owner

💡 What: Added a visually hidden <caption> element and scope="col" attributes to the data table in TelemetryTimeline.tsx.
🎯 Why: To improve accessibility for screen readers navigating the telemetry data table, ensuring the table's purpose is announced and column headers are explicitly associated with their respective data cells.
📸 Before/After: The visual appearance remains identical due to the inline sr-only styling pattern used for the caption.
Accessibility: Significant improvement in screen reader navigation and compliance.


PR created automatically by Jules for task 18297350507240726525 started by @igor-holt

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown

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

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 improves the accessibility of data tables by introducing captions and column scopes in the TelemetryTimeline component, along with corresponding documentation in the palette guide. The review feedback points out the use of the deprecated 'clip' CSS property and recommends updating it to 'clipPath: inset(50%)' in both the implementation and the documentation to align with modern standards.

{/* Optional: Raw Table for Details */}
<div style={{ overflowX: 'auto' }}>
<table style={{ width: '100%', borderCollapse: 'collapse' }}>
<caption style={{ position: 'absolute', width: '1px', height: '1px', padding: 0, margin: '-1px', overflow: 'hidden', clip: 'rect(0, 0, 0, 0)', whiteSpace: 'nowrap', borderWidth: 0 }}>Telemetry Data Details</caption>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The clip property is deprecated. For modern browsers, it is recommended to use clipPath: 'inset(50%)' to visually hide elements while maintaining accessibility.

Suggested change
<caption style={{ position: 'absolute', width: '1px', height: '1px', padding: 0, margin: '-1px', overflow: 'hidden', clip: 'rect(0, 0, 0, 0)', whiteSpace: 'nowrap', borderWidth: 0 }}>Telemetry Data Details</caption>
<caption style={{ position: 'absolute', width: '1px', height: '1px', padding: 0, margin: '-1px', overflow: 'hidden', clipPath: 'inset(50%)', whiteSpace: 'nowrap', borderWidth: 0 }}>Telemetry Data Details</caption>

Comment thread .Jules/palette.md
@@ -0,0 +1,3 @@
## 2024-04-25 - Accessible Data Tables in Telemetry
**Learning:** Data tables lacking explicit captions and scope attributes hinder screen reader navigation, and standard generic CSS utility classes (like `.sr-only`) may be unavailable in some Next.js app setups, requiring specific inline styling patterns for visually hiding elements without breaking layout.
**Action:** Always include a `<caption>` and `scope="col"`/`scope="row"` attributes on data tables. If a visually hidden caption is required for design reasons and utility classes are missing, use the specific inline CSS pattern: `style={{ position: 'absolute', width: '1px', height: '1px', padding: 0, margin: '-1px', overflow: 'hidden', clip: 'rect(0, 0, 0, 0)', whiteSpace: 'nowrap', borderWidth: 0 }}`.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The recommended CSS pattern in the documentation uses the deprecated clip property. It should be updated to use clipPath: 'inset(50%)' to align with modern best practices.

Suggested change
**Action:** Always include a `<caption>` and `scope="col"`/`scope="row"` attributes on data tables. If a visually hidden caption is required for design reasons and utility classes are missing, use the specific inline CSS pattern: `style={{ position: 'absolute', width: '1px', height: '1px', padding: 0, margin: '-1px', overflow: 'hidden', clip: 'rect(0, 0, 0, 0)', whiteSpace: 'nowrap', borderWidth: 0 }}`.
**Action:** Always include a `<caption>` and `scope="col"`/`scope="row"` attributes on data tables. If a visually hidden caption is required for design reasons and utility classes are missing, use the specific inline CSS pattern: `style={{ position: 'absolute', width: '1px', height: '1px', padding: 0, margin: '-1px', overflow: 'hidden', clipPath: 'inset(50%)', whiteSpace: 'nowrap', borderWidth: 0 }}`.

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