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

Tracking: Style Revision UX Improvements #55776

Closed
11 of 12 tasks
apeatling opened this issue Nov 1, 2023 · 6 comments
Closed
11 of 12 tasks

Tracking: Style Revision UX Improvements #55776

apeatling opened this issue Nov 1, 2023 · 6 comments
Assignees
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues.

Comments

@apeatling
Copy link
Contributor

apeatling commented Nov 1, 2023

I'm documenting some discussion around improvements to style revisions in the block editor. Specifically refinements to improve the UX and discoverability of the feature. These will be broken out as separate issues over time, but this can act as a tracking issue.

Future once these are done: #53484

Related

@apeatling apeatling added [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Nov 1, 2023
@annezazu
Copy link
Contributor

Not sure if this is intentional but wanted to note these additional related items for consideration:

#53484
#55577

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Nov 20, 2023
@alexstine alexstine removed their assignment Nov 20, 2023
@alexstine alexstine removed the [Status] In Progress Tracking issues with work in progress label Nov 20, 2023
@alexstine
Copy link
Contributor

Sorry, wrong issue.

@apeatling
Copy link
Contributor Author

@annezazu Thanks for those. I've added #55577, and #53484 will be looked at once these smaller improvements are done.

@ramonjd
Copy link
Member

ramonjd commented Dec 22, 2023

Update the saving flow for style revisions to provide detail instead of just a "custom styles" checkbox

Note to self - looking into this, I think the following needs to occur:

  1. We can add a description for the globalStyles entity somewhere around in packages/editor/src/components/entities-saved-states/entity-type-list.js
  2. But because this is in the editor package, we'd probably need to move packages/edit-site/src/components/global-styles/screen-revisions/get-revision-changes.js, possibly to where GlobalStylesContext lives in blockEditorPrivateApis (@wordpress/block-editor) so we can consume it. getRevisionChanges() could be renamed to something else 🤷🏻
  3. Then we can create a specific hook/whatever to fetch the changes and use as the change description in the EntityTypeList

Some untested pseudo code:

import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
import { useMemo, useContext } from '@wordpress/element';
import { getBlockTypes } from '@wordpress/blocks';

import { unlock } from '../../lock-unlock';

const { GlobalStylesContext, getRevisionChanges } = unlock( blockEditorPrivateApis );

function foo() {
	const { user: currentEditorGlobalStyles } =
		useContext( GlobalStylesContext );

	const blockNames = useMemo( () => {
		const blockTypes = getBlockTypes();
		return blockTypes.reduce( ( accumulator, { name, title } ) => {
			accumulator[ name ] = title;
			return accumulator;
		}, {} );
	}, [] );

	const changeDescription = getRevisionChanges(
		currentEditorGlobalStyles,
	        {},
		blockNames
	);
       ....
}

@getdave
Copy link
Contributor

getdave commented Jan 18, 2024

👋 Hello team. Whats the update on this feature for WP 6.5? Is it likely to land and if so which features (as originally outlined in the roadmap) will make it. Thanks in advance 🙏

@ramonjd
Copy link
Member

ramonjd commented Jan 18, 2024

Thanks @getdave

This issue can be closed off.

The following, outstanding task is ongoing, but comprises a refactor only and I'd say not required for 6.5

All other relevant PRs attached to this issue have Core backport PRs already (well, one):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues.
Projects
No open projects
Status: Done
Development

No branches or pull requests

6 participants