Skip to content

Display content information metrics #2380

Merged
SergioEstevao merged 20 commits intodevelopfrom
issue/content_info
Jun 16, 2020
Merged

Display content information metrics #2380
SergioEstevao merged 20 commits intodevelopfrom
issue/content_info

Conversation

@SergioEstevao
Copy link
Copy Markdown
Contributor

@SergioEstevao SergioEstevao commented Jun 12, 2020

Fixes #506

This PR changes the bridge method to display the content information metrics about the content being edited:

iOS Android

To test:

  • Start the demo app
  • iOS: Press the ... button on the top right, For Android you need to use the main app.
  • Check if the content metrics show on the top of the action sheet.

Notes:
I considered implementing this in the main apps only, but in the end, I thought it was better to use a single source of the metrics for all three implementations: web, iOS, Android.
If we implemented in the main apps we will need to replicate the code in three places, and the only marginal advantage could be some performance, wich I don't think it's worth the maintenance costs.

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@SergioEstevao SergioEstevao added the HACK week HACK week June 2020 label Jun 12, 2020
@SergioEstevao SergioEstevao added this to the 1.31 milestone Jun 12, 2020
@peril-wordpress-mobile
Copy link
Copy Markdown

peril-wordpress-mobile bot commented Jun 12, 2020

Wanna run full suite of Android and iOS UI tests? Click here and 'Approve' CI job!

@iamthomasbishop
Copy link
Copy Markdown
Contributor

iamthomasbishop commented Jun 12, 2020

Based on some discussion on Slack, I whipped up some options to discuss. For reference, here are the items that the web editor provides:

  • Words
  • Headings
  • Paragraph
  • Blocks

We have character and word count on Aztec (the "classic" editor) but not on mobile Gutenberg, so we are looking at some or all of the following:

  • Words
  • Characters
  • Headings
  • Paragraphs
  • Blocks

Here are the options, based on the above:

  • Current: no content info (note: currently Aztec provides word and character counts)
  • Option 1: blocks, words, characters
  • Option 2: blocks, paragraphs, words, characters
  • Option 3: blocks, headings, paragraphs, words, characters

To keep things simple and build upon what already exists for users on Aztec, I think the best approach is to start with Option 1 (blocks, words, characters). Option 3 makes sense if we want to fully align with core and Option 2 feels stuck in-between.

// cc @SergioEstevao @hypest

@SergioEstevao
Copy link
Copy Markdown
Contributor Author

@iamthomasbishop I implemented option 1 above and just updated the screenshot of the description.

@iamthomasbishop
Copy link
Copy Markdown
Contributor

@SergioEstevao 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.

@hypest
Copy link
Copy Markdown
Contributor

hypest commented Jun 13, 2020

👋 @SergioEstevao , I've opened this gb-mobile PR and this WPAndroid PR (targeting your PRs) to complete the Android side support of the feature. Feel free to merge to your PRs before or after they get reviewed.

Notice, I've targeted the 15.2 WP apps milestone as I don't think the feature can be merged in time for the 15.1. You might want to adjust the milestone and the related RELEASE-NOTES.txt mention on your PRs too.

@SergioEstevao
Copy link
Copy Markdown
Contributor Author

@SergioEstevao 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 so at the moment in Aztec we everything in the plural always: Ex: 1 words, 1 character.

This is because of a problem with WordPress translating tools (Glotpress) that don't support plurality as you can read here: wordpress-mobile/WordPress-iOS#6327

I was trying to go around the issue by introducing the (s) what do you think it's the best way to proceed?

Copy link
Copy Markdown
Contributor

@etoledom etoledom left a comment

Choose a reason for hiding this comment

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

Looks great! 🎉

I added a small suggestion as code comment but nothing blocking.
Great job @SergioEstevao 🙏

Copy link
Copy Markdown
Contributor

@etoledom etoledom left a comment

Choose a reason for hiding this comment

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

Thank you for the update, looks great 🎉

iOS ✅

Copy link
Copy Markdown
Contributor

@mchowning mchowning left a comment

Choose a reason for hiding this comment

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

Looks good. I had one question about the timeout we're using for the countdown latch, but it's certainly not a blocking issue.

@SergioEstevao SergioEstevao merged commit cde02f8 into develop Jun 16, 2020
@SergioEstevao SergioEstevao deleted the issue/content_info branch June 16, 2020 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

HACK week HACK week June 2020

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Display word, character count on overflow menu Action Sheet

5 participants