Skip to content

Content Guidelines: Add block guidelines management#76187

Merged
ramonjd merged 26 commits intoWordPress:trunkfrom
aswasif007:add/block-content-guidelines
Mar 10, 2026
Merged

Content Guidelines: Add block guidelines management#76187
ramonjd merged 26 commits intoWordPress:trunkfrom
aswasif007:add/block-content-guidelines

Conversation

@aswasif007
Copy link
Contributor

What?

Related issue: #75260

Adds a new Blocks section to the Content Guidelines page, allowing administrators to define and manage tailored guidelines for specific block types.

Why?

The Content Guidelines feature currently supports site-wide categories (Site, Copy, Images, Additional), but has no way to express guidelines scoped to a particular block type. This is useful for teams who want to constrain or document how specific blocks should be used — for example, requiring alt text on image blocks or restricting heading hierarchy.

How?

  • Added a new blocks category to the guidelines data model and REST payload. Each entry maps a block name (e.g. core/image) to a guidelines string.
  • Added fetchBlockTypes() in api.ts to load all registered top-level block types via /wp/v2/block-types and store them as searchable options.
  • Added a BlockGuidelines component that renders a DataViews list of all configured block guidelines, with each row showing the block's icon, name, and guideline text. Row-level Edit and Delete actions are available.
  • Added a BlockGuidelineModal component for adding or editing a block guideline. It uses a ComboboxControl to search and select a block, and a TextareaControl for the guideline content. The modal title and submit label adapt between add and edit modes.
  • Added blockIconMap in utils.tsx — a mapping of core block names to their @wordpress/icons equivalents, used for visual display in the list.
  • Extended the Redux store with new blocks state, SET_BLOCK_GUIDELINE / SET_BLOCK_TYPES actions, and getBlockGuideline / getBlockGuidelines / getBlockTypes selectors.

Testing Instructions

  1. Navigate to the Content Guidelines admin page.
  2. Open the Blocks accordion section.
  3. Click Add guideline — the modal should open.
  4. Search for a block (e.g. "Image") using the combobox and enter some guideline text.
  5. Click Add guideline — the modal should close and the new entry should appear in the list.
  6. Click the Edit action on an existing row — the modal should reopen pre-filled with the block and its guideline text. Update the text and save; verify the list reflects the change.
  7. Click the Delete action on a row and confirm the entry is removed.
  8. Reload the page and verify all saved guidelines persist.

Testing Instructions for Keyboard

  1. Tab to the Blocks accordion header and press Enter to expand it.
  2. Tab to the Add guideline button and press Enter to open the modal.
  3. Tab to the block combobox, type to search, and use arrow keys to select a block.
  4. Tab to the guideline textarea and type content.
  5. Tab to the Add guideline submit button and press Enter to save.
  6. Verify focus returns appropriately after the modal closes.

Screenshots

Screenshot 2026-03-05 at 2 37 39 PM Screenshot 2026-03-05 at 2 37 50 PM Screenshot 2026-03-05 at 2 38 26 PM Screenshot 2026-03-05 at 2 38 39 PM Screenshot 2026-03-05 at 2 39 00 PM Screenshot 2026-03-05 at 2 39 48 PM

@github-actions
Copy link

github-actions bot commented Mar 5, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: aswasif007 <[email protected]>
Co-authored-by: andrewserong <[email protected]>
Co-authored-by: ramonjd <[email protected]>
Co-authored-by: saroshaga <[email protected]>
Co-authored-by: aagam-shah <[email protected]>
Co-authored-by: fditrapani <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@aswasif007 aswasif007 force-pushed the add/block-content-guidelines branch from 953daab to ab59a35 Compare March 6, 2026 04:50
@aswasif007 aswasif007 requested a review from spacedmonkey as a code owner March 6, 2026 04:50
guidelines: categories.additional,
},
blocks: Object.fromEntries(
Object.entries( blockGuidelines ).map(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Both the remove action in block-guidelines.tsx:110 and block-guideline-modal.tsx:87 use setBlockGuideline(blockName, '') to represent deletion. But I think blocks would still be sent as { "core/image": { "guidelines": "" } } rather than being omitted. This does not happen in practise because we disable the button when the textarea is empty. But wondering if the reducer should filter out empty-string entries, or saveContentGuidelines should exclude them before sending.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed here

Copy link
Contributor Author

@aswasif007 aswasif007 Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to revert ^ because it breaks the block-guideline deletion. Basically in the backend if we see that a block's guideline is empty string, we remove the guideline from meta. So we have to send empty string.

Here is the relevant code:

// Handle block-specific guidelines as individual meta keys.
if ( isset( $categories['blocks'] ) && is_array( $categories['blocks'] ) ) {
foreach ( $categories['blocks'] as $block_name => $block_data ) {
$meta_key = Gutenberg_Content_Guidelines_Post_Type::block_name_to_meta_key( $block_name );
$value = isset( $block_data['guidelines'] ) ? $block_data['guidelines'] : '';
if ( ! empty( $value ) ) {
update_post_meta( $post_id, $meta_key, $value );
} else {
delete_post_meta( $post_id, $meta_key );
}
}
}

getGuideline(
state: ContentGuidelinesState,
category: string
): string | Record< string, string > {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude suggested here to use the discriminated return type / separate selector.

..by keeping getGuideline returning string only, since there's already getBlockGuidelines() and getBlockGuideline(blockName) for block lookups. Just guard against the blocks key:

getGuideline(state: ContentGuidelinesState, category: string): string {
    if (category === 'blocks') {
        return '';  // callers should use getBlockGuideline(blockName) instead
    }
    return (state.categories[category] as string) ?? '';
}

Or even better, type category more narrowly so TypeScript enforces it at compile time:

type TextCategory = 'site' | 'copy' | 'images' | 'additional';

getGuideline(state: ContentGuidelinesState, category: TextCategory): string {
    return state.categories[category] ?? '';
}

That way if someone writes getGuideline('blocks'), TypeScript rejects it and points them to getBlockGuideline() / getBlockGuidelines() instead. No union return type, no as string casts at call sites, and the two data shapes stay cleanly separated.

The TextCategory type could live in types.ts alongside the existing Categories interface, keeping it DRY if other selectors/actions need the same constraint.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aswasif007 : perhaps this is superseded with @aagam-shah 's suggestion below: #76187 (comment) .

};

const CATEGORIES = [ 'site', 'copy', 'images', 'additional' ];
const CATEGORIES = [ 'site', 'copy', 'images', 'additional', 'blocks' ];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more of a note for future reference than feedback that needs addressing.

When I first started to design this, I wanted to keep two clear category types: primitive and complex (like blocks). This is also to avoid having to hardcode categories like we've done here.

Here's a rough sketch of it could look like:

1. Types — define the two classes:

// types.ts

interface PrimitiveCategory {
    kind: 'primitive';
    slug: string;
    title: string;
    description: string;
}

interface ComplexCategory {
    kind: 'complex';
    slug: string;
    title: string;
    description: string;
    component: React.ComponentType;  // custom renderer
}

type GuidelineCategory = PrimitiveCategory | ComplexCategory;

2. Registry — declare categories with their class:

// stage.tsx

const GUIDELINE_CATEGORIES: GuidelineCategory[] = [
    { kind: 'primitive', slug: 'site',       title: __('Site'),       description: __("Describe your site's purpose...") },
    { kind: 'primitive', slug: 'copy',       title: __('Copy'),       description: __('Set your writing standards...') },
    { kind: 'primitive', slug: 'images',     title: __('Images'),     description: __('Outline your style...') },
    { kind: 'complex',  slug: 'blocks',      title: __('Blocks'),     description: __('Create tailored guidelines...'), component: BlockGuidelines },
    { kind: 'primitive', slug: 'additional', title: __('Additional'), description: __('Add additional guidelines...') },
];

3. Rendering — dispatch on kind, no slug checks:

{GUIDELINE_CATEGORIES.map((item) => (
    <li key={item.slug}>
        <GuidelineAccordion title={item.title} description={item.description} ...>
            {item.kind === 'primitive' ? (
                <GuidelineAccordionForm slug={item.slug} ... />
            ) : (
                <item.component />
            )}
        </GuidelineAccordion>
    </li>
))}

The ternary still exists, but it's generic — it dispatches on kind, not on a specific slug. Adding a future complex category (say, "media" with its own custom UI) is just one more entry in the array with kind: 'complex' and a component.

4. State — separate storage by kind:

// types.ts
export interface ContentGuidelinesState {
    id: number | null;
    status: string | null;
    primitives: Record<string, string>;           // site, copy, images, additional
    complex: Record<string, Record<string, string>>; // blocks, future ones...
}

5. Store parsing — loop by kind, no special-case branches:

const PRIMITIVE_SLUGS = GUIDELINE_CATEGORIES
    .filter(c => c.kind === 'primitive')
    .map(c => c.slug);

const COMPLEX_SLUGS = GUIDELINE_CATEGORIES
    .filter(c => c.kind === 'complex')
    .map(c => c.slug);

function parseResponse(response: RestGuidelinesResponse) {
    const cats = response.guideline_categories ?? {};
    
    const primitives: Record<string, string> = {};
    for (const slug of PRIMITIVE_SLUGS) {
        primitives[slug] = cats[slug]?.guidelines ?? '';
    }

    const complex: Record<string, Record<string, string>> = {};
    for (const slug of COMPLEX_SLUGS) {
        complex[slug] = {};
        const entries = cats[slug] ?? {};
        for (const key in entries) {
            complex[slug][key] = entries[key]?.guidelines ?? '';
        }
    }

    return { id: response.id ?? null, status: response.status ?? null, primitives, complex };
}

6. Selectors — one per kind class, not per category:

// Primitive categories
getGuideline(state, slug: string): string {
    return state.primitives[slug] ?? '';
},

// Complex categories (blocks today, anything tomorrow)
getComplexGuidelines(state, slug: string): Record<string, string> {
    return state.complex[slug] ?? {};
},
getComplexGuideline(state, slug: string, key: string): string {
    return state.complex[slug]?.[key] ?? '';
},

This will obviously introduce abstraction that we don't need today. So we shouldn't do it right now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to this direction — the full registry pattern with kind discriminant is the right end state.

To keep things simple for now, could we start with just the type foundation? It fixes the immediate mixed Categories type issue without introducing the registry abstraction yet:

// types.ts — REST layer types that match the actual PHP response shapes

interface BaseGuideline {
  guidelines?: string;
}

interface PrimitiveGuideline extends BaseGuideline {
  label?: string;
}

type AdvancedGuideline = Record< string, BaseGuideline >;

interface RestGuidelineCategories {
  site?: PrimitiveGuideline;
  copy?: PrimitiveGuideline;
  images?: PrimitiveGuideline;
  additional?: PrimitiveGuideline;
  blocks?: AdvancedGuideline;
}

interface RestGuidelinesResponse {
  id: number;
  status: string;
  guideline_categories?: RestGuidelineCategories;
}

// Store state — two flat maps, no mixed union

interface ContentGuidelinesState {
  id: number | null;
  status: string | null;
  categories: Record< string, string >;       // primitive: slug -> text
  blockGuidelines: Record< string, string >;   // advanced: blockName -> text
}

getGuideline() stays string-only, blocks get their own path via getBlockGuideline(name), and the REST types self-document the actual API shapes. When the full registry pattern is needed later, the REST types carry forward unchanged — only the store state evolves.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aagam-shah : let's take up your suggestion in a follow-up PR 👍

@fditrapani
Copy link

Nice work @aswasif007. This is a solid start! Here's what I found:

Block list spacing
Once we have a block list, the alignment of the elements is thrown off because the table is inset:

image

Ideally we can use some custom styles to achieve this:
image

Data views controls
The data views controls feel unnecessary when we have few items. Any chance we can hide those until we have more than 7 items? The filters are also not particularly helpful. Perhaps we can hide those indefinitely.

image

Adding block guidelines

After you add a block guideline, can we exclude it from the list? The adding > edit behaviour was unexpected and really subtle:

image

Removing guidelines

I mocked up some notices around removing guidlines in Figma. What do you think about adding those now or would you prefer to do that separately?

image

Transition
This is unrelated to this PR but wanted to raise it here since we're looking at this together. Feel free to tackle it separately. I noticed a weird flicker when I first visit the content guidelines page. Is there anything we can do to prevent that?

Screen.Recording.2026-03-06.at.1.21.48.PM.mov

@ramonjd ramonjd added [Type] Enhancement A suggestion for improvement. [Feature] Guidelines An experimental feature for adding site-wide editorial rules. labels Mar 9, 2026
@ramonjd
Copy link
Member

ramonjd commented Mar 9, 2026

Maybe one for @fditrapani I mentioned it over in the previous PR, but I think it'd be helpful to do some simple validation in a follow up.

Or, if it's expected that users "clear" entries then provide a dedicated "Reset/Clear/Remove" button.

Kapture.2026-03-09.at.16.33.00.mp4

Also this point:

i'd be interested to hear from design folks, but maybe validation could be centralized via a single save button. that might also mitigate multiple, simultaneous submissions given there are 4 x submit buttons

All can be follow ups.

@saroshaga
Copy link

Or, if it's expected that users "clear" entries then provide a dedicated "Reset/Clear/Remove" button.

Filippo has shared designs for this which will be taken up in future PRs
image @ramonjd

@aswasif007 aswasif007 force-pushed the add/block-content-guidelines branch from 95c8815 to 86ba626 Compare March 9, 2026 07:14
Copy link

@saroshaga saroshaga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left one small suggestion but I think it looks good to do! Thank you for working through all the feedback!

</Notice.Title>
</Notice.Root>
) }
<HStack

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: can the cursor be styled as pointer only for the submenu ... button?

The entire bar need not have a pointer cursor.

(doesn't show up in the screenshot)

Image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm seeing the pointer on mine. I forgot to mention this in my feedback but if you click the row/title, can we open the Edit guideline modal?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sarosh is referring to the cursor when submenu is open.
Screenshot 2026-03-10 at 6 58 35 AM

I am afraid this needs to be fixed in the DataView component. I think for such modifications in Gutenberg, we are supposed to create a github-issue in the repository first.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you click the row/title, can we open the Edit guideline modal?

Addressed here: c1af24a

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasif, I could also see the cursor when the submenu was closed but it was a pointer . Since the bar is not clickable, there's no use for the pointer style over that portion.

@fditrapani
Copy link

Plus one on the great work for the updates. I spotted something minor, if you remove the guideline from the table, we show the modal confirmation.

image

We don't show it if you press remove from the edit modal:

image

iamchughmayank added a commit to iamchughmayank/gutenberg that referenced this pull request Mar 9, 2026
@aswasif007
Copy link
Contributor Author

@fditrapani regarding

if you remove the guideline from the table, we show the modal confirmation. We don't show it if you press remove from the edit modal.

Should we show the confirmation modal on top of the edit modal? Or replace the edit modal with the confirmation modal?

Since this PR is already approved, I will add it in a separate PR so that we are free to roll this one out.

Copy link
Contributor

@andrewserong andrewserong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionality-wise this is testing pretty well for me! Just left a few comments, mostly for code quality things that would be good to fix up (either now or in a follow-up). The main one is that to match the PHP backend logic, it looks the list of blocks should probably be filtered?

Nice progress here!

Copy link
Member

@ramonjd ramonjd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again @aswasif007

Like @andrewserong I left only comments to keep in mind for follow ups.

I think the createSuccessNotice translation should be fixed in this PR though. Once that's done we can merge so folks can concentrate on the follow ups.

Comment on lines +136 to +155
getGuideline(
state: ContentGuidelinesState,
category: string
): string | Record< string, string > {
return state.categories[ category ];
},
getAllGuidelines(
state: ContentGuidelinesState
): Partial< Record< string, string > > {
getAllGuidelines( state: ContentGuidelinesState ): Categories {
return state.categories;
},
getBlockGuidelines(
state: ContentGuidelinesState
): Record< string, string > {
return state.categories.blocks;
},
getBlockGuideline(
state: ContentGuidelinesState,
blockName: string
): string {
return state.categories.blocks[ blockName ] ?? '';
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a reminder that it might be wise to add test coverage in follow ups to guard against bugs/regressions.

👍🏻

Comment on lines +6 to +8
.components-modal__header-heading {
font-weight: 500;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this stuff is sometime unavoidable, but there's a general preference not to target component internals since components might change internal classes.

Just a fragility thing. Okay for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately we don't have a way to adjust css of the modal header.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option for this header would be to leave it at its existing font-weight for consistency with other modals? The default across wp-admin and in Gutenberg appears to be 600 so I'm not sure if this needs to be different 🤔

(Again, not a blocker, just a thought!)

Copy link
Member

@ramonjd ramonjd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fast update @aswasif007

I gave it another smoke test.

I think an immediate follow up could be to look at @andrewserong's comments in relation to content blocks in the block list: #76187 (comment)

Anyway, let's get this in so folks can iterate. Cheers.

@aswasif007
Copy link
Contributor Author

Thanks @ramonjd and @andrewserong for the reviews and approval!

I've addressed the comments as well.

@ramonjd ramonjd merged commit 19fb314 into WordPress:trunk Mar 10, 2026
41 of 42 checks passed
@github-actions github-actions bot added this to the Gutenberg 22.8 milestone Mar 10, 2026
@andrewserong
Copy link
Contributor

I've addressed the comments as well.

Nicely done, thanks for updating all of that before merge! 🚀

iamchughmayank added a commit to iamchughmayank/gutenberg that referenced this pull request Mar 10, 2026
andrewserong pushed a commit that referenced this pull request Mar 11, 2026
#76155)

* Add block guidelines management

* Fix spacing of the dataviews

* Remove dataviews sort and filter
And omit dataviews search too when there are less than 6 items

* Exclude blocks that already have guidelines from add-guideline list

Also, use textcontrol instead of combobox in edit mode

* Show confirmation modal when deleting block guideline from table

* Improve save/delete logic

* Use base-style variable

* Fix bootstrapBlockRegistry() placement

* Add types

* Use hstack wrapper for add-block-guideline btn

* Do not remove block-key when removing block guideline

This is because the backend expects empty string in order to delete a block

* Fix issue with empty page after deleting rows

* Fix mistake with wrapping up action-text in double quote

* Add . after success notice text

* Remove undefined keys from block entries

* Add clarifying comment for setting empty string to delete a block guideline

* Content Guidelines: Add actions section UI

* Adds simple import and export function

* Content Guidelines: Add manage access and revision screens

* Content Guidelines: Search in revision history screen

* Content guidelines: Use filterSortAndPaginate from DataViews to implement search in guidelines revision history screen

* Content guidelines: Hide Manage Access action button for MVP

* Improve spacing

* Content guidelines: Use DataViews inbuilt filtering

* Refetch content-guidelines after restoring a revision

* Improve revision-history page styles

* Content guidelines: remove manage-access from MVP

* Content Guidelines: Use Notice as error message component instead of Snackbar

* Content Guidelines: Addresses PR feedback:
1. Uses downloadBlob from wordpress/blob
2. Adds isRTL support to the chevron
3. Uses dateI18n to format date on revision screen
4. Adds efficient catching of error during revision restoration

* Content Guidelines: Align author to the right of revision history table

* Content guidelines: Rebase with #76187

* Content guideliens: Adds confirmation modal to import guidelines

* Content guidelines: Updates modal sequence and copy

* Content guidelines: Addresses PR feedback to:1. Fix unnecessary try/catch
2. Remov unnecessary lint escapes
3. Use memoisation to avoid rerenders

* Content guidelines: Remove unnecessary overrides in CSS, where possible

* Content guidelines: Use memoisation in filter and pagination to avoid rerenders

* Content guidelines: Revert changes done by incorrect rebase and merge

* Content guidelines: Revert unnecessary changes brought in incorrect rebase

* Content guidelines: Handle guidelines import error correctly by restoring previous version

* Content guidelines: Pre-emptively add override for wordpress/ui Notice component

* Content guidelines: Update copy for content guidelines import error

* Guidelines: Rename "Content Guidelines" to "Guidelines" in all user-facing strings

Rename the feature from "Content Guidelines" to "Guidelines" across all
user-facing strings (page title, menu item, experiments toggle, notices,
modals, aria labels, error messages) while keeping variable and file names
unchanged. This aligns with the decision to use the shorter name while
the feature remains experimental.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* Content guidelines: Change the text 'content guidelines' to 'guidelines' in user facing interfaces

* Content Guidelines: Remove lint override which is not live yet

* Content guidelines: Updates copy of import error notice and removes moving revision history columns feature

* Content guidelines: Updates snackbar/toast message copy

---------

Co-authored-by: Ahmed Sayeed Wasif <[email protected]>
Co-authored-by: Aagam Shah <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
Co-authored-by: aswasif007 <[email protected]>
Co-authored-by: iamchughmayank <[email protected]>
Co-authored-by: aagam-shah <[email protected]>
Co-authored-by: fditrapani <[email protected]>
Co-authored-by: saroshaga <[email protected]>
Co-authored-by: mirka <[email protected]>
Co-authored-by: Jameswlepage <[email protected]>
@andrewserong andrewserong added the Backport to Gutenberg RC Pull request that needs to be backported to a Gutenberg release candidate (RC) label Mar 11, 2026
@scruffian
Copy link
Contributor

I just cherry-picked this PR to the release/22.7 branch to get it included in the next release: c7b5c09

scruffian pushed a commit that referenced this pull request Mar 11, 2026
Co-authored-by: aswasif007 <[email protected]>
Co-authored-by: andrewserong <[email protected]>
Co-authored-by: ramonjd <[email protected]>
Co-authored-by: saroshaga <[email protected]>
Co-authored-by: aagam-shah <[email protected]>
Co-authored-by: fditrapani <[email protected]>
scruffian pushed a commit that referenced this pull request Mar 11, 2026
#76155)

* Add block guidelines management

* Fix spacing of the dataviews

* Remove dataviews sort and filter
And omit dataviews search too when there are less than 6 items

* Exclude blocks that already have guidelines from add-guideline list

Also, use textcontrol instead of combobox in edit mode

* Show confirmation modal when deleting block guideline from table

* Improve save/delete logic

* Use base-style variable

* Fix bootstrapBlockRegistry() placement

* Add types

* Use hstack wrapper for add-block-guideline btn

* Do not remove block-key when removing block guideline

This is because the backend expects empty string in order to delete a block

* Fix issue with empty page after deleting rows

* Fix mistake with wrapping up action-text in double quote

* Add . after success notice text

* Remove undefined keys from block entries

* Add clarifying comment for setting empty string to delete a block guideline

* Content Guidelines: Add actions section UI

* Adds simple import and export function

* Content Guidelines: Add manage access and revision screens

* Content Guidelines: Search in revision history screen

* Content guidelines: Use filterSortAndPaginate from DataViews to implement search in guidelines revision history screen

* Content guidelines: Hide Manage Access action button for MVP

* Improve spacing

* Content guidelines: Use DataViews inbuilt filtering

* Refetch content-guidelines after restoring a revision

* Improve revision-history page styles

* Content guidelines: remove manage-access from MVP

* Content Guidelines: Use Notice as error message component instead of Snackbar

* Content Guidelines: Addresses PR feedback:
1. Uses downloadBlob from wordpress/blob
2. Adds isRTL support to the chevron
3. Uses dateI18n to format date on revision screen
4. Adds efficient catching of error during revision restoration

* Content Guidelines: Align author to the right of revision history table

* Content guidelines: Rebase with #76187

* Content guideliens: Adds confirmation modal to import guidelines

* Content guidelines: Updates modal sequence and copy

* Content guidelines: Addresses PR feedback to:1. Fix unnecessary try/catch
2. Remov unnecessary lint escapes
3. Use memoisation to avoid rerenders

* Content guidelines: Remove unnecessary overrides in CSS, where possible

* Content guidelines: Use memoisation in filter and pagination to avoid rerenders

* Content guidelines: Revert changes done by incorrect rebase and merge

* Content guidelines: Revert unnecessary changes brought in incorrect rebase

* Content guidelines: Handle guidelines import error correctly by restoring previous version

* Content guidelines: Pre-emptively add override for wordpress/ui Notice component

* Content guidelines: Update copy for content guidelines import error

* Guidelines: Rename "Content Guidelines" to "Guidelines" in all user-facing strings

Rename the feature from "Content Guidelines" to "Guidelines" across all
user-facing strings (page title, menu item, experiments toggle, notices,
modals, aria labels, error messages) while keeping variable and file names
unchanged. This aligns with the decision to use the shorter name while
the feature remains experimental.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* Content guidelines: Change the text 'content guidelines' to 'guidelines' in user facing interfaces

* Content Guidelines: Remove lint override which is not live yet

* Content guidelines: Updates copy of import error notice and removes moving revision history columns feature

* Content guidelines: Updates snackbar/toast message copy

---------

Co-authored-by: Ahmed Sayeed Wasif <[email protected]>
Co-authored-by: Aagam Shah <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
Co-authored-by: aswasif007 <[email protected]>
Co-authored-by: iamchughmayank <[email protected]>
Co-authored-by: aagam-shah <[email protected]>
Co-authored-by: fditrapani <[email protected]>
Co-authored-by: saroshaga <[email protected]>
Co-authored-by: mirka <[email protected]>
Co-authored-by: Jameswlepage <[email protected]>
@scruffian scruffian removed the Backport to Gutenberg RC Pull request that needs to be backported to a Gutenberg release candidate (RC) label Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Guidelines An experimental feature for adding site-wide editorial rules. [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants