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

Remove the carousel title and description prefix blocklist #12157

Merged
merged 1 commit into from
Apr 29, 2019

Conversation

scottsweb
Copy link
Contributor

@scottsweb scottsweb commented Apr 25, 2019

We currently check for certain blocklist words in the carousel module and remove the title or description if those words are discovered. It creates quite a bit of confusion when we modify content in this way as there is no indication to the user that this magic is happening.

There is some context around the history of these changes at p158lY-24f. In summary:

this function is meant to prevent the generating of titles based on filenames that weren’t created by a human.

I don't think the checks are robust enough. Based on the current set of exclusions for example, I cannot have a title/description called 'Scanning the mountains' or 'SAM & MATT' - both very plausible titles.

Fixes #12067

Changes proposed in this Pull Request:

  • Remove the carousel title and description prefix blocklist

Testing instructions:

  • Create a carousel gallery and make sure one of the images has a title of "IMG1234"
  • View the front end / theme and verify the title is not show in the full screen carousel
  • Pull this PR down
  • Add define( 'SCRIPT_DEBUG', true ); to your wp-config.php
  • Refresh the page, the title of "IMG1234" should now be visible

Proposed changelog entry for your changes:

  • Remove the carousel title and description prefix blocklist

@scottsweb scottsweb added [Type] Bug When a feature is broken and / or not performing as intended [Feature] Carousel A fullscreen modal appearing when clicking on an image in a gallery or tiled gallery. [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Apr 25, 2019
@scottsweb scottsweb requested a review from a team April 25, 2019 16:49
@matticbot
Copy link
Contributor

Caution: This PR has changes that must be merged to WordPress.com
Hello scottsweb! These changes need to be synced to WordPress.com - If you 're an a11n, please commandeer, review, and approve D27429-code before merging this PR. Thank you!

@jetpackbot
Copy link
Collaborator

Thank you for the great PR description!

When this PR is ready for review, please apply the [Status] Needs Review label. If you are an a11n, please have someone from your team review the code if possible. The Jetpack team will also review this PR and merge it to be included in the next Jetpack release.

Scheduled Jetpack release: May 7, 2019.
Scheduled code freeze: April 30, 2019

Generated by 🚫 dangerJS against 12e0bda

@kraftbj
Copy link
Contributor

kraftbj commented Apr 25, 2019

In my personal experience, a lot of these are followed by an underscore, e.g. IMG_20160530.jpg. Would adding the underscore following the strings we check help reduce the false positives while maintaining the intent of not displaying abstract filenames?

@jeherve
Copy link
Member

jeherve commented Apr 25, 2019

cc @stephdau who worked on this originally.

@tbradsha
Copy link
Contributor

Is there a reason that we wouldn't want to allow abstract filenames? If I'm showcasing my photos, and it's a specific filename, I might want to include the filename in the title so that viewers know exactly which photo I'm referencing (instead of "Photo of sunset of river 3").

I agree it's not always best practice to have a filename as the title, but we shouldn't be restricting what a user can title their images as (and if we do, we should at least notify them). Is there a reason we create a title on import in the first place instead of leaving it blank?

Another option might be to add a show_title checkbox option to show the title, and if the image title matches certain keywords on import, the show_title option is off by default. This, of course, would probably be more work than it's worth.

@scottsweb
Copy link
Contributor Author

Have been giving this some more thought. My reasons for removal are now:

  1. It encourages people to use good titles and descriptions, much better for accessibility
  2. There will be no confusion about why some titles do no show (e.g. SAMANTHA)
  3. It is less to maintain, this list has not been updated in over 7 years

The reasons for keeping it or refining it:

  1. It will sometimes save sighted users from displaying less fortunate titles and descriptions

@scottsweb scottsweb changed the title Remove the carousel title and description prefix blacklist Remove the carousel title and description prefix blocklist Apr 26, 2019
@jeherve jeherve added [Status] Ready to Merge Go ahead, you can push that green button! [Type] Dotcom Merge and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. [Type] Dotcom Merge labels Apr 26, 2019
Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

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

I'm fine giving this a go. I think it makes the behaviour of the Carousel feature more predictable.

@kraftbj kraftbj added this to the 7.3 milestone Apr 29, 2019
@kraftbj kraftbj merged commit 65abe40 into master Apr 29, 2019
@kraftbj kraftbj deleted the fix/carousel-removing-certain-strings branch April 29, 2019 20:15
@matticbot matticbot removed the [Status] Ready to Merge Go ahead, you can push that green button! label Apr 29, 2019
kraftbj added a commit that referenced this pull request Apr 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Carousel A fullscreen modal appearing when clicking on an image in a gallery or tiled gallery. Touches WP.com Files [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Carousel: Image title field does not display in if the title starts with uppercase "IMG"
6 participants