-
Notifications
You must be signed in to change notification settings - Fork 8
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
Show short description in alttxt pane by default #356
Conversation
✅ Deploy Preview for upset2 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Overall looks good, although I'm unsure about converting an error message into an AltText object. That feel's pretty hacky. Please review that and see if you can find a better way to handle those errors.
packages/app/src/components/Body.tsx
Outdated
* @param err - The error message to convert. | ||
* @returns The AltText object with the error message as the long description, short description, and technique description. | ||
*/ | ||
function errToAltText(err: string): AltText { |
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.
What's the reasoning behind this? Could you throw an error and catch it in the calling function instead?
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.
Good point. This should be addressed now; I'm using errors instead. It's also hiding the "Show More" button when an error occurs.
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.
Looks good. Thanks for changing that 👍 Approved
Does this PR close any open issues?
Closes #340
Give a longer description of what this PR addresses and why it's needed
Previously, only the long description was shown in the alttxt pane. This shows the short description by default with a "Show More" button to view the long description. A "Show Less" button allows for returning to the short description.
Provide pictures/videos of the behavior before and after these changes (optional)
Before:


After:
Have you added or updated relevant tests?
Have you added or updated relevant documentation?
Are there any additional TODOs before this PR is ready to go?
TODOs: