Gutenberg-mobile: "Add New Block" indicator isn't shown when title field is focused

Created on 20 Feb 2019  ·  6Comments  ·  Source: wordpress-mobile/gutenberg-mobile

Expected behavior

If I tap the Inserter toggle to choose a new block while focused on the title, I expect the "add new block" indicator to show, just like when in the body of the post.

Actual behavior

Indicator isn't shown while focused on title.

Example:

screenshot_20190220-151630

Steps to reproduce (iOS and Android):

  1. Start new post in mobile GB
  2. Add or focus title
  3. Tap (+) Inserter toggle
  4. Notice that there is no position indicator

Potentially related issue: https://github.com/wordpress-mobile/gutenberg-mobile/issues/543

Outstanding Tasks

  • [ ] Show ABH indicator when immediately adding a block to a new post (context)
[Type] Bug

Most helpful comment

It'd be best for consistency to show the ABH bar. That said, since the post is empty, there can't be too much confusion about where the new block will be added so, this now feels less of a priority, compared to other Open Beta issues. So, let's keep this open and we'll tackle it later, cool?

All 6 comments

This was closed automatically by the PR #1219, but I'm reopening it because there is still a remaining issue to be resolved.

When an empty post is first opened, until the user interacts with the "Start writing..." portion of the post in some way (i.e., tapped on it), there will be no "Add Block Here" indicator shown when the user opens the add block bottom sheet—this includes if the user has only interacted with the post title. The technical reason for this is that the ABH indicator is attached to our block holders, but until the user taps on the "Start writing..." placeholder text in a new post, the post does not actually contain any blocks (it just has a RichText field that is replaced with a block onTouch), so there is nothing to show an ABH indicator.

This can be fixed (possibly without too much difficulty), but before going down that path I wanted to see how we wanted to approach this. On one hand, not having the indicator when a new post is first created does not seem like a big deal since the entire post content ("Start writing...") will be replaced with whatever block is added. On the other hand, this is inconsistent with how this is handled in other cases. For example, if the user has a post with only a single empty paragraph block (which is what it _looks_ like when you open a new post, but the empty paragraph block is only added once you actually interact with the post content) then the ABH indicator will appear.

To be more precise, now that the initial fix for this issue is merged we have this behavior:

  1. Open new empty post in WPAndroid/WPiOS
  2. Observe that the post title is selected, but do not select the content section ("Start writing...")
  3. Click the ➕ icon to open the add new post bottom sheet
  4. Observe that the ABH indicator IS NOT shown
  5. Dismiss the add new post bottom sheet
  6. Tap on "Start writing..." to select it.
  7. Tap on the post title to re-select it (the post screen should appear the same as it appeared at Step 2, but under the hood there is now an empty paragraph block in the content area due to Step 6)
  8. Click the ➕ icon to open the add new post bottom sheet
  9. Observe that the ABH indicator IS shown

My take is that we probably do want the ABH indicator to show at ⬆️ Step 4 ⬆️ for the sake of consistency, but that this should not be considered a blocker for the beta release.

@iamthomasbishop , what do you think?

Fwiw, I see what you're saying, but I still think the ideal is to be consistent in terms of behavior and always show the indicator. Thanks for the detailed information on the flow!

I still think the ideal is to be consistent in terms of behavior and always show the indicator.

👍 Sounds good. I'll work on getting the ABH showing up in this last scenario (empty post where the post content has not been interacted with) and I think that should close out this issue.

@hypest Any thoughts on whether the remaining edge case needs to be handled for the open beta? Or should the other issues be considered higher priority? My inclination would be to keep this card open so we are sure to address this edge case but to move it from the open beta column.

It'd be best for consistency to show the ABH bar. That said, since the post is empty, there can't be too much confusion about where the new block will be added so, this now feels less of a priority, compared to other Open Beta issues. So, let's keep this open and we'll tackle it later, cool?

Not sure if you're actively working on this one @mchowning , if so, better to move the ticket to the "In Progress" column in the project board, otherwise let's un-assign the ticket. Thanks!

Was this page helpful?
0 / 5 - 0 ratings