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

[Reader] Add support to Prompt block #18323

Merged
merged 7 commits into from
Apr 27, 2023
Merged

Conversation

thomashorta
Copy link
Contributor

@thomashorta thomashorta commented Apr 25, 2023

The "Prompt Block" is shown in posts made on the web as an answer to the Daily Prompts. The Loop team just implemented the CSS for it to work properly both on the web and on the mobile apps but a few minor issues still needed to be resolved on the app side:

  • Add --color-neutral-5 CSS variable to the Reader Renderer (even though we are not currently using it)
  • Add a 1-pixel margin-right to the body of the content because Android's Webview has a bug that cuts off 1 pixel from the right
  • Intercept tag URLs inside the post to show them inside the app reader

The WebView 1-pixel issue

To test

Prompt Block UI

It seems the calypso CSS changes have been deployed, so it's possible to test the block UI.

  1. Install Jetpack
  2. Login with a WP.com account
  3. Select a blog site (has a few posts)
  4. Go to My Site > Home
  5. Tap "View all responses" in the Prompts card
  6. Find a post that has a preview starting with "Daily writing prompt" (those are posts answered from the web)
  7. Verify the Prompt block is formatted as expected

Tag URL interception

  1. Install Jetpack
  2. Login with a WP.com account
  3. Select a blog site (has a few posts)
  4. Go to My Site > Home
  5. Tap "View all responses" in the Prompts card
  6. Find a post that has a preview starting with "Daily writing prompt" (those are posts answered from the web)
  7. Tap the "View all responses" link inside the post
  8. Verify the Reader topic page is opened

Demo

Demo of the CSS fix by using the proxy to also change the provided CSS to use --color-neutral-5 in the block border, just to test that change as well (using Map Local in Charles Proxy).

redaer-prompt-block-Android.mp4

Regression Notes

  1. Potential unintended areas of impact
    Content being shifted because of the border. Wrong links being intercepted.

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

  3. What automated tests I added (or what prevented me from doing so)
    Unit tests for the ViewModel.

PR submission checklist:

  • I have completed the Regression Notes.
  • 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.

UI Changes testing checklist:

  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • Talkback.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • Large and small screen sizes. (Tablet and smaller phones)
  • Multi-tasking: Split screen and Pop-up view. (Android 10 or higher)

Note: most changes here only affect the content inside a Webview so some of the items above do not apply.

Thomas Horta added 4 commits April 24, 2023 18:08
Reuse an existing color from `mResourceVars` since it is the one that most
closely resembles the --color-neutral-5 used on web (gray-5).
@thomashorta thomashorta added this to the 22.3 milestone Apr 25, 2023
@thomashorta thomashorta self-assigned this Apr 25, 2023
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Apr 25, 2023

Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr18323-95047a7
Commit95047a7
Direct Downloadjetpack-prototype-build-pr18323-95047a7.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Apr 25, 2023

WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr18323-95047a7
Commit95047a7
Direct Downloadwordpress-prototype-build-pr18323-95047a7.apk
Note: Google Login is not supported on these builds.

Copy link
Contributor

@RenanLukas RenanLukas 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 changes, @thomashorta. It's working as expected.

I've left a suggestion for a unit test and I'm approving it.

LGTM :shipit:

@thomashorta thomashorta force-pushed the fix/reader-prompt-block branch from c50251b to 95047a7 Compare April 26, 2023 21:20
@thomashorta thomashorta merged commit 73b3cc8 into trunk Apr 27, 2023
@thomashorta thomashorta deleted the fix/reader-prompt-block branch April 27, 2023 13:20
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