Skip to content
This repository was archived by the owner on Jul 9, 2026. It is now read-only.

Scroll to new-block indicator - #3414

Closed
hypest wants to merge 12 commits into
trunkfrom
issue/1672-scroll-to-new-block-indicator
Closed

hypest wants to merge 12 commits into
trunkfrom
issue/1672-scroll-to-new-block-indicator

Conversation

@hypest

@hypest hypest commented Apr 23, 2021 •

Copy link
Copy Markdown
Contributor

Fixes #1672

Adds automatic scrolling to where the block inserter is on native mobile, when adding a new block (Block Picker active). Not covering the case of adding a new block inside a group/innerblock block.

Gutenberg PR: WordPress/gutenberg#31144

To test:
TBD

PR submission checklist:

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

@peril-wordpress-mobile

peril-wordpress-mobile Bot commented Apr 23, 2021 •

Copy link
Copy Markdown

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

@hypest

hypest commented Apr 24, 2021 •

Copy link
Copy Markdown
Contributor Author

Note to self: Looks like one iOS UI test (should add a file to the block) is failing because the test picks up a parent element with accessibility name Post title. Welcome to Gutenberg! File Block. Row 1 Paragraph Block. Row 2. Empty Add paragraph block and tapping on it creates a new paragraph block just like tapping on the empty space under the blocks. I debugged the //*[contains(@${ this.accessibilityIdXPathAttrib }, " Block. Row ")] xpath locator using the https://github.com/appium/ruby_console (linked via http://appium.io/docs/en/writing-running-appium/finding-elements/) with appium.txt contents:

[caps]
platformName = "iOS"
os = "iOS"
deviceOrientation = "portrait"
automationName = "XCUITest"
deviceName = "iPhone 11"
platformVersion = "14.4"

and this REPL commands:

block=driver.find_element(:xpath, "//*[contains(@name, \" Block. Row \")]")
block.name

the last of which outputted: "Post title. Welcome to Gutenberg! File Block. Row 1 Paragraph Block. Row 2. Empty Add paragraph block".

Edit: same block is found on current gb-mobile develop, so the issue must be different. I suspect the change to the list footer that enlarged the tapping area for appending a new block.

Another note to self: Some commands to try and cleanup the ios build to fix the LoadError - cannot load such file -- cocoapods/installer/podfile_validator issue:

rm -Rf gutenberg/packages/react-native-editor/ios/Pods/
rm -Rf gutenberg/packages/react-native-editor/ios/vendor/bundle/ruby/
cd gutenberg/packages/react-native-editor/io && pod install --repo-update

System Ruby was 2.6.0 while the gb-mobile nested one was 2.6.0 so, went ahead and rbenv install 2.6.0 && rbenv global 2.6.0 too, followed by gem install bundler. With WordPress/gutenberg@67f14b2 I revised the helper method to return the last (hopefully the innermost) of the elements found but narrowing down to Row 1 at least.


For some reason, the enlarged block appender in the list footer is triggered on iOS when clicking the first component detected using the Block. Row accessibility pattern. With WordPress/gutenberg@c2856b5 I've revised the UI tests helper method to hopefully(?) grab the innermost component that is the actual block.

@hypest
hypest force-pushed the issue/1672-scroll-to-new-block-indicator branch from fa323c2 to 55b9407 Compare April 25, 2021 02:22
@hypest
hypest marked this pull request as ready for review June 16, 2021 15:43
@hypest
hypest requested a review from dcalhoun June 16, 2021 15:43
@dcalhoun
dcalhoun removed their request for review September 1, 2022 18:03
@hypest

hypest commented May 14, 2024

Copy link
Copy Markdown
Contributor Author

Closing since the functionality is already in at this point.

@hypest hypest closed this May 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scroll to new block indicator when adding block

1 participant