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: Show theme badge for non customized theme templates in navigation panel #27041

Closed
wants to merge 1 commit into from

Conversation

david-szabo97
Copy link
Member

Description

I find the blue dot idea in the navigation panel confusing. I think it would make more sense to show an icon/badge for original theme template files. (Theme templates that weren't modified)

This PR adds a theme badge next to the original theme templates.

How has this been tested?

  • Open site editor
  • Open navigation panel
  • On a clean install all templates should have a theme badge
  • Edit a template with a theme badge and save it
  • theme badge should disappear

Screenshots

image

Types of changes

New feature (non-breaking change which adds functionality)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.

@david-szabo97
Copy link
Member Author

I created this PR to discuss the possibility of avoiding the blue dot (#26894) and instead we should indicate original theme template files.

@github-actions
Copy link

Size Change: +159 B (0%)

Total Size: 1.19 MB

Filename Size Change
build/edit-site/index.js 23.3 kB +51 B (0%)
build/edit-site/style-rtl.css 4.03 kB +54 B (1%)
build/edit-site/style.css 4.03 kB +54 B (1%)
ℹ️ View Unchanged
Filename Size Change
build/a11y/index.js 1.14 kB 0 B
build/annotations/index.js 3.77 kB 0 B
build/api-fetch/index.js 3.42 kB 0 B
build/autop/index.js 2.84 kB 0 B
build/blob/index.js 664 B 0 B
build/block-directory/index.js 8.71 kB 0 B
build/block-directory/style-rtl.css 943 B 0 B
build/block-directory/style.css 942 B 0 B
build/block-editor/index.js 133 kB 0 B
build/block-editor/style-rtl.css 11.3 kB 0 B
build/block-editor/style.css 11.3 kB 0 B
build/block-library/editor-rtl.css 8.91 kB 0 B
build/block-library/editor.css 8.92 kB 0 B
build/block-library/index.js 147 kB 0 B
build/block-library/style-rtl.css 8.1 kB 0 B
build/block-library/style.css 8.1 kB 0 B
build/block-library/theme-rtl.css 792 B 0 B
build/block-library/theme.css 793 B 0 B
build/block-serialization-default-parser/index.js 1.87 kB 0 B
build/block-serialization-spec-parser/index.js 3.06 kB 0 B
build/blocks/index.js 48 kB 0 B
build/components/index.js 171 kB 0 B
build/components/style-rtl.css 15.3 kB 0 B
build/components/style.css 15.3 kB 0 B
build/compose/index.js 9.9 kB 0 B
build/core-data/index.js 14.8 kB 0 B
build/data-controls/index.js 827 B 0 B
build/data/index.js 8.74 kB 0 B
build/date/index.js 11.2 kB 0 B
build/deprecated/index.js 768 B 0 B
build/dom-ready/index.js 571 B 0 B
build/dom/index.js 4.92 kB 0 B
build/edit-navigation/index.js 11.1 kB 0 B
build/edit-navigation/style-rtl.css 881 B 0 B
build/edit-navigation/style.css 885 B 0 B
build/edit-post/index.js 306 kB 0 B
build/edit-post/style-rtl.css 6.51 kB 0 B
build/edit-post/style.css 6.49 kB 0 B
build/edit-widgets/index.js 26.3 kB 0 B
build/edit-widgets/style-rtl.css 3.16 kB 0 B
build/edit-widgets/style.css 3.16 kB 0 B
build/editor/editor-styles-rtl.css 476 B 0 B
build/editor/editor-styles.css 478 B 0 B
build/editor/index.js 42.5 kB 0 B
build/editor/style-rtl.css 3.85 kB 0 B
build/editor/style.css 3.85 kB 0 B
build/element/index.js 4.62 kB 0 B
build/escape-html/index.js 735 B 0 B
build/format-library/index.js 6.86 kB 0 B
build/format-library/style-rtl.css 547 B 0 B
build/format-library/style.css 548 B 0 B
build/hooks/index.js 2.16 kB 0 B
build/html-entities/index.js 623 B 0 B
build/i18n/index.js 3.57 kB 0 B
build/is-shallow-equal/index.js 698 B 0 B
build/keyboard-shortcuts/index.js 2.52 kB 0 B
build/keycodes/index.js 1.94 kB 0 B
build/list-reusable-blocks/index.js 3.1 kB 0 B
build/list-reusable-blocks/style-rtl.css 476 B 0 B
build/list-reusable-blocks/style.css 476 B 0 B
build/media-utils/index.js 5.32 kB 0 B
build/notices/index.js 1.79 kB 0 B
build/nux/index.js 3.4 kB 0 B
build/nux/style-rtl.css 671 B 0 B
build/nux/style.css 668 B 0 B
build/plugins/index.js 2.56 kB 0 B
build/primitives/index.js 1.43 kB 0 B
build/priority-queue/index.js 790 B 0 B
build/redux-routine/index.js 2.84 kB 0 B
build/reusable-blocks/index.js 3.05 kB 0 B
build/rich-text/index.js 13.3 kB 0 B
build/server-side-render/index.js 2.77 kB 0 B
build/shortcode/index.js 1.69 kB 0 B
build/token-list/index.js 1.27 kB 0 B
build/url/index.js 4.05 kB 0 B
build/viewport/index.js 1.84 kB 0 B
build/warning/index.js 1.14 kB 0 B
build/wordcount/index.js 1.22 kB 0 B

compressed-size-action

@jameskoster
Copy link
Contributor

I agree that the blue dot is not perfect (far from it), and probably needs to be re-thought. However, it is a pattern that has been consistently proposed across various design concepts to indicate when an entity has been customized from an initial state (Global Styles being one example).

So with that said my opinion is that we should stick with it here for now, but perhaps open another issue when we have a clearer picture of all the eventual use cases, and explore more holistic solutions to what may be a common requirement in site editing.

@Copons
Copy link
Contributor

Copons commented Nov 17, 2020

@jameskoster I think this PR was more meant to start a discussion than to be a solution. 🙂

I'm not sure about Global Style (you mention a design concept, which I assume didn't make the cut, as I don't see any dots in there 😄), but talking about it with other people it was also mentioned that blue dots are often used to indicate "customized elements in an unsaved state".

See for example Visual Studio Code (for no other reasons that it's the app closest to the browser right now 😄 ).

VSCode add a dot to tabs with unsaved changes:

Saved Unsaved
Screenshot 2020-11-17 at 18 09 45 Screenshot 2020-11-17 at 18 09 53

If the project has a version control system, it also adds an M in the file tree for files with saved changes, not committed yet:

Saved and Committed Changes Saved But Not Committed
Screenshot 2020-11-17 at 18 11 07 Screenshot 2020-11-17 at 18 10 58

I might be biased by my heavy use of VSCode, but indeed I would probably expect to see the blue dot in the sidebar disappear on save. 🤔

@Addison-Stavlo
Copy link
Contributor

I agree that the blue dot is not perfect (far from it), and probably needs to be re-thought. However, it is a pattern that has been consistently proposed across various design concepts to indicate when an entity has been customized from an initial state (Global Styles being one example).

@jameskoster - I think one thing this could potentially do is compliment the blue dot pattern. That is, if I understood correctly what should and shouldn't have blue dots:

  1. Theme supplied templates that are unedited - no blue dot
    • once edited - blue dot
  2. Templates spun-up from 'scratch' (the create new template button in nav panel) - no blue dot
    • once edited - still no blue dot? (either way the conflict between 1 and 2 exists)

This means that both uncustomized theme supplied templates and templates spun-up from the create flow look the same (no blue dot) and there is no way to differentiate between the two in the nav panel. So perhaps adding the 'theme' tag could at least fill in that gap? 🤔

@noahtallen
Copy link
Member

it was also mentioned that blue dots are often used to indicate "customized elements in an unsaved state".

yeah, totally. I'm so used to seeing little dots as "things to get rid of" in the UI. For example, an app shows a little dot on my profile picture. Now I know I need to take action on something in my profile to get rid of the dot. Similar for unsaved changes or notifications.

@jameskoster
Copy link
Contributor

jameskoster commented Nov 18, 2020

@jameskoster I think this PR was more meant to start a discussion than to be a solution. 🙂

Forgive me! I am sometimes guilty of defaulting to a mental model of PR = proposed solution, and Issue = "we need to talk about this", especially when a review is requested. I am 100% keen to discuss more and find a better solution.

if I understood correctly what should and shouldn't have blue dots

That list is correct, and the notion was that it should be possible to see at-a-glance which theme templates have been customised, making it easy to revert to default.

I agree with the general sentiment here though – as a UI pattern dots are typically used to indicate "unsaved changes", or activity like unread notifications. They do not say "this has been customized" very clearly.

Off the top of my head, there are three states we need to consider communicating visually here, and whatever we come up with likely needs to work for both templates and global styles:

  1. The entity is supplied by the theme and is unchanged
  2. The entity is supplied by the theme and has been customised
  3. The entity is entirely user-generated

Additionally we need to think about the actual user flows in which one would need to interpret these states. Reverting back to the theme default is one flow, as is deleting a from-scratch template/style. I can see these actions being performed on a per-entity basis or all-at-once a la "restore to factory settings". Are there other flows?

When exploring solutions we should probably aim for something lightweight and versatile enough to fit in to a variety of circumstances – I imagine that's why the dot was originally proposed.

The "theme" pill in this PR doesn't quite fit the needs outlined above for me, especially as I imagine the average user will consider all templates to be part of their "theme" as the adoption of site editing increases. It may need to be something a little more abstract.

I don't have any good ideas to present just yet. But will think about it some more this week.

@vindl
Copy link
Member

vindl commented Nov 18, 2020

  1. The entity is entirely user-generated

I'm not sure if this should be treated as a separate case? 🤔 If the theme doesn't supply a template we will use index.html, or whatever fallback is closest in template hierarchy as a starting point. In that sense every user created template can be viewed as theme supplied one too (case 2). It also seems like the implementation and behavior of some actions, like reverting back to theme default, will be the same for cases 2 and 3.

@jameskoster
Copy link
Contributor

Good point, I suppose I was more outlining the perceived states that should be considered when thinking about user flows and design solutions.

In that sense every user created template can be viewed as theme supplied one too (case 2).

On a technical level this makes sense to me, but on a UX level, I'm not so sure. Mostly because we present this action as "Create new" in the UI, which is a decidedly different action to the duplication that you explain happening behind the scenes.

I suspect that creating has a slightly different set of expectations to duplicating or customising in this context. I would expect that the customised entities could be reverted back to default, while new entities could only be deleted.

@Copons
Copy link
Contributor

Copons commented Nov 18, 2020

It also seems like the implementation and behavior of some actions, like reverting back to theme default, will be the same for cases 2 and 3.

Just to be clear: the revert is in fact just a simple delete.

When we delete a case 2 (theme-supplied and customized), the system will automatically create a new template from the theme file.
When we delete a case 3 (fully custom), the hierarchy will determine whatever fallback to use for the content that used to be affected by it.

Therefore, as I see it, the "revert to theme default" action should only exist for case 2.
IMHO case 3 should be treated for what it actually is: a delete.

I'm aware that this logic is very confusing, especially for the end user.
However, we do have technical constraints, and I want to make sure we are all on the same page regarding them.

@jameskoster
Copy link
Contributor

Therefore, as I see it, the "revert to theme default" action should only exist for case 2.

Exactly. And as I understand it this was the original motivation for highlighting these templates with the blue dot in the first place.

@shaunandrews
Copy link
Contributor

For Global Styles I'm looking at using the dot to indicate when a color has been changed from the value set by the theme, and including some additional information (who changed it, and maybe when it was changed) along with a way to reset to the theme default:

image

image

These are just design concepts, and haven't been implemented. (Yet.)

@Copons
Copy link
Contributor

Copons commented Nov 18, 2020

The Global Styles dot just reminded a similar case, again in VSCode.
The editor settings can be customized by the user. It used to be done in a JSON override, which made things pretty clear (everything in that file is user custom), but when they added a GUI they also started marking customized settings.
Instead of a dot, they chose to highlight the left border.

Screenshot 2020-11-18 at 17 04 35

It made me wonder why the border doesn't bother me, compared to the dot.
I think it all boils down to what @noahtallen says.
Dots nowadays are synonyms of notifications, which are in of themselves a "call to action".
Whenever I see a blue dot, I am compelled to act on it ASAP. It might be to save an unsaved file, read an email, or just remove the dreaded dot from my screen.

@jameskoster
Copy link
Contributor

I had a good chat with @shaunandrews about this yesterday. Sharing some thoughts after the fact:

Ultimately I fear that the dots (or any similar pattern) are unnecessarily cluttering the UI, and not adding enough value to warrant their inclusion – particularly in the navigation panel. Let's consider two of the key user flows / stories:

  1. I want to get rid of any customisations on an individual thing (template, style, etc)
  2. I want to get rid of all of my custom things in one go

In scenario 1, I already know the thing I want to revert/delete is custom. So I just open it up, find the action, and execute. I don't need the blue dot indicator. If I cannot find the action I'm looking for, that is enough to indicate that it is already in its default state.

I'm not even sure that the reset action needs to be so verbose. "Reset to theme default" could simply be "Reset".

As an example, I don't think anything is lost in this design when compared to the one Shaun shared above:

Screenshot 2020-11-19 at 11 58 51

In scenario 2, I am much more likely to do this from a single dedicated "Reset all" action. In global styles that might work like so:

Screenshot 2020-11-19 at 11 45 20

In template context it's likely to occur on the list / mosaic view, not in the navigation panel.

@Addison-Stavlo
Copy link
Contributor

I'm not even sure that the reset action needs to be so verbose. "Reset to theme default" could simply be "Reset".

If we are not verbose I fear this could be easily mis-interpreted. Without verbosity the state we are resetting to is ambiguous and up to user interpretation. For example, a user could interpret "Reset" as reset to last save. They could hit the button expecting recent changes to be discarded and their old customized state to be restored. Instead they would lose all their customizations and go back to the theme default.

@vindl
Copy link
Member

vindl commented Nov 20, 2020

In scenario 1, I already know the thing I want to revert/delete is custom. So I just open it up, find the action, and execute. I don't need the blue dot indicator. If I cannot find the action I'm looking for, that is enough to indicate that it is already in its default state.

This sounds reasonable to me. 👍

@jameskoster given the above do you think that we should close this issue #26451 and not pursue it further? We can replace it with an Issue/PR for adding the Reset action to the Document Settings dropdown.

@jameskoster
Copy link
Contributor

could interpret "Reset" as reset to last save

I think it's a much more common expectation for a "reset" action to revert to default. But you do highlight a good point – resetting is can have significant implications, and could perhaps use a snackbar confirmation with undo option.

@jameskoster given the above do you think that we should close this issue #26451 and not pursue it further?

That is my opinion, yes. Paging @shaunandrews for any additional input.

We can replace it with an Issue/PR for adding the Reset action to the Document Settings dropdown.

We have one over here: #23421 (comment) :D

@vindl vindl closed this Nov 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants