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

Creation modal for "New Page" #48456

Closed
2 tasks done
Tracked by #33094
mtias opened this issue Feb 26, 2023 · 36 comments
Closed
2 tasks done
Tracked by #33094

Creation modal for "New Page" #48456

mtias opened this issue Feb 26, 2023 · 36 comments
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing")

Comments

@mtias
Copy link
Member

mtias commented Feb 26, 2023

Let's explore combining the current "zoomed.out" experiment for patterns with the new frame mode when it comes to building new pages and templates based on sections. The idea behind zoomed.out was to allow operating at a higher level than individual blocks, which is now better accomplished in the frame mode.

Iteration 1

Can be triggered from nav menu, buttons, command center, etc.

  • Modal with page title, slug, and parent
  • Once in the editor, patterns modal shows

Mockups:

Add modal

near term

Adding pages flow

See also this comment for some more explorations on the slug editing, there is a simpler option if the above is too complex.

Iteration 2: See #50739

Underway.

@mtias mtias mentioned this issue Feb 26, 2023
57 tasks
@mtias mtias added [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") Needs Design Needs design efforts. labels Feb 26, 2023
@mtias mtias changed the title [Editor] Creation flows for New Page and New Template that focuses on patterns. Creation flows for "New Page" and "New Template" that focuses on patterns. Feb 26, 2023
@annezazu annezazu moved this to 🎨 Needs design in Gutenberg Phase 2: Customization Apr 17, 2023
@jasmussen jasmussen moved this to Triage in 6.3 Design Apr 17, 2023
@jasmussen jasmussen moved this from Triage to Needs feedback in 6.3 Design Apr 28, 2023
@jasmussen jasmussen moved this from Needs feedback to Needs design, or refresh in 6.3 Design Apr 28, 2023
@jameskoster
Copy link
Contributor

jameskoster commented May 5, 2023

Edit: The following concept speaks to "Iteration 2" as detailed in the OP.

Here's a potential design for the add page flow. It doesn't capture the working-with-sections element yet, but does install the basics.

add.page.mp4
  • The flow originates in the Pages panel (as proposed in Re-Introduce Content Editing in the Site Editor #44461 (comment)), where clicking the + reveals the New Page panel.
    • Worth noting that there could be a command in the Command Center that would send a user to this panel too
  • The New Page panel contains a two fields:
    • Input for page title
    • Template selection modal.
  • Once the page is created, any patterns associated with the Post Content block are presented in a modal (this is existing functionality).

One technical detail to discuss here (in addition to any design feedback) is the status applied to these new pages on creation. They should probably be drafts, but there's not currently a way to publish draft pages in the Site Editor, so we may need to work out a design for this in a subsequent issue (perhaps as a part of #50386).

Another question is which templates to include in the selection modal. Page plus any $custom templates are a given, as are any patterns associated with the page template. Should we also include any singular template (e.g. single-post)?

@jameskoster jameskoster moved this from Needs design, or refresh to Needs feedback in 6.3 Design May 5, 2023
@jameskoster jameskoster added the Needs Design Feedback Needs general design feedback. label May 5, 2023
@mtias mtias changed the title Creation flows for "New Page" and "New Template" that focuses on patterns. Creation flow for "New Page" that focuses on patterns. May 5, 2023
@richtabor richtabor changed the title Creation flow for "New Page" that focuses on patterns. Creation flow for "New Page" that focuses on patterns May 5, 2023
@jasmussen

This comment was marked as resolved.

@mtias

This comment was marked as resolved.

@mtias
Copy link
Member Author

mtias commented May 8, 2023

@jameskoster for the details view iteration, I'd like to explore a design where the available templates are small thumbnails already shown without needing to click on the big template thumbnail.

@jasmussen

This comment was marked as resolved.

@mtias
Copy link
Member Author

mtias commented May 8, 2023

Would it be possible to edit the slug or it's just a visualization?

@jasmussen
Copy link
Contributor

I was hoping something like this:

long term

But a simpler starting point might be this, click the slug to replace it with an input field for editability:

near term

Main challenge there is to retain a piece of "locked text" — the site — inside that input.

An simpler way to do it would be to just invoke the existing permalink popover from that helper text — this one:

Screenshot 2023-05-09 at 10 15 34

@jasmussen jasmussen added the Needs Dev Ready for, and needs developer efforts label May 9, 2023
@jasmussen
Copy link
Contributor

I've updated this issue with mockups for iteration 1, and added "Needs dev" label for that.

I've kept the design labels for now, as we still need mockups/feedback for iteration 2.

@jasmussen
Copy link
Contributor

I've tentatively updated this one as the conversation seems to have solidified.

@mtias mtias changed the title Creation flow for "New Page" that focuses on patterns Creation modal for "New Page" May 18, 2023
@mtias mtias mentioned this issue May 18, 2023
42 tasks
@simison
Copy link
Member

simison commented May 19, 2023

Issue for categories in the new page template modal, neat to see categories in these designs. 👍

@jameskoster
Copy link
Contributor

@jasmussen a tiny detail that seems to have been missed: Instead of "Parent", it might be more intuitive if the default option in the dropdown was "Top level". I think that dropdown may need a label too, but it's hard to say for sure without seeing the contents mocked up. I'd echo Saxon's comments about not placing it in the footer, but feel less strongly about that.

The "Save" – and particularly "Edit" – buttons still feel a bit off to me. Could save just be "Create"? If we need the edit option too, maybe "Create & edit"?

@jasmussen
Copy link
Contributor

I prefer we start with single words for the buttons, and then change if and when we get to test it in a branch where it might feel off. It's always harder to pull back later on. Same, honestly, with the parent. Also not a strong opinion here, but feels solid enough to start a PR for.

@getdave
Copy link
Contributor

getdave commented Jun 12, 2023

Is anyone actively working on the tasks here? The current implementation seem quite tied to the Pages section of the Browse Mode. I envisage that this modal will be needed elsewhere and thus will need to be invoked on a global basis. For example:

  • Link UI
  • Navigation in Browse Mode

I'm thinking the modal needs lifting to somewhere where it can be invoked from an action dispatched to the edit site store.

@jasmussen
Copy link
Contributor

I think I've seen some work done by @SaxonF.

@jameskoster
Copy link
Contributor

Page creation is now possible via the Pages panel (#50565).

Should we close this issue in favor of new ones for any follow-up tasks?

@SaxonF
Copy link
Contributor

SaxonF commented Jun 12, 2023

@getdave the initial implementation of the add page modal was actually global via edit site store like you suggest but was changed to use local state based on feedback. You can view the reversal here 5fc86cf . It Might be worth creating a separate issue and could almost copy/paste from earlier commits on that branch, but @youknowriad might have some thoughts on a more elegant global approach .

@getdave
Copy link
Contributor

getdave commented Jun 13, 2023

Thanks @SaxonF. Interesting that it was reverted. Was reasoning was provided for that? I assumed it had simply been conceived as a local component from the get-go.

I can say now that we need to be able to trigger the creation of a new page from both Navigation panel in Browse mode and also the Link Control/Link UI. But in our case we need to be able to control what happens after submission in order that we can act on the resulting data.

@SaxonF
Copy link
Contributor

SaxonF commented Jun 13, 2023

@getdave we just didn't want to introduce deeper changes at that point in time as it was only being triggered in one place.

I added a redirectAfterSave option to the action which you could turn into a more generic onSave callback, but using actions that way feels a little dirty.

Ideally we'd also want the command center to be able to trigger the add page modal.

@getdave
Copy link
Contributor

getdave commented Jun 13, 2023

@getdave we just didn't want to introduce deeper changes at that point in time as it was only being triggered in one place.

Absolutely. No problem at all. I was just curious if there was another bigger reason I had missed. Thanks for confirming. I commented on the original PR and waiting on Riad to advise if he's happy with this becoming global again.

Thanks for your context and also all the original work here 🙇

@youknowriad
Copy link
Contributor

I'm happy if we take the "Add page" modal global (block-editor) again in its own PR. Here are a few things/requirements in my mind:

  • Rely on the existing abstractions (settings) we have in the BlockEditorProvider
  • Use the same UI for all the places we already have (avoid adding a new standard without removing the existing ones)

Related to this, at this point, we have a number of block editor settings and we're often unsure what each setting is about, what format it supports and how is it useful for third-party editors. I think we should also make sure to add a documentation page to document all these settings.

@getdave
Copy link
Contributor

getdave commented Jun 14, 2023

I think we should also make sure to add a documentation page to document all these settings.

@ndiego I wonder if this is something you would be able/interested in looking into?

@ndiego
Copy link
Member

ndiego commented Jun 14, 2023

@ndiego I wonder if this is something you would be able/interested in looking into?

@getdave definitely. I'll get myself caught up on this issue this week.

@mtias
Copy link
Member Author

mtias commented Jun 28, 2023

This looks to be concluded, do we have any follow ups?

@jameskoster
Copy link
Contributor

I think just the zoomed-out stuff which is already documented in #50739.

If anyone disagrees please re-open.

@github-project-automation github-project-automation bot moved this from 💻 Needs development to ✅ Done in Gutenberg Phase 2: Customization Jun 28, 2023
@ndiego
Copy link
Member

ndiego commented Jun 28, 2023

This would be a separate PR, but does it make sense to add the option to choose a specific template for the page on creation?

@jameskoster
Copy link
Contributor

I think that is probably covered by #50739.

@jameskoster jameskoster moved this from Needs dev to Done in 6.3 Design Jul 12, 2023
@priethor priethor removed the Needs Dev Ready for, and needs developer efforts label Jul 24, 2023
@richtabor
Copy link
Member

Related to #55117 (connecting dots).

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 [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing")
Projects
Status: Done
Status: Done
Development

No branches or pull requests

10 participants