Skip to content

Blogging Prompts List: add the ability to show empty views for different scenarios. - #18515

Merged
ScoutHarris merged 1 commit into
trunkfrom
feature/18502-list_empty_view
May 5, 2022
Merged

Blogging Prompts List: add the ability to show empty views for different scenarios.#18515
ScoutHarris merged 1 commit into
trunkfrom
feature/18502-list_empty_view

Conversation

@ScoutHarris

@ScoutHarris ScoutHarris commented May 5, 2022

Copy link
Copy Markdown
Contributor

Ref: #18502

This adds the ability to show empty views for different scenarios.

  • No results
  • No connection
  • Loading prompts
  • Loading error

Since the view is not fetching prompts yet, some hacking in BloggingPromptsViewController is required to get each empty view to show, which is noted below. The logic to toggle these states appropriately will be added later.

For the uninitiated 😄 , the NoResultsViewController provides this magic:

  • If there is no connection, it detects it and creates the no connection view regardless of what it was configured with.
  • In compact height, the image is automatically hidden.

To test:

  • Enable bloggingPrompts feature flag.
  • Make the changes below for each empty view type.
  • Go to Home tab > prompt card > View more prompts.
  • Verify each view appears as shown below.

View hacking:

  • No results view:
    • Set promptCount = 0.
  • No connection view:
    • Set promptCount = 0.
    • Disconnect internet connection.
  • Loading view:
    • Set isLoading = true.
  • Error view:
    • In viewDidLoad, replace showNoResultsViewIfNeeded with showErrorView.

No Results No Connection
no_results no_connection
Loading Loading Error
loading loading_error

Regression Notes

  1. Potential unintended areas of impact
    N/A

  2. What I did to test those areas of impact (or what existing automated tests I relied on)
    N/A

  3. What automated tests I added (or what prevented me from doing so)
    N/A

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@ScoutHarris ScoutHarris added this to the 19.9 milestone May 5, 2022
@ScoutHarris ScoutHarris self-assigned this May 5, 2022
@ScoutHarris
ScoutHarris requested a review from wargcm May 5, 2022 00:29
@ScoutHarris
ScoutHarris marked this pull request as ready for review May 5, 2022 00:29
@wpmobilebot

Copy link
Copy Markdown
Contributor
You can test the changes in Jetpack from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr18515-be554f9 on your iPhone

If you need access to App Center, please ask a maintainer to add you.

@wpmobilebot

Copy link
Copy Markdown
Contributor
You can test the changes in WordPress from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr18515-be554f9 on your iPhone

If you need access to App Center, please ask a maintainer to add you.

@wargcm wargcm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code looks good! I found a couple minor UI issues which probably don't need to be addressed in this PR:

  1. There's some display issues for the no connection text in landscape mode when using large accessibility text. This is probably an existing issue with the no results view.
    Simulator Screen Shot - iPhone 11 - 2022-05-05 at 13 09 30

  2. There's a small flicker when changing tabs. I compared it to the followers page for reference.

flicker.mp4

@ScoutHarris

ScoutHarris commented May 5, 2022

Copy link
Copy Markdown
Contributor Author

There's some display issues for the no connection text in landscape mode when using large accessibility text. This is probably an existing issue with the no results view.

Indeed it is. I'll not address that here.

There's a small flicker when changing tabs.

This will be fixed when the logic is added to properly display the views. Right now it's just always readding the empty view so it appears for all the tabs, which causes the flickering. In the future, it will depend on the loading status, tab contents, and whether it's already being displayed. i.e. I'll fix it later! 😄

@ScoutHarris
ScoutHarris merged commit e651f2d into trunk May 5, 2022
@ScoutHarris
ScoutHarris deleted the feature/18502-list_empty_view branch May 5, 2022 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants