fix(my-account): v2 demo donation detail rebuild#4691
Merged
thomasguillot merged 1 commit intoApr 30, 2026
Merged
Conversation
6 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.
All Submissions:
Changes proposed in this Pull Request:
A polish pass on the My Account v2 demo prototype, mostly focused on retro-fitting the donation detail page onto the v1-class-names-first reflex (brief §2.1.1) it predated. Stacks on top of
prototype/my-account-demo(umbrella PR #4679).Donation detail rebuild (Figma
2636:46488/2636:46512/2636:46661)donation-details.phprewritten to mirrorsubscription-details.php(Phase 4 shape): v1'snewspack-my-account__subscription--header / --title / --back-link / --actions / --actions-container / --actions-dropdownchrome withNewspack_UI_Icons::print_svg('chevronLeft' | 'more'), h1 +__font--xl→ h2 +__font--m, three actions in--actions-container(Edit donation / Update payment method / Cancel donation) duplicated into--actions-dropdownfor mobile.<table class="shop_table order_details">withtr.order-totalfor the bold Total row.<table class="shop_table subscription_details">with simple<tr><td><td>.<table class="shop_table shop_table_responsive my_account_orders woocommerce-orders-table woocommerce-MyAccount-orders woocommerce-orders-table--orders">withtr.order woocommerce-orders-table__row woocommerce-orders-table__row--status-<status>and.newspack-my-account__subscription--order-status-label.<status>empty-span dots.$status_dotPHP helper +__billing-tableclass retired.Fake-data status alignment
paid→completedeverywhere (21 fixture rows + the donations list$status_dothelper + per-template$status_labelswitches). v1's_subscriptions.scsscolours--order-status-label.<wc-status>for the canonical WC statuses (completed/refunded→ green;processing/pending/on-hold→ warning;cancelled/failed→ error). Sourcing fixtures on real WC names gets the green "Paid" dot for free on the detail-page billing history (and incidentally repairs a latent grey "Paid" dot on the subscription detail too) while the display label "Paid" is still rendered via the per-template label switches.processingstatus dot--order-status-label.processing { background: var(--newspack-ui-color-warning-50) }but--newspack-ui-color-warning-50doesn't exist in_colors.scss(the warning scale is 0/5/30/40 only) — so the dot silently falls back to neutral-60 grey. Latent v1 bug. Override scoped to the demo wrappers under.newspack-my-account.newspack-my-account-v2-demo(5-class chain matches v1's specificity; v2-demo CSS enqueues at priority 12 vs v1's 11 so cascade order picks ours) setsbackground: var(--newspack-ui-color-warning-30)(tokenwarning-300).Detail-page table polish (donation + subscription)
shop_table.order_details+subscription_details: drop the inheritedtrborder, even spacer-3 padding across rows, font-size-s for tabular content density, vertical-align top so the multi-line "Payment method" cell sits flush with its label.--color-borderdivider under thead, lighterneutral-5hairline between tbody rows, spacer-2 thead / spacer-3 tbody padding (mirrors the existing list-page__previous-tablerecipe).<h2 class="newspack-ui__font--m">size pinned at the scoped wrapper because the utility's(0,2,0)specificity gets out-ranked by some themes'.entry-content h2rules.font-size-swith zeroed theme margin and aspacer-2bottom margin to separate from the table.<small>wrapper around the "Exp. MM/YY" line dropped on both detail templates so the expiry renders at body size next to the brand line.Action button visibility (donation + subscription)
--action-linkclass so v1's desktop hide rule (@media (min-width: 768px) { .newspack-my-account__subscription--action-link { display: none } }) doesn't kill them. Same fix applied to subscription's Renew button (cancelled / expiring states), which had the same parallel bug since Phase 4.Modify donation modal layout (Figma
2983:16128)__modal__contentre-painted as a flex column withspacer-5(24px) gap; direct-child margins zeroed so the gap is the only spacing between Frequency / Amount / Cover transaction fees / Recurring totals / action buttons.align-items: stretch+flex: 1 1 100%on the segment buttons) andspacer-1(8px) label-to-control gap.__currency-input):spacer-1(8px) label-to-input gap.margin-top: calc(spacer-2 * -1)on the inner table to absorb the thead's inherited_my-account.scss .shop_table { padding-top: spacer-2 }so the heading sits at the box'sspacer-5padding-top instead of stacking to 36px.label.checkboxmargin-bottom +__helper-textmargin-top so the helper text reads tight against the checkbox row.__actionsdiv withspacer-2(12px) gap between Confirm and Cancel.$next_datesnow always carries bothmonthandyearentries — the donation's ownnext_paymentfor the current frequency, andtoday + 1 [unit]projected for the alternative — so flipping tabs yields a real date instead of an empty string.How to test the changes in this Pull Request:
Log in as administrator. All surfaces live behind the demo flag.
/my-account/donations/don-001/?my-account-v2-demo=1. Verify: header chrome matches the subscription detail page (back chevron, h2 +font-mtitle, no badge, three buttons next to More dropdown); Amount table reads as a borderless, evenly-spaced breakdown with a bold Total row; First / Latest / Next + Payment method block reads similarly with "Visa ending in 4242" + "Exp. 02/27" both at body size on the same multi-line cell; "Payment method" label sits flush with the brand line (vertical-align top); billing history table has a heavier--color-borderdivider under thead and lighterneutral-5hairlines between rows; Paid rows show a green dot, Processing rows show a warning-300 dot, Cancelled / Failed rows show a red dot./my-account/donations/don-cancelled/?my-account-v2-demo=1. Verify: the Restart donation button is visible flat (not just the More dropdown — the bug fix). Click it; the existing Restart donation modal opens./my-account/donations/don-onetime-1/?my-account-v2-demo=1. Verify: no action buttons in the header (one-time donations have nothing to edit / cancel / restart); a single "Donation date" row replaces First / Latest / Next./my-account/donations/?my-account-v2-demo=billing-history. Previous donations table still renders correctly with the green "Paid" dot./my-account/donations/don-001/, click "Edit donation". Verify the modal layout matches Figma2983:16128: full-width Frequency tabs with 8px gap from the label; 8px gap between the Amount label and currency input; checkbox + helper text sit tight; Recurring totals box has consistent 24px top + bottom padding; Confirm / Cancel buttons sit 12px apart with 24px from the Recurring totals box. Switch the Frequency tab from Monthly to Annually — the "Next donation:" date updates to a projectedtoday + 1 yeardate (instead of going blank)./my-account/subscriptions/sub-001/?my-account-v2-demo=1. Verify the same table polish carries over to the subscription detail (it shares the same SCSS scope). The "Paid" dots in billing history are now green; "Processing" rows show warning-300./my-account/subscriptions/sub-cancelled/and/sub-expiring/. Verify the Renew subscription button is visible flat (not only via dropdown)./my-account/donations/don-001/(no flag) → falls through / 404;/my-account/subscriptions/without admin gate → v1 unchanged.Other information: