-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add loading content parameter #3074
Conversation
🦋 Changeset detectedLatest commit: 7e444f1 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 |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks @owenniblock 😄
Can we change this a bit to always render a spinner? The design feedback mentioned the ability to customize the loading text only.
@camertron if it's just the text we want to update here, would it make more sense to have this as a parameter on the SelectPanel class? Something like:
If the idea is that we also might want to display the text visually, then we might want to change the Spinner markup so that the Spinner element itself is hidden from the screen reader and the text is available. But if that's optional, then we're going to want to also add a Boolean parameter to switch this on and off. |
Hmm yeah we discussed that a bit yesterday... I was leaning toward a free-form slot because that's what we do for error messaging, but your concern about hiding the spinner from screen readers coupled with labeling concerns (eg. the spinner should probably have an Ok, let's make the loading message a parameter, I think you're right. Re: |
Cool, thanks @camertron - I can work out what's best for the aria-* stuff. I just re-read the original comment from @maximedegreve and I wonder if my thoughts on what he's after here are not quite right. I was thinking we wanted to be able to customise the loading text itself (which is currently added as an However rereading the original ask:
Maybe we want to add additional information here? My original change (this PR) will allow all of these scenarios but at the cost of allowing consumers to do whatever they want 😅 So I guess I'm asking what are the possible configurations we want to allow here? Options
I'm going to go with (2) unless someone shouts and says "woah there Owen" 😂 There's an additional sub-option for (2) where we don't allow the label to be customised. I have no firm view on this but figure I'll do the most complex version and then we can remove the bits we don't want after discussion. Slight aside: I couldn't think of a good way to test this so if you know a (good) way to short-circuit the loading process so that the Spinner remains visible indefinitely, let me know 🙂 |
OK, just need to find a good way to test the code 🤔 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just asking for some comments, but otherwise ready to merge! 🎉
previews/primer/alpha/select_panel_preview/custom_loading_label.html.erb
Show resolved
Hide resolved
…ponents into add-loading-content-slot
…ponents into add-loading-content-slot
Authors: Please fill out this form carefully and completely.
Reviewers: By approving this Pull Request you are approving the code change, as well as its deployment and mitigation plans.
Please read this description carefully. If you feel there is anything unclear or missing, please ask for updates.
What are you trying to accomplish?
Adds a
loading_content
slot toSelectPanel
to allow the loadingSpinner
to be overridden with custom content.Integration
No
List the issues that this change affects.
Closes https://github.com/github/primer/issues/3926
Risk Assessment
Until the feature is used, it shouldn't affect other functionality so marking this as low risk.
What approach did you choose and why?
Anything you want to highlight for special attention from reviewers?
I added the information to the .json files that reference the previews, I don't know if that's how you do it or if there's some automated process for this, let me know if there's some other way to do this.
Also I didn't add a test for this, I figure that because the loading content goes away eventually, it's likely to cause the test to be flaky. Maybe there's a way to short-circuit the loading process so that the loading spinner remains visible forever, but I felt it was better to just get this out there as it's a pretty simple change.
Accessibility
Merge checklist
Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.