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

[RNMobile] Inner Block Navigate upward through hierarchy #17496

Merged
merged 12 commits into from
Oct 8, 2019

Conversation

jbinda
Copy link
Contributor

@jbinda jbinda commented Sep 20, 2019

Description

PR is connected with #1315 in gutenberg-mobile.

Please also refer to:

It presents Icon on Floating Toolbar component witch allow to select parent of selected block. It is visible only when some of the Inner Block is selected

How has this been tested?

Manual test on Android and iOS plus CI tests

Screenshots

Note here that selection frames and opacity will be applied in PR connected with this issue

Kapture 2019-09-20 at 13 36 46

Types of changes

  • add new icon button component and logic to select parent of currently selected block

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.

@jbinda jbinda changed the title [RNMobile] Inner Block Navigate up through hierarchy [RNMobile] Inner Block Navigate upward through hierarchy Sep 20, 2019
@pinarol
Copy link
Contributor

pinarol commented Sep 25, 2019

@iamthomasbishop should we be showing the navigating up button at the outer most block? I think that button is just making floating toolbar disappear in that case since there's no where else to navigate to.

@iamthomasbishop
Copy link

Yes, we should show that up button, it essentially just escapes the nesting. My original prototype had an X icon in that case but feedback mentioned it was confusing so we kept the same icon.

@gziolo gziolo added the Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) label Sep 26, 2019
@jbinda
Copy link
Contributor Author

jbinda commented Sep 26, 2019

During development I have noticed that it is comfortable to use this navigation-up button to clear the selection (specially when it will be combined with dashed borders on InnerBlocks) so I'm happy with that decision. Thanks !

@gziolo
Copy link
Member

gziolo commented Sep 26, 2019

@mapk @jasmussen @kjellr - this PR is interesting to follow as it tries to solve the issue with navigating between the child and parent blocks. It would be great to align the approach between native and web mobile versions.

@jasmussen
Copy link
Contributor

Nice.

So in current Gutenberg web it's super tricky to select parent blocks. We have for web two tickets to address this.

  1. "Child first". You click/tap to select a block directly, and then "crawl upwards" in the hierarchy. Create breadcrumb bar for selecting parent block #17089 suggests a breadcrumb interface for this.

  2. "Parent first" — you select the parent block first to "unlock" the contents inside, digging downwards in the hierarchy. We have this enabled for mobile at the moment, and in a previous iteration we had it enabled for desktop too but paused that bit pending further polish potentially in a "selection tool": Visually indicate navigation mode, and make mouse accessible #17088

1 is what this PR seems to get at. The GIF (thanks so much for providing that!) suggests the implementation at the moment is a little barebones, that's fine.

However would you be opposed to changing this behavior slightly so that instead of providing a gray popover with an up arrow in context of the selected block, you provide a bottom-fixed position gray popover with breadcrumbs inside? I believe I've seen a mockup from @iamthomasbishop showing this. The behavior would in effect be the same, only instead of an up arrow selecting the parent block, it would be the block icon of the parent block shown, in context of the block icon of the currently selected block.

@jbinda
Copy link
Contributor Author

jbinda commented Sep 26, 2019

hi @jasmussen

Thank for reply. There is also second PR which provide feature to navigate down in the hierarchy after each click/press.

Also there are BreadCrumbs here and Hierarchy tree here provided by @dratwas

We are putting this all together right know and after merge all we have got it should cover all what you wrote.

@iamthomasbishop
Copy link

@jasmussen As @jbinda mentioned, this is just one part of a wider nested blocks effort – it's based off this prototype I worked on a while back.

With that in mind, our general approach is basically parent-first and this specific PR is facilitating the task of navigating from a nested child upward.

Also a side-note: the up arrow icon used here will end up being the subdirectory up icon. The toolbar will look like this at the end of the implementation.

image

@jasmussen
Copy link
Contributor

Stellar! Love that, Thomas, thanks for sharing. All 👍 from me!

@jbinda
Copy link
Contributor Author

jbinda commented Oct 3, 2019

@pinarol and @iamthomasbishop

I took return icon from material icon and rotate it. WDYT ?
I think it's look similar according to the figma example ?

portfolio_view

I think it's look similar according to the figma example

portfolio_view

@iamthomasbishop
Copy link

iamthomasbishop commented Oct 3, 2019

Awesome, that's exactly what I did in Figma 😄 I can also send an svg of the icon if need be, but that looks good to me! One request: is there a way we can shift the icon up 1px so that it's more optically centered? I don't love adding conditional styling if we can avoid, so I understand if we don't want to do this. Ignore this, let's just leave it 👍

@jbinda
Copy link
Contributor Author

jbinda commented Oct 3, 2019

ok I will try to edit it and move 1px up

@iamthomasbishop
Copy link

ok I will try to edit it and move 1px up

It might look odd, but if you're already doing it let's give it a try and can revert if it doesn't look right 😄

@jbinda
Copy link
Contributor Author

jbinda commented Oct 4, 2019

@iamthomasbishop

That's how it look with opacity on right pipe

@iamthomasbishop
Copy link

@jbinda Perfect, thank you! Can you do me a favor and check what size the tap area for the hierarchy up button is? I want to ensure we are affording at least 44x44 for each toolbar button.

@jbinda
Copy link
Contributor Author

jbinda commented Oct 7, 2019

Hi @iamthomasbishop

Please check the screenshot from inspector:

iOS

Android

The tap area has exactly 44px :)

@iamthomasbishop
Copy link

Perfect! Thank you for checking.

onClick={ () => this.props.onSelect( parentId ) }
icon={ NavigateUpSVG }
/>
<View style={ styles.pipe } />
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is fine for this one, but it should become the toolbar's border when we add the breadcrumbs

Copy link
Contributor

@koke koke left a comment

Choose a reason for hiding this comment

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

I think this is looking good. I'm wondering if we should be showing the up button on top level blocks, since tapping on it seems to remove any selection.

@jbinda
Copy link
Contributor Author

jbinda commented Oct 8, 2019

@koke thanks for review ! According to what you wrote - this is known issue with FloatingToolbar and here @lukewalczak makes progress to fix it

@jbinda
Copy link
Contributor Author

jbinda commented Oct 8, 2019

can I merge it then ?

@koke
Copy link
Contributor

koke commented Oct 8, 2019

Yes, if that will be handled on another pr go ahead and merge

@jbinda jbinda merged commit 7a393af into WordPress:master Oct 8, 2019
@jbinda jbinda deleted the rnmobile/navigate-up branch October 8, 2019 08:47
@youknowriad youknowriad added this to the Gutenberg 6.7 milestone Oct 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants