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

Sibling Inserter: Try reduced animation time and line indicator #22813

Closed
wants to merge 1 commit into from

Conversation

apeatling
Copy link
Contributor

@apeatling apeatling commented Jun 1, 2020

From: #22801

Description

This is a test for a concept introduced in #22801 (comment) to make the sibling inserter more discoverable.

I've spun this up quickly to show a proof of concept so folks can try it out and discuss.

  • The animation for display of the sibling inserter has been reduced by half.
  • A line has been added to indicate where the new block would be inserted.
  • There has been no change to the target area, but the line helps with orientation.
  • The cursor is no longer a text caret when hovering over the target area, but instead the default cursor. I expect there is some history to this setup, but I'm including this change anyway.
  • If your editor does not have a white background this will not look good, but for the sake of trying this out I think it's okay for now.

Screenshots

2020-06-01 16 15 05

How has this been tested?

Not tested.

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.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.

…he inserter more discoverable. This is for testing a concept introduced in #22801
@apeatling apeatling added the [Type] Experimental Experimental feature or API. label Jun 1, 2020
@apeatling apeatling self-assigned this Jun 1, 2020
@apeatling apeatling marked this pull request as draft June 1, 2020 23:16
@github-actions
Copy link

github-actions bot commented Jun 1, 2020

Size Change: +71 B (0%)

Total Size: 1.11 MB

Filename Size Change
build/block-editor/style-rtl.css 11.4 kB +37 B (0%)
build/block-editor/style.css 11.4 kB +34 B (0%)
ℹ️ View Unchanged
Filename Size Change
build/a11y/index.js 1.14 kB 0 B
build/annotations/index.js 3.62 kB 0 B
build/api-fetch/index.js 3.4 kB 0 B
build/autop/index.js 2.83 kB 0 B
build/blob/index.js 620 B 0 B
build/block-directory/index.js 6.48 kB 0 B
build/block-directory/style-rtl.css 787 B 0 B
build/block-directory/style.css 787 B 0 B
build/block-editor/index.js 106 kB 0 B
build/block-library/editor-rtl.css 7.61 kB 0 B
build/block-library/editor.css 7.61 kB 0 B
build/block-library/index.js 119 kB 0 B
build/block-library/style-rtl.css 7.68 kB 0 B
build/block-library/style.css 7.68 kB 0 B
build/block-library/theme-rtl.css 684 B 0 B
build/block-library/theme.css 686 B 0 B
build/block-serialization-default-parser/index.js 1.88 kB 0 B
build/block-serialization-spec-parser/index.js 3.1 kB 0 B
build/blocks/index.js 48.1 kB 0 B
build/components/index.js 190 kB 0 B
build/components/style-rtl.css 19.5 kB 0 B
build/components/style.css 19.5 kB 0 B
build/compose/index.js 9.32 kB 0 B
build/core-data/index.js 11.4 kB 0 B
build/data-controls/index.js 1.29 kB 0 B
build/data/index.js 8.43 kB 0 B
build/date/index.js 5.47 kB 0 B
build/deprecated/index.js 771 B 0 B
build/dom-ready/index.js 568 B 0 B
build/dom/index.js 3.11 kB 0 B
build/edit-navigation/index.js 7.88 kB 0 B
build/edit-navigation/style-rtl.css 857 B 0 B
build/edit-navigation/style.css 856 B 0 B
build/edit-post/index.js 302 kB 0 B
build/edit-post/style-rtl.css 5.43 kB 0 B
build/edit-post/style.css 5.43 kB 0 B
build/edit-site/index.js 14.1 kB 0 B
build/edit-site/style-rtl.css 2.96 kB 0 B
build/edit-site/style.css 2.96 kB 0 B
build/edit-widgets/index.js 8.88 kB 0 B
build/edit-widgets/style-rtl.css 2.4 kB 0 B
build/edit-widgets/style.css 2.4 kB 0 B
build/editor/editor-styles-rtl.css 425 B 0 B
build/editor/editor-styles.css 428 B 0 B
build/editor/index.js 44.6 kB 0 B
build/editor/style-rtl.css 4.26 kB 0 B
build/editor/style.css 4.27 kB 0 B
build/element/index.js 4.64 kB 0 B
build/escape-html/index.js 733 B 0 B
build/format-library/index.js 7.71 kB 0 B
build/format-library/style-rtl.css 502 B 0 B
build/format-library/style.css 502 B 0 B
build/hooks/index.js 2.13 kB 0 B
build/html-entities/index.js 622 B 0 B
build/i18n/index.js 3.56 kB 0 B
build/is-shallow-equal/index.js 711 B 0 B
build/keyboard-shortcuts/index.js 2.51 kB 0 B
build/keycodes/index.js 1.94 kB 0 B
build/list-reusable-blocks/index.js 3.12 kB 0 B
build/list-reusable-blocks/style-rtl.css 226 B 0 B
build/list-reusable-blocks/style.css 226 B 0 B
build/media-utils/index.js 5.29 kB 0 B
build/notices/index.js 1.79 kB 0 B
build/nux/index.js 3.4 kB 0 B
build/nux/style-rtl.css 616 B 0 B
build/nux/style.css 613 B 0 B
build/plugins/index.js 2.56 kB 0 B
build/primitives/index.js 1.5 kB 0 B
build/priority-queue/index.js 789 B 0 B
build/redux-routine/index.js 2.85 kB 0 B
build/rich-text/index.js 14.8 kB 0 B
build/server-side-render/index.js 2.68 kB 0 B
build/shortcode/index.js 1.7 kB 0 B
build/token-list/index.js 1.28 kB 0 B
build/url/index.js 4.02 kB 0 B
build/viewport/index.js 1.84 kB 0 B
build/warning/index.js 1.14 kB 0 B
build/wordcount/index.js 1.17 kB 0 B

compressed-size-action

@ZebulanStanphill
Copy link
Member

As stated in the comment above the cursor: text; CSS line:

// Clicks on the inserter are redirected to the nearest tabbable element

The cursor appearance should reflect what clicking it will do, so as long as this special click redirection behavior remains, I think the text cursor should stay.

@ZebulanStanphill ZebulanStanphill added [Feature] Inserter The main way to insert blocks using the + button in the editing interface [Type] Technical Prototype Offers a technical exploration into an idea as an example of what's possible and removed [Type] Experimental Experimental feature or API. labels Jun 2, 2020
@@ -339,7 +339,8 @@
justify-content: center;

// Clicks on the inserter are redirected to the nearest tabbable element.
cursor: text;
//cursor: text;
cursor: default;
Copy link
Contributor

Choose a reason for hiding this comment

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

If we aren't going to change the cursor we could just remove these lines.

@jasmussen
Copy link
Contributor

Thank you for the PR! It's always the fastest way to improve things.

The animation for display of the sibling inserter has been reduced by half.

This seems, even on its own, like a fine improvement.

The reason it was added in the first place is that the sibling inserter relies on the space between blocks, which varies from theme to theme, and may even be non-existent as we move closer to a wysiwyg experience (#22208 is not meant to be merged, but just for conversation).

Specifically, this — or worse — might happen:

spacer

I'd love to find a better behavior for invoking the sibling inserter than hovering between two blocks, because of all it can conflict with.

A line has been added to indicate where the new block would be inserted.

The cursor is no longer a text caret when hovering over the target area, but instead the default cursor. I expect there is some history to this setup, but I'm including this change anyway.

Zebulan above provides the context. But the reason is that if you click in this space, you actually set focus in the nearest text:

sibling

The line showing up by default actually makes that less clear.

We used to have a line that extended from the plus when the plus itself was hovered — do you think this would be sufficient? And if we do that, we should make it blue and the same style as the blue line that shows up on drag and drop and when inserting from the block library (#21475).

If your editor does not have a white background this will not look good, but for the sake of trying this out I think it's okay for now.

If we add the line, we can probably fix this with a background-clip trick as is used here.

@MichaelArestad
Copy link
Contributor

I did some fiddling to find the ""magic time" and I find faster is a little better.

What I did locally, was remove the delay built into the animation code (0-80%) and instead added it like this:

animation: block-editor-inserter__toggle__fade-in-animation-delayed 0.075s 0.04s ease;

And that timing felt pretty good. When moving a cursor fairly quickly, it tends not to show up. When moving slower, it still feels good to me.

That all said, I think something like this could be an answer that provides a target before my cursor gets there removing guesswork.

@jasmussen
Copy link
Contributor

And that timing felt pretty good. When moving a cursor fairly quickly, it tends not to show up. When moving slower, it still feels good to me.

This feels like a sufficiently simple and basic approach, with a high yield, that it would be great to try on its own — it'll likely sail right through and improve things, and does not preclude further enhancements. Want to make a PR, Michael? You can assign me as reviewer if you like.

@apeatling
Copy link
Contributor Author

+1 to @MichaelArestad's approach above to start, let's open a PR for that and work from there. I also like the suggestion in #22867 but starting with small timing improvements seems wise to get this moving.

@MichaelArestad
Copy link
Contributor

Want to make a PR, Michael? You can assign me as reviewer if you like.

@jasmussen On it.

@apeatling
Copy link
Contributor Author

Closing this one in favor of #23043

@apeatling apeatling closed this Jun 16, 2020
@jasmussen
Copy link
Contributor

This issue may actually have been fixed in #23046

@youknowriad youknowriad deleted the fix/sibling-inserter-delay branch June 16, 2020 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Inserter The main way to insert blocks using the + button in the editing interface [Type] Technical Prototype Offers a technical exploration into an idea as an example of what's possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants