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] Show "Create Post" FAB in Reader #20925

Merged
merged 14 commits into from
Jun 3, 2024

Conversation

RenanLukas
Copy link
Contributor

Fixes #20908

  • Implement reader_floating_button remote feature flag
  • Show the "create" FAB in Reader based on the state of the reader_floating_button feature flag
  • Add analytics (see [Reader] Show "Create Post" FAB in Reader #20908 for details)
  • Move some FAB/Sheet related code to MainCreateSheetHelper for better organization
  • Some minor refactor

To Test:

Showing FAB on Reader page

  1. Open Jetpack
  2. Go to Debug Settings
  3. Disable the reader_floating_buitton remote flag
  4. Go to Reader
  5. Verify the FAB does not appear on Reader
  6. Go to Debug Settings
  7. Enable the reader_floating_button remote flag
  8. Go to Reader
  9. Verify the FAB appears on Reader

Analytics

  1. Open Jetpack
  2. Go to Debug Settings
  3. Enable the reader_floating_button remote flag
  4. Go to Reader
  5. Verify tracked reader_create_fab_shown
  6. Tap the FAB
  7. Verify tracked reader_create_sheet_shown
  8. Tap the "?" button in the Prompts item (if a prompt is available for the tested site)
  9. Verify tracked reader_create_sheet_prompt_help_tapped
  10. Go back
  11. Tap Answer prompt (if a prompt is available for the tested site)
  12. Verify tracked reader_create_sheet_answer_prompt_tapped
  13. Go back to Reader
  14. Tap the FAB
  15. Tap Blog post
  16. Verify tracked reader_create_sheet_action_tapped, Properties: {"action":"create_new_post"}

Sanity

Please also test the FAB works normally on "My Site" page as expected, and the FAB is not shown in other pages, nor on the Reader when the reader_floating_button is disabled.


Regression Notes

  1. Potential unintended areas of impact

    • FAB behavior in other pages
  2. What I did to test those areas of impact (or what existing automated tests I relied on)

    • Manual Tests
    • Unit tests in the Activity ViewModel
  3. What automated tests I added (or what prevented me from doing so)

    • Updated Activity ViewModel tests
    • Added unit tests to the MainCreateSheetHelper

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.

Testing Checklist (strike-out the not-applying and unnecessary ones):

  • WordPress.com sites and self-hosted Jetpack sites.
  • 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)

@dangermattic
Copy link
Collaborator

dangermattic commented May 31, 2024

1 Warning
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

wpmobilebot commented May 31, 2024

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
Versionpr20925-096ad6e
Commit096ad6e
Direct Downloadjetpack-prototype-build-pr20925-096ad6e.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented May 31, 2024

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
Versionpr20925-096ad6e
Commit096ad6e
Direct Downloadwordpress-prototype-build-pr20925-096ad6e.apk
Note: Google Login is not supported on these builds.

@RenanLukas RenanLukas marked this pull request as ready for review May 31, 2024 18:30
@RenanLukas
Copy link
Contributor Author

Code already reviewed on #20910

Thomas Horta added 4 commits June 3, 2024 10:32
This layout is usually inflated in Reader feeds inside the Main Activity of the
app, which already contains a View with the same ID that's used for snackbar
and properly positioning the FAB, which is now visible in Reader.

This was causing a bug where the snackbar was shown behind the bottom bar
instead of pushing the FAB up and being shown between the bottom bar and FAB.
Copy link

sonarcloud bot commented Jun 3, 2024

Quality Gate Passed Quality Gate passed

Issues
2 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

codecov bot commented Jun 3, 2024

Codecov Report

Attention: Patch coverage is 92.50000% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 41.06%. Comparing base (4f6014a) to head (096ad6e).

Files Patch % Lines
.../android/viewmodel/main/WPMainActivityViewModel.kt 86.11% 1 Missing and 4 partials ⚠️
...ava/org/wordpress/android/util/SiteUtilsWrapper.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##           release/25.0   #20925      +/-   ##
================================================
+ Coverage         41.02%   41.06%   +0.03%     
================================================
  Files              1512     1515       +3     
  Lines             69383    69426      +43     
  Branches          11440    11451      +11     
================================================
+ Hits              28462    28507      +45     
+ Misses            38342    38338       -4     
- Partials           2579     2581       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@thomashorta thomashorta left a comment

Choose a reason for hiding this comment

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

Approving it since Renan already reviewed this code (which was originally made by me on a different PR) but since he opened this PR he can't approve it again.

@thomashorta thomashorta merged commit 7da0f0a into release/25.0 Jun 3, 2024
20 checks passed
@thomashorta thomashorta deleted the issue/20908-reader-create-post-fab-release branch June 3, 2024 19:59
Copy link

sentry-io bot commented Jun 13, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ ApplicationNotResponding: ANR org.wordpress.android.ui.bloggingprompts.Bloggi... View Issue

Did you find this useful? React with a 👍 or 👎

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.

4 participants