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

Display content information metrics #12191

Conversation

hypest
Copy link
Contributor

@hypest hypest commented Jun 13, 2020

Expands #12186 to include the WPAndroid UI to get and show the content information metrics.

Gutenberg-mobile PR: wordpress-mobile/gutenberg-mobile#2383

Follows this design, shared by @iamthomasbishop over Slack:

Screen Shot 2020-06-12 at 11 51 51 AM

Changes introduced:

  1. Adds a "Content info" menu time in the 3-dot menu while editing a post/page. The menu item triggers a call to get the latest content, including the content information.
  2. Upon receiving the latest content and info, a popup dialog displays the information

To test:

  1. Run the app and open an existing post, preferably a long one
  2. While the spinning progress bar is still on, tap on the "Content info" menu item inside the 3-dot menu
  3. Notice the "Editor is still loading" toast being shown
  4. Wait for the post to finish loading
  5. Tap on the "Content info" menu item again
  6. Notice the popup dialog with the block/word/character counts displayed

PR submission checklist:

  • I have considered adding unit tests where possible.
  • 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.

@hypest hypest added this to the 15.2 milestone Jun 13, 2020
@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Jun 13, 2020

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Jun 13, 2020

You can test the changes on this Pull Request by downloading the APK here.

@hypest
Copy link
Contributor Author

hypest commented Jun 13, 2020

(replying to this comment)

Is it possible to only add the plural ("s") when the given type's value > 1? In other words "1 block" vs. "2 blocks", etc.

👋 @iamthomasbishop , to answer the same for Android, it won't be very easy because we don't currently support plural variants on GlotPress. We usually workaround that by having two separate strings defined, one for singular and one for plural. Thing is, in the sentence at hand, there are three numbers that can individually be singular or plural and even though we could concatenate them as three separate sections, that's not recommended as we can't be sure if it will be correct for all locales. It's better to send the full sentence to the translators, but that will mean we'll need some complex logic to define and use those strings. Not sure it's worth it.

Instead, and again talking about the WPAndroid case where I've implemented the popup dialog design, what do you think about using plurals only but formatting the whole string like this:

Blocks: number
Words: number
Characters: number

I think that would read OK for numbers being 1 too.

@SergioEstevao SergioEstevao self-requested a review June 15, 2020 15:25
Copy link
Contributor

@SergioEstevao SergioEstevao left a comment

Choose a reason for hiding this comment

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

I tested this in terms of functionality in the main apps and it's working great!
I will leave it to @mchowning to check the code.

Make the strings used uniform with iOS and web.
@SergioEstevao SergioEstevao merged commit fda4314 into gutenberg/display_content_metrics Jun 16, 2020
@SergioEstevao SergioEstevao deleted the gutenberg/display_content_metrics-hypest branch June 16, 2020 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants