feat(rolling-content): hidden DataViews demo wizard#4728
feat(rolling-content): hidden DataViews demo wizard#4728thomasguillot wants to merge 21 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a hidden, URL-gated "Rolling Content" admin demo wizard to explore DataViews patterns with fake in-memory data. The menu only appears in the sidebar when one of the demo's pages is active, and the area exists purely as a sandbox for evaluating a parent/child editorial content model inside Newspack's admin chrome.
Changes:
- New PHP
Rolling_Content_Demowizard that conditionally registers a top-level menu plus two sub-pages (AllandAdd) and enqueues the shared wizards bundle. - Two React routes added to
src/wizards/index.tsxrendering anAllDataViews view (with row actions for Edit / Manage / Add Entry / Delete) and anAddplaceholder view. - Shared modal components (Edit info, Delete confirm, Add Entry info, full-screen Manage Entries with nested DataViews), a generic
StatusPill, deterministic fake data + global types, and a design spec/plan underdocs/superpowers/.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| includes/wizards/class-rolling-content-demo.php | New Wizard subclass with conditional top-level menu, parent/submenu highlighting filters, and custom enqueue. |
| includes/class-newspack.php | Includes the new wizard class file. |
| includes/class-wizards.php | Registers the Rolling_Content_Demo instance. |
| src/wizards/index.tsx | Adds lazy-loaded routes for the All and Add demo views. |
| src/wizards/rollingContent/views/all.tsx | DataViews list of fake rolling contents with row actions and modal wiring. |
| src/wizards/rollingContent/views/add.tsx | Placeholder view explaining no editor is wired. |
| src/wizards/rollingContent/modals/manage-entries.tsx | Full-screen modal with nested Entries DataViews. |
| src/wizards/rollingContent/modals/edit-info.tsx | Shared info modal for Edit row action. |
| src/wizards/rollingContent/modals/delete-confirm.tsx | Shared destructive confirmation modal. |
| src/wizards/rollingContent/modals/add-entry-info.tsx | Info modal explaining implicit parent association. |
| src/wizards/rollingContent/components/status-pill.tsx | Generic icon + label status indicator. |
| src/wizards/rollingContent/data.ts | Deterministic fake dataset of 30 rolling contents and entries. |
| src/wizards/rollingContent/types.d.ts | Global types for RollingContent, Entry, and status unions. |
| docs/superpowers/specs/2026-05-13-rolling-content-demo-design.md | Design spec for the demo. |
| docs/superpowers/plans/2026-05-13-rolling-content-demo.md | Step-by-step implementation plan. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| wp_register_script( | ||
| 'newspack-wizards', | ||
| Newspack::plugin_url() . '/dist/wizards.js', | ||
| $this->get_script_dependencies(), | ||
| NEWSPACK_PLUGIN_VERSION, | ||
| true | ||
| ); | ||
| wp_enqueue_script( 'newspack-wizards' ); | ||
| } |
There was a problem hiding this comment.
Not fixing this one — the parent Wizard::enqueue_scripts_and_styles() assigns $asset_file = include …/wizards.asset.php; but never uses $asset_file afterward; wp_register_script passes NEWSPACK_PLUGIN_VERSION and $this->get_script_dependencies() regardless. So this override is functionally equivalent to the parent. If the parent's include is meant to drive cache busting/dependencies, that would be a separate bug in the parent class.
e7a7bb7 to
abedb05
Compare
All Submissions:
Changes proposed in this Pull Request:
Adds a hidden, URL-gated "Rolling Content" admin area to explore DataViews patterns with fake in-memory data. It is not intended for production use — the goal is to give us a sandbox for evaluating how a parent/child content model could be presented inside Newspack's admin chrome.
The wizard is invisible by default. Visiting
wp-admin/admin.php?page=newspack-rolling-contentregisters a top-level sidebar menu with "All Rolling Content" and "Add Rolling Content" sub-items, anchored near the top of the sidebar. Direct URL access remains the only entry point — no setting, link, or feature flag exposes it.All Rolling Content view uses
@wordpress/dataviewsto render 30 fake rolling content items with featured image, title, date, entries count, last updated, and status (Active / Archived / Scheduled, shown as@wordpress/icons+ plain text). Each row has inline "Manage" and "Add" buttons in the entries cell, plus kebab actions for Edit and Delete.Manage Entries opens a full-screen modal with a nested DataViews of child entries (title, date, author, featured image, status, tags). Add New Entry opens an info modal explaining the implicit parent association.
Add Rolling Content is a placeholder view that explains no editor is wired up for the demo.
The fake dataset is generated deterministically with coprime multipliers so we get variety across rows (5–25 entries per parent, varied tag counts, varied title selection).
How to test the changes in this Pull Request:
n ci-build newspack-plugin(orn build newspack-pluginif dependencies are already installed)./wp-admin/admin.php?page=newspack-rolling-contentdirectly. Confirm:newspack-wizard__content)./wp-admin/admin.php?page=newspack-rolling-content-adddirectly. Confirm:Other information:
This is a hidden demo — not intended to ship as a user-facing feature. No automated tests are included; verification is by direct admin URL access only.