Skip to content

feat(rolling-content): hidden DataViews demo wizard#4728

Draft
thomasguillot wants to merge 21 commits into
trunkfrom
feat/rolling-content-demo
Draft

feat(rolling-content): hidden DataViews demo wizard#4728
thomasguillot wants to merge 21 commits into
trunkfrom
feat/rolling-content-demo

Conversation

@thomasguillot
Copy link
Copy Markdown
Contributor

@thomasguillot thomasguillot commented May 14, 2026

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-content registers 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/dataviews to 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.

rolling-content-all

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.

rolling-content-entries

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:

  1. Check out this branch and run n ci-build newspack-plugin (or n build newspack-plugin if dependencies are already installed).
  2. Verify the menu is hidden by default: load any other wp-admin page and confirm there is no "Rolling Content" item in the sidebar.
  3. Visit /wp-admin/admin.php?page=newspack-rolling-content directly. Confirm:
    • A top-level "Rolling Content" menu appears near the top of the sidebar (just after Dashboard).
    • Two sub-items are visible: "All Rolling Content" and "Add Rolling Content".
    • The top-level item is highlighted as Active, with "All Rolling Content" highlighted underneath.
    • The Newspack admin chrome (header with "Newspack" / "Rolling Content" section name, "Add Rolling Content" primary action) is present.
  4. In the All view, confirm:
    • 30 rows render in a DataViews table at 20 per page.
    • Columns: Featured image, Title, Date, Entries (with count + Manage + Add buttons inline), Last updated, Status.
    • Status renders as an icon plus plain text (no colored pill).
    • DataViews spans the full content width (no max-width cap inside newspack-wizard__content).
    • Sorting and global search work.
  5. Click the row kebab. Confirm only "Edit" and "Delete" appear (no bulk actions).
    • Edit opens an info modal.
    • Delete opens a confirm modal and removes the row on confirm.
  6. Click "Manage" on a row. Confirm a full-screen modal opens with:
    • A nested DataViews of entries (title, date, author, featured image, status, tags).
    • A toolbar showing "Entries for: " and an "Add New Entry" button.
    • The modal closes via the X button.
  7. Click "Add" on a row. Confirm an info modal opens explaining the implicit parent association.
  8. Visit /wp-admin/admin.php?page=newspack-rolling-content-add directly. Confirm:
    • The sub-item "Add Rolling Content" is highlighted.
    • The view renders a placeholder section with a "Back to All Rolling Content" secondary action in the header.
  9. Reload the page on both URLs and confirm menu state persists.

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?

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.

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

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_Demo wizard that conditionally registers a top-level menu plus two sub-pages (All and Add) and enqueues the shared wizards bundle.
  • Two React routes added to src/wizards/index.tsx rendering an All DataViews view (with row actions for Edit / Manage / Add Entry / Delete) and an Add placeholder 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 under docs/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.

Comment thread src/wizards/rollingContent/views/all.tsx
Comment thread src/wizards/rollingContent/views/all.tsx Outdated
Comment on lines +200 to +208
wp_register_script(
'newspack-wizards',
Newspack::plugin_url() . '/dist/wizards.js',
$this->get_script_dependencies(),
NEWSPACK_PLUGIN_VERSION,
true
);
wp_enqueue_script( 'newspack-wizards' );
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@thomasguillot thomasguillot force-pushed the feat/rolling-content-demo branch from e7a7bb7 to abedb05 Compare May 14, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants