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

Add multi select inspector #1811

Closed
wants to merge 1 commit into from
Closed

Conversation

ellatrix
Copy link
Member

@ellatrix ellatrix commented Jul 8, 2017

This is very much a WIP, but the idea is to add an inspector for multi-select as well. This could be useful for aligning multiple blocks at once, converting multiple paragraphs to a block quote or verse form...

Still needs some thinking around how the API would look like.

/**
* WordPress dependencies
*/
import { __ } from 'i18n';
Copy link
Member

Choose a reason for hiding this comment

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

Note with #2172, these need to be updated to prefix the dependencies with @wordpress/. You will need to perform a rebase against the latest version of master and apply your changes:

git fetch origin
git rebase origin/master

@ellatrix
Copy link
Member Author

ellatrix commented Aug 9, 2017

Rebased this one. @jasmussen So I guess instead of adding stuff to the sidebar, I'll try to keep the toolbar inline and offer the same block switcher and alignment options for multiple paragraphs.

@codecov
Copy link

codecov bot commented Aug 9, 2017

Codecov Report

Merging #1811 into master will decrease coverage by 0.19%.
The diff coverage is 1.72%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #1811     +/-   ##
=========================================
- Coverage   34.07%   33.88%   -0.2%     
=========================================
  Files         192      193      +1     
  Lines        5675     5711     +36     
  Branches      996     1006     +10     
=========================================
+ Hits         1934     1935      +1     
- Misses       3165     3190     +25     
- Partials      576      586     +10
Impacted Files Coverage Δ
editor/modes/visual-editor/block.js 0% <ø> (ø) ⬆️
editor/header/index.js 0% <0%> (ø) ⬆️
blocks/library/paragraph/index.js 28.57% <0%> (-4.77%) ⬇️
editor/sidebar/index.js 0% <0%> (ø) ⬆️
editor/sidebar/header.js 0% <0%> (ø) ⬆️
editor/block-toolbar/index.js 0% <0%> (ø) ⬆️
editor/block-switcher/index.js 0% <0%> (ø) ⬆️
editor/block-settings-menu/index.js 0% <0%> (ø) ⬆️
editor/sidebar/multi-block-inspector/index.js 0% <0%> (ø)
editor/selectors.js 93.16% <14.28%> (-3.59%) ⬇️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1400611...0769a4f. Read the comment docs.

@ellatrix
Copy link
Member Author

ellatrix commented Aug 9, 2017

I also think we should remove the blue box on top entirely then. We can offer everything inline and more advanced things on the side. Would also be very nice on mobile with a "select" button to select multiple blocks.

@jasmussen
Copy link
Contributor

Love the idea behind this 🌟 🌟 🌟 🌟 🌟

Also agree with this:

I also think we should remove the blue box on top entirely then. We can offer everything inline and more advanced things on the side. Would also be very nice on mobile with a "select" button to select multiple blocks.

I encountered a little flickering, though. Seemed to happen more often when the document tab was active. Tried to record a video:

flickering

@ellatrix
Copy link
Member Author

ellatrix commented Aug 9, 2017

Strange, this should not affect the multi selection itself. Anyway, there's still some how left here. I'll move it inline. :)

@ellatrix
Copy link
Member Author

ellatrix commented Oct 6, 2017

Redoing this whole thing so it's inline... WIP. Still need to add the formatting toolbar and allow the inspector to be the same for multi select.

@WordPress WordPress deleted a comment from coveralls Oct 6, 2017
@ellatrix
Copy link
Member Author

ellatrix commented Oct 6, 2017

@mtias @aduth @youknowriad This is going to become quite messy if we keep the current API that is a single edit method returning an array and filling in slots. I would need to force the focus props to true for the first selected block and reset setAttributes etc. to allow updating all blocks from this one edit method.

I see two solutions:

  • We have separate methods, e.g. save(), edit(), blockControls() and inspectorControls(), or something like that.
  • We have a separate method for multi-select outside the edit() method. This is an inferior solution though, as we're splitting it up only partially, and the block implementor needs to duplicate all inspector controls to this method if they are the same.

@ellatrix
Copy link
Member Author

ellatrix commented Oct 9, 2017

Okay, I'm going to split this up into two or three PR so we can move forward in the meantime with other improvements.

@ellatrix ellatrix mentioned this pull request Oct 9, 2017
3 tasks
@gziolo gziolo added [Status] In Progress Tracking issues with work in progress [Feature] Block Multi Selection The ability to select and manipulate multiple blocks labels Jan 27, 2018
@gziolo
Copy link
Member

gziolo commented Jan 27, 2018

@iseulde, can you confirm that this one is still relevant?

@gziolo gziolo added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Jan 27, 2018
@ellatrix
Copy link
Member Author

Yes! I'll redo it a bit.

@gziolo gziolo removed the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Feb 5, 2018
@ZebulanStanphill
Copy link
Member

Should this be closed since #3535 exists?

@gziolo
Copy link
Member

gziolo commented Aug 10, 2018

I'm closing it in favor of #7635 which is more up to date. Let's iterate there.

@gziolo gziolo closed this Aug 10, 2018
@gziolo gziolo deleted the try/multi-select-inspector branch August 10, 2018 05:44
@gziolo
Copy link
Member

gziolo commented Aug 10, 2018

Actually, it's different than #7635. However, there is #3535 which is very similar and more up to date. In addition, we can easily reuse patterns which will come out of #7635 to apply to inspector controls, too as noted by @iseulde in this comment #7635 (comment) :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block Multi Selection The ability to select and manipulate multiple blocks [Status] In Progress Tracking issues with work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants