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 text enhancements #3591

Merged
merged 3 commits into from Nov 21, 2017

Conversation

Projects
None yet
4 participants
@jasmussen
Contributor

jasmussen commented Nov 21, 2017

Description

Fixes #1509.

This adds help text to the Alt attribute text control in the inspector for images. In doing so it also adds helpText as an option to the TextControl component. When filled out, an italicized verbose description will be output below the textfield.

How Has This Been Tested?

Tested in Chrome, Mac.

Screenshot

screen shot 2017-11-21 at 13 30 35

To test

  • Insert an image
  • Open the block inspector sidebar
  • Verify that help text is present

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows has proper inline documentation.

jasmussen added some commits Nov 20, 2017

Initial stab at adding better alt text help text
When done it fixes #1509.

Still to do, make it so this help text can be part of the TextControl component, instead of a separate element.
@codecov

This comment has been minimized.

Show comment
Hide comment
@codecov

codecov bot Nov 21, 2017

Codecov Report

Merging #3591 into master will decrease coverage by 0.29%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #3591     +/-   ##
=========================================
- Coverage   35.76%   35.47%   -0.3%     
=========================================
  Files         267      268      +1     
  Lines        6744     6943    +199     
  Branches     1221     1278     +57     
=========================================
+ Hits         2412     2463     +51     
- Misses       3657     3764    +107     
- Partials      675      716     +41
Impacted Files Coverage Δ
blocks/library/image/block.js 1.07% <ø> (-0.78%) ⬇️
editor/header/fixed-toolbar-toggle/index.js 0% <0%> (ø) ⬆️
editor/modes/visual-editor/index.js 0% <0%> (ø) ⬆️
editor/header/mode-switcher/index.js 0% <0%> (ø) ⬆️
editor/header/ellipsis-menu/index.js 0% <0%> (ø) ⬆️
editor/utils/with-change-detection/index.js 100% <0%> (ø) ⬆️
editor/writing-flow/index.js 0% <0%> (ø)
blocks/api/validation.js 93.54% <0%> (+2.08%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a76e229...6819c81. Read the comment docs.

codecov bot commented Nov 21, 2017

Codecov Report

Merging #3591 into master will decrease coverage by 0.29%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #3591     +/-   ##
=========================================
- Coverage   35.76%   35.47%   -0.3%     
=========================================
  Files         267      268      +1     
  Lines        6744     6943    +199     
  Branches     1221     1278     +57     
=========================================
+ Hits         2412     2463     +51     
- Misses       3657     3764    +107     
- Partials      675      716     +41
Impacted Files Coverage Δ
blocks/library/image/block.js 1.07% <ø> (-0.78%) ⬇️
editor/header/fixed-toolbar-toggle/index.js 0% <0%> (ø) ⬆️
editor/modes/visual-editor/index.js 0% <0%> (ø) ⬆️
editor/header/mode-switcher/index.js 0% <0%> (ø) ⬆️
editor/header/ellipsis-menu/index.js 0% <0%> (ø) ⬆️
editor/utils/with-change-detection/index.js 100% <0%> (ø) ⬆️
editor/writing-flow/index.js 0% <0%> (ø)
blocks/api/validation.js 93.54% <0%> (+2.08%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a76e229...6819c81. Read the comment docs.

Remove the additional helpText prop.
Turns out it was already there under `help`, and not just for screen readers.
@jasmussen

This comment has been minimized.

Show comment
Hide comment
@jasmussen

jasmussen Nov 21, 2017

Contributor

Removed the helpText and used help instead. Good catch. Some of this stuff is magic.

Contributor

jasmussen commented Nov 21, 2017

Removed the helpText and used help instead. Good catch. Some of this stuff is magic.

@youknowriad

👍

@jasmussen jasmussen merged commit 226b56c into master Nov 21, 2017

3 checks passed

codecov/project 35.47% (-0.3%) compared to a76e229
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@jasmussen jasmussen deleted the add/alt-text-enhancements branch Nov 21, 2017

@afercia

This comment has been minimized.

Show comment
Hide comment
@afercia

afercia Nov 22, 2017

Contributor

Well done, thanks 🎉

Contributor

afercia commented Nov 22, 2017

Well done, thanks 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment