feat(newsletters): bundled-mode parity for subscription-list modal (NEWS-2152, NEWS-2168)#4707
Draft
thomasguillot wants to merge 5 commits into
Draft
feat(newsletters): bundled-mode parity for subscription-list modal (NEWS-2152, NEWS-2168)#4707thomasguillot wants to merge 5 commits into
thomasguillot wants to merge 5 commits into
Conversation
3 tasks
The `bridgeMounted` flag was only set via the one-shot `newspack-newsletters:bridge-mounted` event listener. If the bridge bundle booted before this module evaluated, the event was missed and the 500ms fallback timer redirected to the legacy editor after every modal-open attempt. Replace the local mutable boolean with a sync read of `window.newspackNewslettersBridgeReady`, which the bridge now sets before dispatching the event. Refs NEWS-2152
…2168)
Stacks the bundled-mode side onto the same wiring as NEWS-2152's
local-list parity. The wizard's SubscriptionLists view dispatches
OPEN_MODAL with kind='esp' for remote rows (replacing the legacy
ExternalLink to the CPT editor) and the active toggle commits
immediately via PATCH /lists/{db_id}.
- Edit on remote rows opens the same modal in ESP mode through the
wizard-bridge (legacy edit_link still serves as the fallback when
the bridge isn't ready).
- Inline TextControl/TextareaControl pair removed for remote rows —
the modal owns title + description.
- Active toggle on every row PATCHes that one row; bulk
"Save Subscription Lists" button removed.
- Description string surfaced under the bold ActionCard title (with
the type label kept on a smaller line below) so publishers see what
customisation is in place without opening the modal.
7 tasks
3 tasks
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.
Companion to Automattic/newspack-newsletters#2108 (NEWS-2152) and Automattic/newspack-newsletters#2110 (NEWS-2168).
Wires the Newsletters wizard's
<SubscriptionLists>per-row Edit / Delete buttons and Add New click to the documentedwizard-bridgeevents fromnewspack-newsletters. Listener reloads the lists on save / delete. 500 ms fallback timer routes to the legacy CPT editor URL when the bridge bundle is missing (e.g. oldernewspack-newslettersbuild without the bridge).NEWS-2168 stacks the ESP-row side on top: Edit on remote rows opens the same modal in
kind='esp'(no audience picker, title + description only), the active toggle commits immediately via the newPATCH /lists/{db_id}route, and the bulk "Save Subscription Lists" button is retired so every interaction commits per-row.What changed
<SubscriptionLists>: per-row Edit / Delete buttons replace the legacy<ExternalLink>fortype === 'local'rows; Add New is now a click handler dispatchingnewspack-newsletters:open-local-list-modal.kind: 'esp'(legacyedit_linksurvives only as the fallback URL).TextControl/TextareaControlpair on remote rows is gone — the modal owns title + description.useEffectlistens fornewspack-newsletters:local-list-savedand:local-list-deletedand re-fetches the lists (event names cover both kinds; payload now carrieskind).Test plan
newspack-newslettersbranches (NEWS-2152 already merged into the epic; NEWS-2168 onnews-2168-revisit-esp-subscription-list-edit-flow-standalone).newspack-newslettersbundle JS to confirm the fallback timer redirects to the legacy URL on Edit.Merge order
Merge the
newspack-newslettersbranches first; this PR follows.