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

Reusable Blocks: Display reusable blocks in Autocompleter #3791

Closed
noisysocks opened this issue Dec 3, 2017 · 5 comments
Closed

Reusable Blocks: Display reusable blocks in Autocompleter #3791

noisysocks opened this issue Dec 3, 2017 · 5 comments
Assignees
Labels
[Feature] Inserter The main way to insert blocks using the + button in the editing interface [Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) [Type] Enhancement A suggestion for improvement.

Comments

@noisysocks
Copy link
Member

Reusable Blocks that the user has created should appear in the Autocompleter when the user types in the Reusable Block's title.

screen shot 2017-12-04 at 10 38 08

This patch that @youknowriad wrote is a good start to doing this.

@noisysocks noisysocks added [Feature] Blocks Overall functionality of blocks [Type] Enhancement A suggestion for improvement. labels Dec 3, 2017
@noisysocks noisysocks self-assigned this Dec 3, 2017
@noisysocks noisysocks added [Feature] Inserter The main way to insert blocks using the + button in the editing interface and removed [Feature] Blocks Overall functionality of blocks labels Dec 4, 2017
@youknowriad
Copy link
Contributor

The patch uses the "editor"'s module state in the "blocks" module which is not great. But it's solvable by moving the BlockAutocomplete to a BlockListBlock component as a wrapper to BlockEdit for default blocks. cc @aduth

@aduth
Copy link
Member

aduth commented Dec 4, 2017

But it's solvable by moving the BlockAutocomplete to a BlockListBlock component as a wrapper to BlockEdit for default blocks.

Noting that this could potentially be implemented a few ways:

  • From VisualEditor, would need a callback for rendering a single item in a block list to wrap the rendered block element
  • From the BlockEdit component
  • As a filter hook on BlockEdit

The issue with the second and third options is that it still assumes an editor state from within the blocks directory (where they are implemented).

This could tie into needing to refactor state to more consolidate generalized blocks and editor behaviors, while separating out post editor specific behaviors.

@aduth aduth added the [Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) label Dec 19, 2017
@noisysocks
Copy link
Member Author

From VisualEditor, would need a callback for rendering a single item in a block list to wrap the rendered block element

Could you elaborate on this, @aduth? Not sure what you mean by a callback.

The issue with the second and third options is that it still assumes an editor state from within the blocks directory (where they are implemented).

We could add the BlockEdit filter in the editor module. I note that there's already a editor hook defined here.

@noisysocks
Copy link
Member Author

I built out a POC of the third option @aduth listed (using a filter hook on BlockEdit) over in #4769. Let me know what you think.

@noisysocks
Copy link
Member Author

#6067 fixed this.

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 [Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants