🎨 Palette: Add accessible data table attributes in Telemetry Timeline#91
🎨 Palette: Add accessible data table attributes in Telemetry Timeline#91igor-holt wants to merge 1 commit into
Conversation
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@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. |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
The clip property is deprecated. For modern browsers, it is recommended to use clipPath: 'inset(50%)' to visually hide elements while maintaining accessibility.
| <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> |
| @@ -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 }}`. | |||
There was a problem hiding this comment.
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.
| **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 }}`. |
💡 What: Added a visually hidden
<caption>element andscope="col"attributes to the data table inTelemetryTimeline.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