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

Theme name in Template Selector #20469

Closed
mtias opened this issue Feb 26, 2020 · 16 comments · Fixed by #21768
Closed

Theme name in Template Selector #20469

mtias opened this issue Feb 26, 2020 · 16 comments · Fixed by #21768
Assignees
Labels
Needs Dev Ready for, and needs developer efforts [Status] In Progress Tracking issues with work in progress

Comments

@mtias
Copy link
Member

mtias commented Feb 26, 2020

It'd be good to display the current theme name in the template selector of edit-site.

image

@shaunandrews
Copy link
Contributor

At the bare minimum, I could see adding a section to the bottom of the menu to display the theme name...

image

...but I'm not entirely sure what purpose this serves. Maybe we can add a preview on hover, and some other options to view the theme details and view all themes:

Template Menu with Theme

The "Theme details" item probably isn't necessary — selecting the theme name could open the details like we do now in the Themes screen in wp-admin:

image

I'm not sure if we can use that exact modal within the editor, but I could see adapting that UI. We could look to add more template-related information about the theme here as well.

@shaunandrews shaunandrews added Needs Design Feedback Needs general design feedback. and removed Needs Design Needs design efforts. labels Mar 6, 2020
@MichaelArestad
Copy link
Contributor

It'd be good to display the current theme name in the template selector of edit-site.

@mtias I'm still curious as to why. I'm not sure exactly what purpose this would serve.

@mtias
Copy link
Member Author

mtias commented Mar 7, 2020

Right now you cannot tell while in edit site view which theme you have enabled. The templates and template parts come from a mixture of site content (user modified) and theme content. It's important to trace where those are coming from.

@MichaelArestad
Copy link
Contributor

Right now you cannot tell while in edit site view which theme you have enabled. The templates and template parts come from a mixture of site content (user modified) and theme content. It's important to trace where those are coming from.

@mtias Right. Perhaps we can delineate which templates are coming from the theme and show the theme name in conjunction with the template? Perhaps when previewing the template?

@mtias
Copy link
Member Author

mtias commented Mar 11, 2020

That's somewhat already in place — all templates come from the theme unless they have the "modified by user" dot as explained here #19269

image

@MichaelArestad
Copy link
Contributor

@mtias And templates couldn't be added by other sources like plugins?

@shaunandrews
Copy link
Contributor

Building on the work from #20470, here's the latest on the theme info (shown in its :hover state):

image

@mapk
Copy link
Contributor

mapk commented Mar 24, 2020

This hover experience from @shaunandrews communicating the theme visually works really well. I noted that if this hover+preview is used here, it would be great to see it used for the templates in this issue: #20476

@johnstonphilip
Copy link
Contributor

What would show where the theme is, if the template is not part of the theme, but only exists as a wp_template post_type?

@joanrho
Copy link
Contributor

joanrho commented Apr 8, 2020

@shaunandrews Does this still need design feedback or has a final direction already been decided upon? If so, can you please provide some updated visuals and links to the Figma source files?

@MichaelArestad
Copy link
Contributor

@joanrho This works for now and fits with the template previews. Moving to Needs dev.

@MichaelArestad MichaelArestad added Needs Dev Ready for, and needs developer efforts and removed Needs Design Feedback Needs general design feedback. labels Apr 9, 2020
@shaunandrews
Copy link
Contributor

shaunandrews commented Apr 9, 2020

Does this still need design feedback or has a final direction already been decided upon?

This seems like a mostly straight-foward one, I have nothing more to add design-wise at this point.

Figma file is here: https://www.figma.com/file/TR15iRvk7toGHnKb68QN1K/Full-Site-Editing?node-id=1060%3A0

@johnstonphilip
Copy link
Contributor

@MichaelArestad @shaunandrews Any thoughts on this? #20469 (comment)

@johnstonphilip
Copy link
Contributor

I also feel like this comment is worth addressing as well:
#20469 (comment)

@MichaelArestad
Copy link
Contributor

What would show where the theme is, if the template is not part of the theme, but only exists as a wp_template post_type?

I would expect nothing to show there. Perhaps, if the template is added by a plugin, it could show the plugin name in place of the theme.

@ockham
Copy link
Contributor

ockham commented Apr 14, 2020

I came here via #19252. Going to give this a stab.

@ockham ockham self-assigned this Apr 14, 2020
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Apr 14, 2020
ockham added a commit that referenced this issue Apr 17, 2020
Display the current theme name in the template selector of `edit-site`.

Since the `/themes` endpoint currently only exposes the `theme_supports` field for each theme, this PR adds a number of additional fields to it, using the `rest_prepare_theme` hook. (I also filed a WordPress/wordpress-develop#222 against Core to extend the, err, upstream endpoint accordingly so that we can eventually drop the filter.)

In addition, this PR adds a new `getCurrentTheme` selector and related reducer/resolver/action to `core-data` (including a `themes` reducer for better normalization).

Finally, that selector is used to render the theme name in `edit-site`'s template selector.

The fields I've chosen to add should be sufficient to implement the on-hover previews seen at #20469 (comment).

However, this PR doesn't implement those previews yet, since we need to implement the underlying fly-out menu component first (see #20470).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Dev Ready for, and needs developer efforts [Status] In Progress Tracking issues with work in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants