Skip to content

Global Styles: If there are no revisions, it is better to hide the button #51846

@t-hamano

Description

@t-hamano

Description

If changes have been made to the global style, the following popover will appear when the Revision button is pressed:

has-revision

If it has never been modified, i.e., has no revisions, an inactive button will appear.

has-no-revision

Even stranger, the popover does not close when you click outside the popover unless you click once on the button.

If there is no action executable in the popover, I think the revision button itself should be hidden. Even in the post editor, if there are no revisions, the panel will not appear.

Step-by-step reproduction instructions

Note: If you have changed the global style, delete the revision, e.g., by resetting the site.

  • Go to the Site Editor and open the Styles sidebar.
  • Press the revisions button.
  • A button with the "Reset to default" label will appear in the popup, but cannot be pressed.
  • Click outside the popover and verify that the popover does not close.

Screenshots, screen recording, code snippet

506e19645e75a395c3aa3b7de77ae8ef.mp4

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

Labels

Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Feature] HistoryHistory, undo, redo, revisions, autosave.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions