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

Replace Starter Content modal with inserter panel #66836

Open
wants to merge 5 commits into
base: trunk
Choose a base branch
from

Conversation

ellatrix
Copy link
Member

@ellatrix ellatrix commented Nov 7, 2024

What?

Builds on #66819.
Previously: #61489.

Closes #63865

Why?

The modal is super annoying, let's see if the inserter + zoom out is less annoying. You can double click the canvas to exit also.

A nice side effect is also that you can inserter multiple patterns, or browser other categories.

How?

Uses #61489.

Testing Instructions

Create a new page in the admin or site editor. Click patterns from this category.

Testing Instructions for Keyboard

Screenshots or screencast

Screenshot 2024-11-07 at 19 12 42

Copy link

github-actions bot commented Nov 7, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ellatrix <[email protected]>
Co-authored-by: draganescu <[email protected]>
Co-authored-by: mikachan <[email protected]>
Co-authored-by: youknowriad <[email protected]>
Co-authored-by: jasmussen <[email protected]>
Co-authored-by: juanfra <[email protected]>
Co-authored-by: jameskoster <[email protected]>
Co-authored-by: annezazu <[email protected]>
Co-authored-by: mtias <[email protected]>
Co-authored-by: MaggieCabrera <[email protected]>
Co-authored-by: getdave <[email protected]>
Co-authored-by: scruffian <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Base automatically changed from try/add-starter-content-category-inserter to trunk November 11, 2024 09:44
@ellatrix ellatrix force-pushed the remove/starter-content-modal branch from 1560e59 to 5ac2a48 Compare November 11, 2024 09:53
@draganescu
Copy link
Contributor

Are there situations when this is not supposed to work? For me checking out this branch and making a new page just lands me in the edior - no modal, but no zoom out either :)

@youknowriad
Copy link
Contributor

Screenshot 2024-11-11 at 1 49 40 PM
  • Starter content appears twice for me in the sidebar.
  • I would love if we can remove the initial animations (I know it can be hard)

Copy link
Member

@mikachan mikachan left a comment

Choose a reason for hiding this comment

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

I'm seeing slightly different behaviours between themes. When using Pixl, no patterns seem to load in the inserter. This theme only has one eligible pattern (footer), but it would be nice to improve this experience even when there are no patterns:

Screen.Recording.2024-11-11.at.12.48.44.mov

When using Twenty Twenty-Five, the patterns show and everything seems to work (other than the Starter Content duplication), although it's a little slow. I'm not sure if there are any UX tricks we could use here to make this not as obvious:

Screen.Recording.2024-11-11.at.13.00.33.mov

@ellatrix
Copy link
Member Author

Starter content appears twice for me in the sidebar.

Ah, looks like a rebase error

@draganescu
Copy link
Contributor

I retested this and figured I need to have the pref on. Cool. Aside from what @youknowriad found about the duplication it seems to be working.

)
) {
categories.unshift( starterPatternsCategory );
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This is causing the duplication.

Copy link
Contributor

@draganescu draganescu left a comment

Choose a reason for hiding this comment

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

I've pushed a small deletion and this works for me now. Left a comment on.a weird change, but otherwise it's great/

'Shows starter patterns when creating a new page.'
) }
label={ __( 'Show starter patterns' ) }
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did we remove the condition?

@youknowriad
Copy link
Contributor

@richtabor @jasmussen @jameskoster Can we get some design feedback here?

One thing I wanted to mention is that if we land this, we should probably do the same for the modal we have for template creation.

</div>
</Modal>
);
}

export default function StartPageOptions() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we just remove this component and transform it into a hook?

category: 'core/starter-content',
} );
}
}, [ shouldEnable, setIsInserterOpened ] );
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 the way this is built, it won't reopen the panel if you use the command palette to "create a new page" when you're already creating a new page. I think we should probably add the postId as a dependency.

@jasmussen
Copy link
Contributor

I think this can work. I also think further steps can be taken in terms of figuring out the full "add new page" flow: perhaps it can even start in zoomed out mode, with the starter content tab open, and that becomes the replacement for the modal. But so as to not replicate the frustration that is leading to the removal of the modal, definitely something to explore separately, see how it feels.

Important to understand for all involved, though, the problem we are trying to solve here is that of making it easy for anyone authoring an entirely new page, that your theme comes with starter content that provides an excellent shortcut to your page content.

A couple of additional thoughts/questions:

  • If a theme doesn't offer starter content, does other starter content still show?
  • It should be Starter content, not Starter Content (or it can be a better term altogether). Generally always use sentence case. This is correct in trunk but off in this branch.

It's good that "All", "My patterns", and "Starter content" are at the top:

Screenshot 2024-11-27 at 09 21 33

Should "Featured" also be there? Or is that a custom category?

To explain how these categories are special, and not subject to the usual alphabetization, we might want to show a separator, like this:

Screenshot 2024-11-27 at 09 28 05

@jasmussen
Copy link
Contributor

About "Starter content" capitalization, I've separately reported the "Call to action" instead of "Call to Action", which I believe @juanfra has been working on, so it'll all be consistent.

@juanfra
Copy link
Member

juanfra commented Nov 27, 2024

This is testing well for me. I don't know if the automatic opening of the inserter is still a bit intrusive. I also understand that can be disabled through the preference, though.

I've separately reported the "Call to action" instead of "Call to Action", which I believe @juanfra has been working on, so it'll all be consistent.

Yes, that's planned for 6.8. It was handled here.

@jameskoster
Copy link
Contributor

My feeling is that when you just want to start writing any distraction is going to be annoying, whether it's a modal or this Inserter UI with zoom out that you have to exit in order to concentrate on writing.

That said, I agree this feels like a step in the right direction when compared against the modal.

we should probably do the same for the modal we have for template creation

Agree with this, though I'm not sure 'Starter content' quite captures the nature in that context.

@ellatrix ellatrix force-pushed the remove/starter-content-modal branch from 8a62537 to 5ac83d8 Compare November 29, 2024 11:15
@ellatrix
Copy link
Member Author

My feeling is that when you just want to start writing any distraction is going to be annoying, whether it's a modal or this Inserter UI with zoom out that you have to exit in order to concentrate on writing.

Yes, though the goal eventually is to also reduce the space that the patterns take to a single sidebar, so it shouldn't be more distracting than having the inspector open. The point is that you can see the canvas immediately and dismiss it instead of wondering what happened.

@annezazu
Copy link
Contributor

annezazu commented Dec 3, 2024

Tested this out and wanted to note that we should update the preference to opt out of starter patterns in light of this PR to be something more in line with what we're implementing here. Otherwise, I ran into an odd situation where I couldn't select and edit the page title unless I turned off "Show Template". I was about to open an issue for it but I can't replicate when using GB nightly.

testing.add.new.page.mov

@ellatrix
Copy link
Member Author

ellatrix commented Dec 4, 2024

I really don't like making everything an option like that. We should remove it if we can, that's part of why this PR is here. But I do agree that it may be a bit too early. We should reduce the pattern inserter to a single column so that the load experience is less jarring. I plan to try that out at some point, though anyone is welcome to try.

@annezazu
Copy link
Contributor

How is this work progressing? A month in I'm wondering how close we are to landing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Enhancement A suggestion for improvement.
Projects
Development

Successfully merging this pull request may close these issues.

Assemble new pages with zoom out
9 participants