wordpress-mobile / wordpress-mobile/WordPress-Android

Block Editor: Cover block overlay opacity not working when it has no media

Open
#17,404 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

[Pri] Medium [Type] Bug Gutenberg Posting/Editing
Dominant language
Kotlin
Stars
3.2k
Forks
1.4k
Avg merge
1d 11h
Merged PRs (30d)
69

Description

Expected behavior

For a Cover block without any media (no image, nor video) when overlay opacity is set to any number below 100% it correctly displays the color + opacity in the Android app editor.

Actual behavior

The overlay opacity is only correctly displayed IF the Cover block has media, otherwise two things happen:

  1. the Android editor does NOT show the overlay opacity setting in the Block settings
  2. the Android editor does NOT render the overlay opacity correctly, showing a block with 100% opacity with the solid overlay color
Screenshots of the behavior

The screenshots below were all taken with the Cover Block in the same state, with overlay opacity = 10%.

Web EditorWeb PreviewApp Editor (bug)App Preview
bug_cover_block_web_editorbug_cover_block_web_previewbug_cover_block_app_editorbug_cover_block_app_preview
Steps to reproduce the behavior

I was able to find a couple of ways to reproduce it:

First Way - All inside WordPress Android App
  1. Open WordPress Android app and Log In to your account
  2. Choose a page / create a new page
  3. Add the Cover block to it
  4. Set any media for the cover block
  5. Set a text inside the Cover block (just for better visibility on the bug)
  6. Set the paragraph block text color
  7. Open Cover block options
  8. Check that you have the option of setting an overlay opacity
  9. Set an overlay color to the same color as the paragraph text color set on step 5
  10. Set overlay opacity to something low, like 10%
  11. Check that editor looks as expected: background media, with an overlay, with a text on top of it
  12. Tap to see the preview
  13. Check that preview looks as expected: background media, with an overlay, with a text on top of it
  14. Open Cover block options
  15. Tap on "Clear Media" to remove the media
  16. Check that editor DOES NOT look as expected: solid overlay color with no transparency, text with same color (impossible to see)
  17. Open Cover block options
  18. Check that "Overlay Opacity" option is not there anymore
  19. Tap to see the preview
  20. Check that preview LOOKS as expected: overlay color WITH previously set transparency, text with same color (but possible to see, thanks to overlay opacity)
Video for First Way

https://user-images.githubusercontent.com/5091503/199263078-3ec8b231-1178-4344-a01b-ca1d59d2386b.mp4

Second Way - WordPress Web Editor (on mobile or computer) + Android app
  1. Open WordPress Web on your device browser and the Android app as well, and Log In to your account in both places
  2. Web Editor: Choose a page / create a new page
  3. Web Editor: Add a Cover block to it
  4. Web Editor: Choose a color for the cover block (don't add any media)
  5. Web Editor: Set a text inside the Cover block (just for better visibility on the bug)
  6. Web Editor: Set the paragraph block text color
  7. Web Editor: Open Cover block options
  8. Web Editor: Check that you have the option of setting an overlay opacity
  9. Web Editor: Set overlay color to the same color as the paragraph text color set on step 5
  10. Web Editor: Set overlay opacity to something low, like 10%
  11. Web Editor: Check that editor looks as expected: background media, with an overlay, with a text on top of it
  12. Web Editor: Tap to see the preview
  13. Web Editor: Check that preview looks as expected: background media, with an overlay, with a text on top of it
  14. Web Editor: Hit "Update" to save the changes
  15. App Editor: Refresh the Pages list
  16. App Editor: Select the same page you edited using the Web Editor
  17. App Editor: Check that editor DOES NOT look as expected: solid overlay color with no transparency, text with same color (impossible to see)
  18. App Editor: Open Cover block options
  19. App Editor: Check that "Overlay Opacity" option is not there
  20. App Editor: Tap to see the preview
  21. App Editor: Check that preview LOOKS as expected: overlay color WITH previously set transparency, text with same color (but possible to see, thanks to overlay opacity)
Video for Second Way

https://user-images.githubusercontent.com/5091503/199266600-12d8ece6-1d19-4dab-b552-401d6eb6fb42.mp4

Tested on Samsung S21+, Android 12, WPAndroid 21.0-rc-1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in the WordPress Android app using a Cover block without media, then compare the editor with the preview after setting a low overlay opacity. The fix is done when the Overlay Opacity setting remains available and the editor renders the saved opacity correctly with and without media.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.