Teach BorderBox component a list_arguments param#3821
Teach BorderBox component a list_arguments param#3821myabc wants to merge 3 commits intoprimer:mainfrom
list_arguments param#3821Conversation
🦋 Changeset detectedLatest commit: 4ad0024 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
list_arguments param
There was a problem hiding this comment.
Pull request overview
This PR adds a list_arguments parameter to the BorderBox component, enabling developers to pass custom system arguments to the internal <ul> element. This addresses accessibility needs, particularly for cases where ARIA roles and metadata are required for the list element.
Key changes:
- Added
list_argumentsparameter to BorderBox component initialization - Updated playground preview to demonstrate the new parameter
- Added test coverage for the new functionality
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| app/components/primer/beta/border_box.rb | Added list_arguments parameter to the component's initializer, processes it with deny_tag_argument, and sets it on @list_arguments instance variable |
| test/components/beta/border_box_test.rb | Added test case verifying that custom attributes (id, role) can be passed via list_arguments and are properly rendered on the list element |
| previews/primer/beta/border_box_preview.rb | Updated playground preview to include list_id parameter demonstrating the new list_arguments functionality |
| .changeset/rare-coats-hide.md | Added changeset entry documenting this as a patch-level change |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Allows additional customization of the rendered `<ul>` by supporting system arguments. Closes primer#3820
88f6673 to
4ad0024
Compare
| } | ||
| @list_arguments[:aria] = merge_aria( | ||
| @list_arguments, | ||
| { aria: { labelledby: header.id } } |
There was a problem hiding this comment.
We could also explicitly disallow aria-label. However, this is probably being overly-defensive and I don't think it's being done elsewhere.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Update: it turns out there are issues with our original use case:
Applying As such we (OpenProject devs) probably need to discuss internally before proceeding. @HDinger |
What are you trying to accomplish?
Allows additional customization of the rendered
<ul>by supporting system arguments.Our use case:
We have a lightweight responsive table implementation based on the Border Box component. We are currently in the process of adding ARIA roles and metadata for better A11y support. Unfortunately, we can't apply additional attributes (e.g.
ul[role="rowgroup"]without resorting to hackery.Screenshots
Integration
No. It adds to existing API.
List the issues that this change affects.
Closes #3820
Risk Assessment
Accessibility
Merge checklist