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

Navigation on Browse Mode: Add pages #50580

Open
scruffian opened this issue May 12, 2023 · 10 comments
Open

Navigation on Browse Mode: Add pages #50580

scruffian opened this issue May 12, 2023 · 10 comments
Labels
[Block] Navigation Affects the Navigation Block [Type] Enhancement A suggestion for improvement.

Comments

@scruffian
Copy link
Contributor

scruffian commented May 12, 2023

Building on #50578 and #50579, we need to enable users to add pages to their navigation.

When users have a navigation selected (or if they have only one), add a [+] next the the "Navigation" title in the Navigation panel. This [+] will trigger the add new page modal. When the new page has been created it should be added to the selected navigation. We will need to determine whether the navigation already contains a page list block. If it does then we don't need to add the page, if not then we do.

Screenshot 2023-05-12 at 12 33 01

The new page flow is being handled in #48456.

Related #55640

@jameskoster
Copy link
Contributor

Does this [+] button also need to account for adding an existing page to the menu? Otherwise how would a user perform that action?

@getdave
Copy link
Contributor

getdave commented May 22, 2023

I think @jameskoster's point is very valid. Is this interface going to be edited or not editabke. I think we need to choose. Why? Because the existing "hybrid" approach is already causing confusion.

Most participants were perplexed by the “hybrid” content editing option in the Navigation section, which suddenly appeared, causing one person to believe they had encountered a bug.

Source: https://make.wordpress.org/test/2023/05/11/fse-program-front-page-fun-summary/?mc_cid=1613e5e6a2&mc_eid=791bad501f

@getdave
Copy link
Contributor

getdave commented Jun 14, 2023

When working on this feature please consider Riad's comment in #48456 (comment).

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)

@getdave
Copy link
Contributor

getdave commented Oct 26, 2023

I discussed this away from Github with @jasmussen. We loosely covered the following:

  • adds a new Page to the Navigation in the Site View sidebar but...
  • ...if the Navigation is only a Page List then do nothing and allow Page List to automatically sync the new page
  • likely this will be achieved using the Link UI - will need to implement items from Link Control Refresh
  • if page has children then show a modal to ask if you want to automatically add all child pages (Joen’s idea for “bulk add”)
  • when adding a Page to the menu then use term “Choose a title for this menu item” because that is what is being added

Also these notes:

  • “Add a new page” modal appears from a plus button in the detail view of navigation.
  • If it’s a Page List navigation, the button just adds a new page; when published it will show up in said page list anyway.
  • If it’s a custom menu, then the “add new page” probably exists inside the add-page/link UI only.
  • Said link UI is also improved with tree view, etc as noted. see LinkControl Refresh #50891
  • When adding a page with children, whether we ask “do you want to add”, or just do it without asking, we can figure that out at a later time.
  • But it’s worth noting that adding such an ancestor menu item could potentially add a page list, set to show children of just that menu item. That way it’s a synced menu item, any child pages will automatically be added. This could suggest that not asking would be a good place to start, but it’s unclear if that’s confusing or not, so mainly noting the wiggleroom to explore.

@getdave
Copy link
Contributor

getdave commented Oct 26, 2023

We should also consider #55640 as part of this

@getdave
Copy link
Contributor

getdave commented Nov 8, 2024

I noticed that @jameskoster has proposed a new route in #65828.

@jameskoster Do you want to close this Issue in favour of yours? I feel like #65828 could be a long way out and I'm wondering if we want an interim solution.

@jameskoster
Copy link
Contributor

I suppose we'll need the 'add menu item' logic in any case, so I don't think it would be a waste of effort to address this issue before we get to 65828. I'd welcome @annezazu's thoughts on this.

@annezazu
Copy link
Contributor

annezazu commented Nov 8, 2024

While I don't know every detail but I agree and would appreciate seeing this land for now, ahead of addressing #65828 more broadly.

@getdave
Copy link
Contributor

getdave commented Nov 19, 2024

Some discussion in #65828 (comment) indicates that @WordPress/gutenberg-design aren't in favour of pursing this as a priority right now. The rationale offered is one I tend to agree with, namely that we have too many places to edit menus right now and we cannot show Menus in context within the Site View sidebar.

Instead we should optimise for dataviews to allow the Menus to be administered as Post objects (rename, duplicate, delete...etc), but not present any means to modify the menu items.

If anyone feels strongly that ability to manage menu items within the Site View sidebar (the black colour sidebar) then please let us know your thoughts.

@yjailin
Copy link

yjailin commented Dec 13, 2024

Hello everyone. Just adding my two cents, but my understanding is that menu can me fully managed from the editor for block themes, and the sidebar on the preview is just a simplified view to re-order theses navigation items.

The first things that came in my mind were :

  • Why can't we add menu items (subject of this ticket)
  • Why can't we also manage cart and account icons, or any button or search bar that were added from the editor

At this point, since it's limited and we don't want to re-create the whole block experience, i wonder if a click on the "Navigation" tab on the left shouldn't directly lead to the menu block and its pannel on the right. Maybe it's better than clicking on the header multiple times until we find the right layer in the preview.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

6 participants