fix(resources): associate filter checkboxes with labels explicitly - #8080
tejaswiverma121-byte wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughResource filter JSX and the GraphQL query were reformatted. Filter options now use matching count-group lookups, omit unmatched items, and connect each checkbox to its label with ChangesResource filter controls
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to The resource filters retain their selection behavior while labels now explicitly associate with their checkboxes. No actionable merge risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 ESLint
src/sections/Resources/Resources-grid/filters.jsParsing error: The keyword 'import' is reserved Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Reviewed the complete diff and options.js. The accessibility fix and .find() changes look correct, and the existing filtering behavior is preserved.
One change requested: IDs currently use x.value, but values like Recorded Webinar, Docker Extension, and Open Service Mesh contain spaces. Please use the existing x.id instead
const filterId = `type-${x.id}`;
<label htmlFor={filterId}>
<input id={filterId} ... />
Apply the same pattern for Product, Technology, and Service Mesh. This keeps IDs unique, deterministic, and valid.
Add category-scoped unique IDs and matching htmlFor attributes to checkbox filters using x.id to prevent whitespace and ensure proper accessibility association. Signed-off-by: tejaswiverma <tejaswiverma121@gmail.com>
69fb415 to
c85bdcf
Compare
|
@vedant21-ctr thanks for the review! Updated the filter IDs to use const filterId = ${category}-${x.id} across Type, Product, Technology, and Service Mesh. This removes all whitespace from IDs while keeping them unique and valid HTML5 IDs |
|
Preview deployment for PR #8080 removed. This PR preview was automatically pruned because we keep only the 3 most recently updated previews on GitHub Pages to stay within deployment size limits. If needed, push a new commit to this PR to generate a fresh preview. |
There was a problem hiding this comment.
Note
Copilot was unable to run its full agentic suite in this review.
Copilot review overview
Review effort: Lite
Findings: 1
Open (2)
What changed in this PR
Improves accessibility and usability of the Resources page filters by explicitly associating checkbox inputs with their visible labels and preventing filter options with no matching results from rendering.
Changes:
- Added category-scoped checkbox
idvalues and correspondinghtmlForlabel associations across Type/Product/Technology/Service Mesh filters. - Updated filter option rendering to only show items that exist in the GraphQL grouped results (hides empty options).
- Reformatted the
useStaticQuery(graphql…)block and tidied JSX formatting.
| File | Description |
|---|---|
| src/sections/Resources/Resources-grid/filters.js | Adds explicit checkbox/label associations and conditionally renders only filters with matching counts. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| <span | ||
| className={`${props.resources.length === 0 ? "clear-disabled" : "clear-enabled"} desk-view`} | ||
| onClick={props.clear} | ||
| > | ||
| Clear Filters | ||
| </span> | ||
| {expandFilter ? (<span className= {`${props.resources.length === 0 ? "clear-disabled" : "clear-enabled mob-view"}`} onClick={props.clear}> | ||
| Clear Filters | ||
| </span>) : ""} | ||
| {expandFilter ? ( | ||
| <span | ||
| className={`${props.resources.length === 0 ? "clear-disabled" : "clear-enabled mob-view"}`} | ||
| onClick={props.clear} | ||
| > | ||
| Clear Filters | ||
| </span> | ||
| ) : ( | ||
| "" | ||
| )} |
| {typeOptions[0].subdata.map((x) => { | ||
| const type = | ||
| types && types.find((t) => t.fieldValue === x.value); | ||
| const filterId = `type-${x.id}`; | ||
| return type ? ( |


Description
This PR fixes #8063
Add category-scoped unique IDs and matching htmlFor attributes to checkbox filters on the Resources page to ensure proper accessibility association.
Notes for Reviewers
Signed commits
Summary by CodeRabbit
Accessibility
Bug Fixes