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

Site Editor: Extend the NavigationItem Components to Support Page and Template Previews #25261

Closed
Copons opened this issue Sep 11, 2020 · 5 comments
Assignees
Labels
[Feature] Navigation Component A navigational waterfall component for hierarchy of items.

Comments

@Copons
Copy link
Contributor

Copons commented Sep 11, 2020

The current page/template selector supports template (and theme) previews:

Screenshot 2020-09-11 at 17 56 41

<div className="edit-site-header__toolbar-switchers">
<PageSwitcher
showOnFront={ showOnFront }
activePage={ page }
onActivePageChange={ setPage }
/>
<div className="edit-site-header__toolbar-switchers-separator">
/
</div>
<TemplateSwitcher
page={ page }
activeId={ templateId }
activeTemplatePartId={ templatePartId }
isTemplatePart={ templateType === 'wp_template_part' }
onActiveIdChange={ setTemplate }
onActiveTemplatePartIdChange={ setTemplatePart }
onAddTemplate={ addTemplate }
onRemoveTemplate={ removeTemplate }
/>
</div>

We should replicate the same functionality in the new site editor navigation, by extending NavigationItem to support previews that show up on mouse over.

Depends on #25244.

(Source)

@david-szabo97
Copy link
Member

Isn't this something that's the consumer's concern?

We just need to make the component extensible so the consumer can show the preview. Which is kinda possible right now. We can add mouseenter and mouseleave event handlers on the NavigationItem.

I don't think we should add this to Navigation package. That would make it coupled with the block editor.

@david-szabo97
Copy link
Member

Once we have the core implementations in place, then we can create a Navigation component in edit-site which implements this feature

@Copons
Copy link
Contributor Author

Copons commented Sep 20, 2020

Isn't this something that's the consumer's concern?

@david-szabo97 agree!
That's why I named this PR as Site Editor 😛

Although, there could be a need of a standard item component with a preview panel.

We just need to make the component extensible so the consumer can show the preview. Which is kinda possible right now. We can add mouseenter and mouseleave event handlers on the NavigationItem.

We probably not need to add the hover handlers to NavigationItem, but can simply add them to the Site Editor component.

@Copons
Copy link
Contributor Author

Copons commented Oct 20, 2020

@david-szabo97 I think there has been a regression on this, and previews are not visible anymore.
We might have caused it when we moved the sidebar around in the interface, or when we played around with overflows. 🤔

@david-szabo97
Copy link
Member

Closing this, works fine on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Navigation Component A navigational waterfall component for hierarchy of items.
Projects
None yet
Development

No branches or pull requests

2 participants