Skip to content

MWPW-193548: Carry locale tax label through mas-field & Copy Field preview#820

Open
antonio-rmrz wants to merge 3 commits intomainfrom
MWPW-193548
Open

MWPW-193548: Carry locale tax label through mas-field & Copy Field preview#820
antonio-rmrz wants to merge 3 commits intomainfrom
MWPW-193548

Conversation

@antonio-rmrz
Copy link
Copy Markdown
Contributor

@antonio-rmrz antonio-rmrz commented May 1, 2026

Resolves https://jira.corp.adobe.com/browse/MWPW-193548

Description

  • Copy Field on fr_FR fragments dropped the "TTC" tax label in both the side-nav popover preview and the headless render of pasted mas-field links. Both assumed data-display-tax="true" was authored on the source span; tax/per-unit are actually locale-resolved at render time (FR_fr is in DISPLAY_ALL_TAX_COUNTRIES).
  • web-components/src/mas-field.js: register a price options provider that flips FF_DEFAULTS for inline-prices nested under <mas-field> — mirrors merch-card.js, scoped per-element.
  • studio/src/mas-side-nav.js: drop the wantsExtras heuristic in #resolveInlinePricesInHtml; the rendered preview DOM already reflects locale resolution, so use formattedText.
  • Tests: 3 provider cases in mas-field.test.js, 1 popover regression in mas-side-nav.test.js. Full web-components suite green (1276 / 0 / 2 skipped).

Test URLs —

Studio:

Premiere Site:

…nd Copy Field preview

Two coordinated changes so prices rendered through `<mas-field>` (the
headless Copy Field flow used on da-cc pages) carry the same
locale-default labels as merch-card-hosted prices, and so the Copy
Field popover preview mirrors what the user sees.

- web-components/src/mas-field.js: register a price options provider
  that flips FF_DEFAULTS on for inline-prices whose nearest ancestor
  is `<mas-field>`, mirroring merch-card.js. Without this, headless
  fr_FR renders skipped DISPLAY_ALL_TAX_COUNTRIES resolution and lost
  the "TTC" tax label.

- studio/src/mas-side-nav.js: drop the `wantsExtras` heuristic that
  was checking `data-display-tax`/`data-display-per-unit` on the
  source span. Tax/per-unit labels are locale-driven and already
  reflected in the rendered preview DOM, so prefer formattedText
  (rendered output) and fall back to coreText only if labels were
  absent.
@aem-code-sync
Copy link
Copy Markdown

aem-code-sync Bot commented May 1, 2026

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-sync branch
Commits

@codecov
Copy link
Copy Markdown

codecov Bot commented May 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.48%. Comparing base (5d49c47) to head (3e5bc21).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #820      +/-   ##
==========================================
+ Coverage   87.45%   87.48%   +0.03%     
==========================================
  Files         214      214              
  Lines       63827    63848      +21     
==========================================
+ Hits        55821    55860      +39     
+ Misses       8006     7988      -18     
Files with missing lines Coverage Δ
studio/src/mas-side-nav.js 93.91% <100.00%> (+0.11%) ⬆️
web-components/src/mas-field.js 100.00% <100.00%> (ø)

... and 4 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5d49c47...3e5bc21. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Regression test for the popover-preview half of the fix: opens the Jira
reproducer fragment in fr_FR, asserts the rendered card preview carries
a non-disabled `.price-tax-inclusivity` ("TTC"), opens the Copy Field
side-nav popover, and asserts the Prices row preview contains the same
label. Locks in the mas-side-nav.js change.

studio.page.js gets four new locators for the Copy Field flow
(side-nav button + open popover + row-by-label helper + row-value
helper), scoped via `this.sideNav` so Playwright pierces the side-nav
shadow root cleanly.
Wrap the registerPriceOptionsProvider guard so it stays under the
project line-length cap. No behavior change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants