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 #20910

Closed
wants to merge 10 commits into from

Conversation

thomashorta
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

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

Generated by 🚫 Danger

Copy link

sonarcloud bot commented May 29, 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

@wpmobilebot
Copy link
Contributor

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
Versionpr20910-944f4ed
Commit944f4ed
Direct Downloadwordpress-prototype-build-pr20910-944f4ed.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

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
Versionpr20910-944f4ed
Commit944f4ed
Direct Downloadjetpack-prototype-build-pr20910-944f4ed.apk
Note: Google Login is not supported on these builds.

Copy link

codecov bot commented May 29, 2024

Codecov Report

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

Project coverage is 41.04%. Comparing base (4085bf7) to head (944f4ed).
Report is 61 commits behind head on trunk.

Files Patch % Lines
.../android/viewmodel/main/WPMainActivityViewModel.kt 84.84% 1 Missing and 4 partials ⚠️
...ess/android/ui/main/utils/MainCreateSheetHelper.kt 97.22% 0 Missing and 1 partial ⚠️
...ava/org/wordpress/android/util/SiteUtilsWrapper.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            trunk   #20910      +/-   ##
==========================================
+ Coverage   41.00%   41.04%   +0.03%     
==========================================
  Files        1512     1514       +2     
  Lines       69401    69442      +41     
  Branches    11446    11457      +11     
==========================================
+ Hits        28459    28502      +43     
+ Misses      38361    38357       -4     
- Partials     2581     2583       +2     

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

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 PR, @thomashorta. It's working as expected and code LGTM. I've left a couple of optional suggestions, so I'm approving it.

@RenanLukas
Copy link
Contributor

@RenanLukas RenanLukas closed this May 31, 2024
@jkmassel jkmassel deleted the issue/20908-reader-create-post-fab branch October 17, 2024 19:00
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.

[Reader] Show "Create Post" FAB in Reader
4 participants