Skip to content

Global Styles: Switch the revisions screen to the DataViews pickerActivity layout - #80856

Draft
jorgefilipecosta wants to merge 1 commit into
WordPress:trunkfrom
jorgefilipecosta:update/73463-global-styles-revisions-picker-activity
Draft

Global Styles: Switch the revisions screen to the DataViews pickerActivity layout#80856
jorgefilipecosta wants to merge 1 commit into
WordPress:trunkfrom
jorgefilipecosta:update/73463-global-styles-revisions-picker-activity

Conversation

@jorgefilipecosta

@jorgefilipecosta jorgefilipecosta commented Jul 29, 2026

Copy link
Copy Markdown
Member

Closes #73463

The Global Styles revisions screen rendered its own timeline: a hand-rolled Composite listbox, custom dot/line CSS, and a local pagination component. This switches it to DataViewsPicker with the pickerActivity layout, the same component the post revisions timeline uses since #77333, and deletes the custom list and pagination code.

The information architecture stays as it was. The date is the title field, the author avatar and name render under it, and the selected revision progressively discloses the changes summary plus the Apply / Reset to defaults button or the Active badge, through a description field that only renders content for the selected item. Selection is still driven by the /revisions/:revisionId? route, so the canvas preview is untouched, and pagination remains server-side with view.page driving the query. The option labels ("Changes saved by %1$s on %2$s", "Unsaved changes by %s", "Reset the styles to the theme defaults") moved into the title field's getValue, which the picker uses as the option's accessible name, so labels are unchanged for screen readers and for the existing e2e coverage.

The screen also gets a bounded height, scoped with :has() in the Global Styles sidebar styles like the post revisions timeline does in the document sidebar, so the timeline scrolls internally and the pagination footer stays pinned to the bottom. This is not just cosmetic: when the picker is unbounded inside the sidebar scroller, focusing the listbox scrolls the sidebar mid-click and the first click on a revision is lost.

Visible differences, all inherited from the shared layout: the selected/hover tint uses the design system token instead of the admin color at 4% opacity, the dot and date no longer turn blue on selection, and the pagination footer is the standard DataViews one.

Before

Apply Reset to defaults Active
Apply before Reset to defaults before Active badge before

After

Apply Reset to defaults Active
Apply after Reset to defaults after Active badge after

Compared with the post revisions timeline

The same layout as the post revisions timeline renders it in the document sidebar (#77333), side by side with this PR — same dates treatment, author rows, timeline, selection tint, and pagination footer:

Post revisions Global Styles revisions with this PR
Post revisions timeline Global Styles revisions after

Testing Instructions

  1. In the Site Editor, save a few Global Styles changes to build revisions, then open Styles in the top bar and click the Revisions button.
  2. Click through revisions and verify the canvas previews each one, the selected revision shows its changes summary and an Apply button, and the revision matching the editor styles shows the Active badge.
  3. Apply a revision and verify it loads into the editor; with unsaved changes, verify the confirmation dialog appears first.
  4. Go to the last page, select "Default styles" and verify the Reset to defaults button.
  5. With more than 10 revisions, verify the pagination footer stays pinned while the list scrolls internally.
  6. Verify keyboard use: arrow keys move through revisions, Enter selects, Tab reaches the Apply button.
  7. npm run test:unit packages/global-styles-ui/src/screen-revisions and npm run test:e2e -- test/e2e/specs/site-editor/user-global-styles-revisions.spec.js pass.

AI usage disclosure: implementation and description drafted with AI assistance and reviewed by me.

@github-actions github-actions Bot added the [Package] Editor /packages/editor label Jul 29, 2026
@jorgefilipecosta
jorgefilipecosta force-pushed the update/73463-global-styles-revisions-picker-activity branch from fd19054 to 1a29a93 Compare July 29, 2026 19:38
@jorgefilipecosta
jorgefilipecosta force-pushed the update/73463-global-styles-revisions-picker-activity branch from 1a29a93 to 14e6e60 Compare July 29, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Editor /packages/editor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Global Styles revisions: use DataViews activity layout

1 participant