Skip to content

feat(content-gating): i3 designs for content gates list view#4512

Merged
dkoo merged 52 commits intotrunkfrom
feat/access-control-ui-gates
Feb 26, 2026
Merged

feat(content-gating): i3 designs for content gates list view#4512
dkoo merged 52 commits intotrunkfrom
feat/access-control-ui-gates

Conversation

@dkoo
Copy link
Copy Markdown
Contributor

@dkoo dkoo commented Feb 24, 2026

All Submissions:

Changes proposed in this Pull Request:

Implements i3 designs for the "list" view for showing existing content gates in the Access Control wizard.

Also adds a new feature that allows the Wizard component to show snackbar-style notices via its Redux store. This is done via a new WizardSnackbar component that wraps the core Snackbar component, but is aware of and interfaces the the Wizard Redux store.

This PR only covers the list view for content gates. It doesn't cover i3 designs for priority management or other global settings such as Content Gifting and Countdown Banner features—these will come in future PRs.

Related NPPD-1244.

How to test the changes in this Pull Request:

  1. Check out this branch. Optionally delete any existing content gates to start fresh: wp post delete $(wp post list --post_type=np_content_gate --format=ids) --force and confirm that the Onboarding screen still works as described in feat(content-gating): new UI for adding/editing content gates #4474.
  2. Create a new content gate. Try to tweak all available settings so you can see how they're represented in the list view. After editing some info, try to click the back button in the header and confirm that you're prompted about unsaved changes.
Screenshot 2026-02-24 at 12 57 47 PM
  1. Cancel out of the prompt, then save. Confirm that you're automatically redirected to the content gates list view with a small snackbar notice stating that the new gate was created. Confirm that the snackbar notice appears with an "Edit" link that links to the edit page for the newly created gate. Confirm that the newly created gate is "Active" and has a publish status in the back-end.
Screenshot 2026-02-24 at 1 04 17 PM
  1. View the list view here and confirm that the card element here accurately reflects the gate's settings. Also view at a mobile viewport size to ensure that the layout collapses gracefully.
  2. Confirm that the "Customize registered/paid access layout" buttons work.
  3. Click the three-dot dropdown menu and test each menu item:
  • Confirm that "Edit" navigates to the edit page for that content gate. Make some edits, save, and confirm that the list view updates to reflect any changed settings.
  • Confirm that the "Deactivate" button unpublishes the content gate post and that the snackbar notice accurately reflects the updated status. Confirm that the "Undo" button in the snackbar notice reverts the status change.
  • Confirm that the "Delete" button prompts you about permanently deleting the content gate and that confirming the prompt deletes it.
  1. Add more more than one content gate and confirm that a "Gate priority" link appears next to the "Access control" header in the list view. (Note: this just opens the existing "Add New" modal for now, no need to test anything in here. Priority management will come in a future PR)
Screenshot 2026-02-24 at 1 20 57 PM

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@dkoo dkoo requested a review from thomasguillot February 24, 2026 20:17
@dkoo dkoo self-assigned this Feb 24, 2026
@dkoo dkoo requested a review from a team as a code owner February 24, 2026 20:17
Copilot AI review requested due to automatic review settings February 24, 2026 20:17
@dkoo dkoo added [Status] Needs Review The issue or pull request needs to be reviewed [Status] Needs Design Review labels Feb 24, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Audience → Access Control “content gates” list view to match the i3 designs, and introduces wizard-wide snackbar notices driven by the Wizard Redux store (via a new WizardSnackbar wrapper).

Changes:

  • Redesign content gates list view cards and their “Edit / Activate / Deactivate / Delete” actions.
  • Add Wizard store-backed snackbar notices (notices[]) and render them from Wizard.
  • Extend shared UI components (SectionHeader actions/description, Grid borders, CoreCard dropdown actions) to support the new designs.

Reviewed changes

Copilot reviewed 26 out of 27 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/wizards/hooks/use-wizard-api-fetch.ts Sync local hook error state with wizardData error.
src/wizards/componentsDemo/index.js Demo: wrap core-card examples in VStack.
src/wizards/audience/views/content-gates/types/index.d.ts Split gate rule props types; add isStatic to rule control props.
src/wizards/audience/views/content-gates/style.scss Add list-view settings typography/button styles (currently has brace issues).
src/wizards/audience/views/content-gates/edit/style.scss Add spacing for taxonomy token field.
src/wizards/audience/views/content-gates/edit/registration.tsx Remove “Edit Layout” link from edit panel.
src/wizards/audience/views/content-gates/edit/index.tsx Redirect to list after save/create; add snackbar notices; add unsaved changes prompt; refactor status changes.
src/wizards/audience/views/content-gates/edit/custom-access.tsx Remove “Edit Layout” link from edit panel.
src/wizards/audience/views/content-gates/edit/content-rule.tsx Use new content-rule-specific props; ensure exclusion is passed through.
src/wizards/audience/views/content-gates/edit/content-rule-control.tsx Add static display mode and exclusion propagation for taxonomy control.
src/wizards/audience/views/content-gates/edit/content-rule-control-taxonomy.tsx Add static display mode; parse/display selected labels.
src/wizards/audience/views/content-gates/edit/access-rule.tsx Use new access-rule-specific props.
src/wizards/audience/views/content-gates/content-gates.tsx Replace old expandable action-cards list with new list layout + header store usage; stub modal for “Gate priority”.
src/wizards/audience/views/content-gates/content-gate-settings.tsx New gate “card” layout showing gate settings; add per-card actions + snackbars.
packages/components/src/wizard/store/index.js Add notices[] to state plus add/remove/reset actions + selector; add sectionDescription to headerData defaults.
packages/components/src/wizard/index.js Render SectionHeader with description + actions; render snackbars from notices; adjust header reset behavior.
packages/components/src/wizard/components/style.scss Add snackbar positioning + link styling.
packages/components/src/wizard/components/WizardSnackbar.js New wrapper around core Snackbar that removes notices from wizard store on dismiss.
packages/components/src/with-wizard-screen/style.scss Add margin for wizard section header.
packages/components/src/section-header/style.scss Layout updates for primary/secondary actions; adjust margin logic.
packages/components/src/section-header/index.js Add primary/secondary actions rendering and related container classnames.
packages/components/src/grid/style.scss Add borders variant styling and move gutter-64 definition.
packages/components/src/grid/index.tsx Add borders prop to apply bordered grid styling.
packages/components/src/card/style-core.scss Improve core-card layout (dropdown positioning, no-margin body padding, header typography).
packages/components/src/card/index.js Add noMargin to core-card prop defaults.
packages/components/src/card/core-card.js Add dropdown actions support to core-card header.
includes/content-gate/class-content-gate.php Create gates as publish by default (ignores passed status).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/components/src/wizard/index.js Outdated
Comment thread packages/components/src/wizard/index.js
Comment thread src/wizards/audience/views/content-gates/content-gates.tsx Outdated
Comment thread src/wizards/audience/views/content-gates/content-gates.tsx Outdated
Comment thread src/wizards/audience/views/content-gates/content-gates.tsx Outdated
Comment thread packages/components/src/card/core-card.js
@thomasguillot
Copy link
Copy Markdown
Contributor

Screenshot 2026-02-25 at 15 07 27@2x

I really like you introduced this when we have unsaved changes. Would it be possible to use a Modal instead? And the same goes for the delete message.

Screenshot 2026-02-25 at 15 09 23@2x

@thomasguillot
Copy link
Copy Markdown
Contributor

My previous comment shouldn't be a blocker. We can always handle it in a separate PR.

@dkoo dkoo requested a review from miguelpeixe February 26, 2026 16:14
@dkoo
Copy link
Copy Markdown
Contributor Author

dkoo commented Feb 26, 2026

@dkoo I pushed a small tweak to the modals: 56ce522

Essentially I changed isNarrow and isWide to a size prop.

Thanks, @thomasguillot! I was surprised to see we're not using those size props with Modal anywhere else in the codebase, so it's a clean change.

Copy link
Copy Markdown
Member

@miguelpeixe miguelpeixe left a comment

Choose a reason for hiding this comment

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

🎉

@github-actions github-actions Bot added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Review The issue or pull request needs to be reviewed [Status] Needs Changes or Feedback The issue or pull request needs action from the original creator labels Feb 26, 2026
@dkoo
Copy link
Copy Markdown
Contributor Author

dkoo commented Feb 26, 2026

I'll keep this open so I can merge #4518 without conflicts!

@dkoo dkoo merged commit dcbb239 into trunk Feb 26, 2026
7 checks passed
@dkoo dkoo deleted the feat/access-control-ui-gates branch February 26, 2026 21:21
@github-actions
Copy link
Copy Markdown

Hey @dkoo, good job getting this PR merged! 🎉

Now, the needs-changelog label has been added to it.

Please check if this PR needs to be included in the "Upcoming Changes" and "Release Notes" doc. If it doesn't, simply remove the label.

If it does, please add an entry to our shared document, with screenshots and testing instructions if applicable, then remove the label.

Thank you! ❤️

matticbot pushed a commit that referenced this pull request Mar 5, 2026
# [6.35.0-alpha.1](v6.34.2...v6.35.0-alpha.1) (2026-03-05)

### Bug Fixes

* allow deletion of payment method for Braintree ([63ceec3](63ceec3))
* apply Copilot suggestion for tests ([6133636](6133636))
* **avatar:** correct duotone selector to support custom colors ([#4513](#4513)) ([c4458d4](c4458d4))
* **byline:** update placeholder text to "Author Name" ([#4510](#4510)) ([727b1e8](727b1e8))
* **co-authors-plus:** sanitize user_login before building dummy email… ([#4520](#4520)) ([32c2602](32c2602))
* do not depend on _get() to return an array ([2816470](2816470))
* **dropdown-menu:** avoid overflow at bottom of viewport ([#4495](#4495)) ([a5ce464](a5ce464))
* enable payment method deletion for Braintree ([c50f094](c50f094))
* iframe editor compatiblity ([#4444](#4444)) ([12dfaba](12dfaba))
* **my-account:** don't show subscription payment notice in modal checkout ([#4500](#4500)) ([2cb3324](2cb3324))
* **my-account:** force white background color ([#4514](#4514)) ([02e2555](02e2555))
* **my-account:** resubscription validation in order-again template ([#4498](#4498)) ([36871fc](36871fc))
* **newspack-icon:** background color ([#4516](#4516)) ([8c5dc9c](8c5dc9c))
* **newspack-ui:** remove overflow when modal is open ([#4515](#4515)) ([0b2cbd3](0b2cbd3))
* prune read-only keys from sync queue ([bf81734](bf81734))
* remove unused 'edit' and 'save' actions from Braintree payment methods ([8f72a8d](8f72a8d))
* **snackbar:** autohide progress bar not always appearing ([#4504](#4504)) ([4eda60f](4eda60f))

### Features

*  identify and enforce read-only items for Reader Data Library ([4f2ef8a](4f2ef8a))
* add featured image caption block ([#4519](#4519)) ([0b744ff](0b744ff))
* **author-profile:** avatar and social blocks for nested author profile ([#4448](#4448)) ([cff670b](cff670b))
* **content-gate:** comment restriction with metering support ([#4529](#4529)) ([714c8b7](714c8b7))
* **content-gate:** per-post access control exemption ([#4530](#4530)) ([636679b](636679b))
* **content-gate:** user access information ([#4542](#4542)) ([b49347e](b49347e))
* **content-gating:** group subscription invitations data structure + admin UI ([#4536](#4536)) ([e609e83](e609e83))
* **content-gating:** i3 designs for content gates list view ([#4512](#4512)) ([dcbb239](dcbb239))
* **corrections:** append corrections to Republication Tracker Tool content ([#4501](#4501)) ([71bd177](71bd177))
* data event handler registration and dispatching to integrations ([#4481](#4481)) ([7c79da6](7c79da6))
* **data-events:** add ActionScheduler logging and retry reason ([#4488](#4488)) ([e8af964](e8af964))
* **integrations:** make sure contact data is read from persistent data ([#4505](#4505)) ([c2ee26a](c2ee26a))
* **integrations:** start get fields abstraction and pull contact data ([#4470](#4470)) ([8ddcf23](8ddcf23)), closes [#4477](#4477)
* **reader-registration-block:** password, OTP, and verification flows ([#4452](#4452)) ([fc4567e](fc4567e))
* reject changes to specific reader data keys ([fe52e12](fe52e12))
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 5, 2026

🎉 This PR is included in version 6.35.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Mar 16, 2026
# [6.35.0](v6.34.4...v6.35.0) (2026-03-16)

### Bug Fixes

* allow deletion of payment method for Braintree ([63ceec3](63ceec3))
* apply Copilot suggestion for tests ([6133636](6133636))
* **avatar:** correct duotone selector to support custom colors ([#4513](#4513)) ([c4458d4](c4458d4))
* **byline:** update placeholder text to "Author Name" ([#4510](#4510)) ([727b1e8](727b1e8))
* **co-authors-plus:** sanitize user_login before building dummy email… ([#4520](#4520)) ([32c2602](32c2602))
* do not depend on _get() to return an array ([2816470](2816470))
* **dropdown-menu:** avoid overflow at bottom of viewport ([#4495](#4495)) ([a5ce464](a5ce464))
* enable payment method deletion for Braintree ([c50f094](c50f094))
* iframe editor compatiblity ([#4444](#4444)) ([12dfaba](12dfaba))
* **my-account:** don't show subscription payment notice in modal checkout ([#4500](#4500)) ([2cb3324](2cb3324))
* **my-account:** force white background color ([#4514](#4514)) ([02e2555](02e2555))
* **my-account:** resubscription validation in order-again template ([#4498](#4498)) ([36871fc](36871fc))
* **newspack-icon:** background color ([#4516](#4516)) ([8c5dc9c](8c5dc9c))
* **newspack-ui:** remove overflow when modal is open ([#4515](#4515)) ([0b2cbd3](0b2cbd3))
* prune read-only keys from sync queue ([bf81734](bf81734))
* remove unused 'edit' and 'save' actions from Braintree payment methods ([8f72a8d](8f72a8d))
* **snackbar:** autohide progress bar not always appearing ([#4504](#4504)) ([4eda60f](4eda60f))

### Features

*  identify and enforce read-only items for Reader Data Library ([4f2ef8a](4f2ef8a))
* add featured image caption block ([#4519](#4519)) ([0b744ff](0b744ff))
* **author-profile:** avatar and social blocks for nested author profile ([#4448](#4448)) ([cff670b](cff670b))
* **content-gate:** comment restriction with metering support ([#4529](#4529)) ([714c8b7](714c8b7))
* **content-gate:** per-post access control exemption ([#4530](#4530)) ([636679b](636679b))
* **content-gate:** user access information ([#4542](#4542)) ([b49347e](b49347e))
* **content-gating:** group subscription invitations data structure + admin UI ([#4536](#4536)) ([e609e83](e609e83))
* **content-gating:** i3 designs for content gates list view ([#4512](#4512)) ([dcbb239](dcbb239))
* **corrections:** append corrections to Republication Tracker Tool content ([#4501](#4501)) ([71bd177](71bd177))
* data event handler registration and dispatching to integrations ([#4481](#4481)) ([7c79da6](7c79da6))
* **data-events:** add ActionScheduler logging and retry reason ([#4488](#4488)) ([e8af964](e8af964))
* **integrations:** make sure contact data is read from persistent data ([#4505](#4505)) ([c2ee26a](c2ee26a))
* **integrations:** start get fields abstraction and pull contact data ([#4470](#4470)) ([8ddcf23](8ddcf23)), closes [#4477](#4477)
* **reader-registration-block:** password, OTP, and verification flows ([#4452](#4452)) ([fc4567e](fc4567e))
* reject changes to specific reader data keys ([fe52e12](fe52e12))
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 6.35.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Status] Approved The pull request has been reviewed and is ready to merge [Status] Design Approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants