feat(subscribers): add subscribers management UX prototype#4649
Draft
thomasguillot wants to merge 14 commits into
Draft
feat(subscribers): add subscribers management UX prototype#4649thomasguillot wants to merge 14 commits into
thomasguillot wants to merge 14 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an internal-only “Subscribers Demo” wizard to prototype a new subscriber management UX (list → profile → modal flows) using seeded mock data, plus small backward-compatible component updates to support the prototype.
Changes:
- Introduces a hidden Subscribers Demo wizard (PHP + JS entry) reachable via
admin.php?page=newspack-subscribers-demo. - Implements the prototype UI: DataViews-based subscriber list, profile view, and modal flows (refund/cancel, plan change, resubscribe, payment update, guided fix) powered by mock data.
- Adds backward-compatible UI component touches:
Noticegains an optionalnoMarginprop;Footergains an optionalsubscribers_demolink.
Reviewed changes
Copilot reviewed 17 out of 22 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/wizards/subscribersDemo/index.js | Mounts a Wizard with list + profile routes for the demo UX. |
| src/wizards/subscribersDemo/screens/SubscriberList.jsx | Implements L0 DataViews list with filters/sort/search/pagination and row navigation to profiles. |
| src/wizards/subscribersDemo/screens/PersonProfile.jsx | Implements L1 profile layout with subscriptions, payment methods, order history, and modal flow entry points. |
| src/wizards/subscribersDemo/screens/style.scss | Adds demo-specific styling (profile spacing tweaks, snackbar positioning, table paddings). |
| src/wizards/subscribersDemo/flows/RefundFlow.jsx | Implements refund/cancel modal flow with mock mutation behavior. |
| src/wizards/subscribersDemo/flows/PlanChangeFlow.jsx | Implements plan change modal flow with mock mutation behavior. |
| src/wizards/subscribersDemo/flows/ResubscribeFlow.jsx | Implements resubscribe flow with branching for payment-method presence and comping. |
| src/wizards/subscribersDemo/flows/PaymentUpdateFlow.jsx | Implements add/update payment method modal flow with mock validation and mutation. |
| src/wizards/subscribersDemo/flows/GuidedFixFlow.jsx | Implements guided-fix modal + snackbar notification helper for alerts. |
| src/wizards/subscribersDemo/data/mock-subscribers.js | Provides deterministic mock subscribers/plans and helper accessors for the demo. |
| src/wizards/subscribersDemo/assets/cards/visa.svg | Card brand icon asset used in payment method UI. |
| src/wizards/subscribersDemo/assets/cards/mastercard.svg | Card brand icon asset used in payment method UI. |
| src/wizards/subscribersDemo/assets/cards/amex.svg | Card brand icon asset used in payment method UI. |
| src/wizards/subscribersDemo/assets/cards/discover.svg | Card brand icon asset used in payment method UI. |
| src/wizards/subscribersDemo/assets/cards/jcb.svg | Card brand icon asset used in payment method UI. |
| packages/components/src/notice/index.js | Adds noMargin prop to Notice to support tighter layouts in VStacks. |
| packages/components/src/notice/style.scss | Adds .newspack-notice__no-margin styling hook. |
| packages/components/src/footer/index.js | Adds optional “Subscribers Demo” footer link when URL is present. |
| includes/wizards/class-wizard.php | Exposes subscribers_demo URL in debug mode for Footer to optionally render the link. |
| includes/wizards/class-subscribers-demo.php | Registers/enqueues the Subscribers Demo wizard assets and keeps it hidden from menus. |
| includes/class-wizards.php | Instantiates/registers the new Subscribers_Demo wizard. |
| includes/class-newspack.php | Includes the new wizard class file in plugin bootstrap. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d8410dc to
845286e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All Submissions:
Changes proposed in this Pull Request:
Adds a design prototype for the new Subscribers management experience, intended for internal review and feedback. The prototype is a hidden wizard (not surfaced in the admin menu) that ships with mock data so reviewers can explore the full flow end-to-end without needing a populated WooCommerce store.
Scope of the prototype:
Notice(from@wordpress/components) rather than the Newspack one, to keep the prototype aligned with the broader WordPress admin look without touching shared components. Informational copy inside modals is now plain paragraphs rather than info-level Notices, reserving Notice styling for things that genuinely warrant attention (warnings, errors).Edit(tertiary) andDelete(tertiary destructive) actions. Add / edit / delete fire a transientSnackbarrather than a persistent success Notice. Storage is localStorage for the prototype only (flagged with a code comment) — production needs a REST endpoint backed by user/post meta or an option so notes are shared across every admin viewing the same subscriber.FormTokenFieldwithvip,valued-reader,met-in-personas suggestions; free input allowed and normalized to lowercase). Tags render asBadge level="info"chips in the profile header under the email/status-summary lines. Tags are filterable on L0 (isAnyoperator) and available as an opt-in column. Same localStorage caveat as private notes.ToggleControlfor each newsletter (Daily Brief,Weekend Read,Arts & Culture,Breaking News). Toggling fires a transient Snackbar and persists immediately. Newsletter membership is filterable on L0 (isAnyoperator) and available as an opt-in column. Same localStorage caveat as private notes.The prototype is reachable at
admin.php?page=newspack-subscribers-demowhen the plugin is active. Card brand icons are copied from WooCommerce'spayment-methods-cardsassets. The sharedNoticecomponent inpackages/components/src/notice/is intentionally untouched.The full design spec for the tags + newsletters additions lives at
docs/superpowers/specs/2026-05-01-subscribers-tags-newsletters-design.md.How to test the changes in this Pull Request:
n ci-build newspack-plugin, and reload wp-admin./wp-admin/admin.php?page=newspack-subscribers-demo. Confirm the list renders with ~45 subscribers across mixed statuses.Editon one — modal reopens with the existing text and a "Save changes" button. ClickDelete— the card disappears and a "Private note deleted." Snackbar fires. Reload the page and confirm notes persist (localStorage, prototype only).info-level Badges (vip,valued-reader) render under the email/status summary lines in the profile header. Open Matt and confirm a singlevalued-readerBadge appears. Open Oscar Rivera (id 4) and confirm no tag chips render (he has no tags).vipandvalued-reader, and the three known suggestions (vip,valued-reader,met-in-person) appear when focused. Confirm Save is disabled until you change the list. TypeVIPand press Enter — confirm it normalizes tovipand dedupes (no duplicate token added). Type a brand-new tag (e.g.champion) and save — confirm a "Tags updated." Snackbar fires, the new chip appears in the header, and the modal closes. Reload the page and confirm tags persist (localStorage, prototype only).Daily BriefandWeekend Readare on;Arts & CultureandBreaking Newsare off. ToggleArts & Cultureon — confirm a "Subscribed to Arts & Culture." Snackbar fires. ToggleDaily Briefoff — confirm "Unsubscribed from Daily Brief." Snackbar fires. Reload the page and confirm the new state persists.vipselected — confirm Priya appears (plus any random extras seeded withvip). Switch the filter tomet-in-person— confirm Aisha appears.breakingselected — confirm Aisha appears (plus any random extras seeded withbreaking). Both Tags and Newsletters columns should be hidden by default.#wpbodyand the modal closes.Notice(e.g. Setup, Reader Activation) and confirm Notices render exactly as before — the shared component is untouched.Other information: