Skip to content
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 [alt] attributes to images #9761

Merged

Conversation

Souvik-Cyclic
Copy link
Contributor

Closes #9629

Adds [alt] attributes to images for Improving Accessibility Score of Book Pages

Screenshot

msedge_9tgVRGa2mc

Stakeholders

@jimchamp

@codecov-commenter
Copy link

codecov-commenter commented Aug 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 16.42%. Comparing base (ce16a79) to head (9741d29).
Report is 356 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9761      +/-   ##
==========================================
+ Coverage   16.06%   16.42%   +0.36%     
==========================================
  Files          90       92       +2     
  Lines        4769     4907     +138     
  Branches      832      856      +24     
==========================================
+ Hits          766      806      +40     
- Misses       3480     3565      +85     
- Partials      523      536      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@jimchamp jimchamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Souvik-Cyclic! I'm happy to merge this once the review notes have been addressed.

@@ -1,6 +1,6 @@
$def with (work, edition, page_url)

$def icon_link(link_class, img_src, link_text, login_redirect=True, ga_data=None):
$def icon_link(link_class, img_src, link_text, login_redirect=True, ga_data=None, alt=""):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$def icon_link(link_class, img_src, link_text, login_redirect=True, ga_data=None, alt=""):
$def icon_link(link_class, img_src, link_text, login_redirect=True, ga_data=None):

It isn't necessary to add alt here, as it will be the same value for each modal link.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing it from here is causing some issues on the page.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh! I see why this is happening. The alt keyword argument needs to be removed from the icon_link call on line 28. I overlooked that one during my review...

Let me test what you have now, and I can make a final commit to this branch that will remove the argument.

openlibrary/templates/type/edition/modal_links.html Outdated Show resolved Hide resolved
openlibrary/templates/type/edition/modal_links.html Outdated Show resolved Hide resolved
openlibrary/templates/type/edition/modal_links.html Outdated Show resolved Hide resolved
openlibrary/templates/type/edition/modal_links.html Outdated Show resolved Hide resolved
openlibrary/templates/type/edition/title_and_author.html Outdated Show resolved Hide resolved
static/css/components/nav-bar.less Show resolved Hide resolved
@jimchamp jimchamp added the Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] label Sep 5, 2024
@Souvik-Cyclic Souvik-Cyclic force-pushed the 9629/fix/add-alt-attributes branch from efd464f to 56f98cd Compare September 5, 2024 19:37
@github-actions github-actions bot removed the Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] label Sep 5, 2024
@Souvik-Cyclic
Copy link
Contributor Author

Souvik-Cyclic commented Sep 5, 2024

@jimchamp review notes have been addressed, Wait there are some errors, need to fix it.

@Souvik-Cyclic Souvik-Cyclic force-pushed the 9629/fix/add-alt-attributes branch from 2dfb005 to bf6ed2d Compare September 5, 2024 20:12
Copy link
Collaborator

@jimchamp jimchamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick updates! I noticed that the nav-arrow changes affected that element's styling a good bit. Can you update the CSS for that, and push up the changes? Apologies for missing this earlier.

Edit: In order to test these changes, the .less files need to be compiled to CSS. You can do this by running docker compose exec web make css while the webapp is running.

openlibrary/macros/EditionNavBar.html Show resolved Hide resolved
openlibrary/templates/type/edition/modal_links.html Outdated Show resolved Hide resolved
@jimchamp jimchamp added the Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] label Sep 5, 2024
@Souvik-Cyclic Souvik-Cyclic force-pushed the 9629/fix/add-alt-attributes branch from 6eb113b to 018e86c Compare September 5, 2024 21:09
@github-actions github-actions bot removed the Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] label Sep 5, 2024
@Souvik-Cyclic Souvik-Cyclic force-pushed the 9629/fix/add-alt-attributes branch from 086bf24 to 2834dfc Compare September 5, 2024 21:11
@jimchamp jimchamp merged commit f4222d3 into internetarchive:master Sep 5, 2024
5 checks passed
@Souvik-Cyclic Souvik-Cyclic deleted the 9629/fix/add-alt-attributes branch September 6, 2024 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Image elements do not have [alt] attributes
3 participants