Skip to content

A4A Agency Tier: add influenced revenue tooltip - #111013

Merged
tiagonoronha merged 6 commits into
trunkfrom
add/a4a-influenced-revenue-tooltip
May 27, 2026
Merged

tiagonoronha merged 6 commits into
trunkfrom
add/a4a-influenced-revenue-tooltip

Conversation

@tiagonoronha

@tiagonoronha tiagonoronha commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

Part of A4A-2621

Screenshot 2026-05-25 at 14 51 35

Proposed Changes

Adds an info-icon tooltip next to the Influenced revenue title on the A4A Agency Tier overview that explains what the metric covers, mirroring the WooPayments dashboard popover pattern (click-to-open A4APopover on desktop, InfoModal on mobile, with a "Learn more" link opened in the help center).

  • influenced-revenue.tsx — new InfluencedRevenueStrapline sub-component renders the title plus an info icon that toggles the popover/modal. Content is a single translate() call with {{br/}}{{br/}} separators and an {{a}}Learn more{{/a}} interpolation that calls useHelpCenter().showSupportGuide( LEARN_MORE_URL ) — same shape as consolidated-views.tsx in the WooPayments dashboard.
  • influenced-revenue.scss (new) — alignment for the inline icon (inline-flex, cursor: pointer, neutral-70 color) and popover content sizing (body-medium, 200px / 300px min-width at break-mobile) + the same neutral-100 underlined link styling the WooPayments popover uses, extended to cover Button variant="link".
  • a4a-popover/index.tsx — adds an optional anchor?: HTMLElement | null prop forwarded to the WP Popover's modern anchor API so the popover can center on the info icon rather than on the popover's DOM render position. Existing call sites (consolidated stats card, license preview, status badges, etc.) keep working unchanged — they don't pass anchor, and wrapperRef was already a no-op since @wordpress/components Popover stopped reading the legacy context prop.
  • stat/index.tsx — widens strapline?: string to strapline?: ReactNode so the title + icon can be passed as JSX. The only other call site (partner-directory/lead-matching) still passes a string.

Why are these changes being made?

The Agency Tier overview surfaces "Influenced revenue" as a headline metric but the page doesn't explain what counts as influenced revenue, so it's not obvious to agencies why the number is what it is. The tooltip clarifies that it covers referrals, client purchases, and managed sites using Automattic products, and points to the help-center article for the full breakdown.

The WooPayments dashboard already uses the same info-icon + popover/modal pattern for Total WooPayments commissions paid, so this reuses that exact UX (and the same A4APopover / InfoModal / showSupportGuide plumbing) for consistency.

Testing Instructions

  1. Open the live link and go to A4A → Agency tier.
  2. Confirm an info icon sits next to INFLUENCED REVENUE in the progress card; hover shows a pointer cursor.
  3. Click the icon: a popover should open centered on the icon, containing two paragraphs of explanation and a Learn more link on its own line below.
  4. Click Learn more — the help-center widget should open on the "Automattic for Agencies earnings" article (https://agencieshelp.automattic.com/knowledge-base/automattic-for-agencies-earnings/).
  5. Click outside the popover — it should dismiss.
  6. Tab to the icon and press Enter — the popover should open via keyboard.
  7. Resize to mobile width: clicking the icon should open the same content in an InfoModal (titled "Influenced revenue") instead of the popover.
  8. Sanity-check the other A4A surfaces that use A4APopover still render correctly (WooPayments dashboard's "Total WooPayments commissions paid" popover, license preview tooltips, status badges) — no behavior change expected.
  9. Verify no TypeScript / React console errors.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • For UI changes, have you tested the affected components in dark mode?
  • Have you tested accessibility for your changes? Ensure the feature remains usable with various user agents (e.g., browsers), interfaces (e.g., keyboard navigation), and assistive technologies (e.g., screen readers) (PCYsg-S3g-p2).
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

Adds an info-icon tooltip next to the "Influenced revenue" title on the
Agency Tier overview that explains what the metric covers, mirroring the
WooPayments dashboard popover pattern (click-to-open A4APopover on
desktop, InfoModal on mobile, with a "Learn more" link opened in the
help center).

A4APopover gains an optional `anchor` prop wired through to the WP
Popover's modern API so the popover can center on the info icon rather
than on its DOM render position; existing call sites are unaffected
because they don't pass `anchor`.

Stat's `strapline` prop is widened from `string` to `ReactNode` so the
title + tooltip can be passed as JSX.
@tiagonoronha
tiagonoronha marked this pull request as ready for review May 25, 2026 13:56
@tiagonoronha
tiagonoronha requested a review from a team May 25, 2026 13:56
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label May 25, 2026
Dispatches calypso_a4a_agency_tier_influenced_revenue_info_open when the
popover or modal opens (mouse or keyboard), and
calypso_a4a_agency_tier_influenced_revenue_learn_more_click when the
in-popover Learn more link is followed, matching the analytics pattern
used elsewhere in A4A.

@travisw travisw left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖🧪 Reviewed by Travbot · experimental — use your judgement, ignore what doesn't fit

Looks good to ship. Mirrors the WooPayments CardInfo pattern faithfully and the A4APopover wrapperRef → anchor refactor is documented + backwards-compatible.

FYI not blocking: the icon-button + popover/modal pattern now lives in two places (CardInfo and this one). Worth keeping in mind if a third use case shows up — extracting a shared <InfoTooltip> would be a natural moment then.

@travisw

travisw commented May 25, 2026

Copy link
Copy Markdown
Contributor

Tab to the icon and press Enter — the popover should open via keyboard.

While that did work well, I didn't see any visual indication of the icon being selected when tabbing back and forth to find it.

@tiagonoronha

Copy link
Copy Markdown
Contributor Author

Tab to the icon and press Enter — the popover should open via keyboard.

While that did work well, I didn't see any visual indication of the icon being selected when tabbing back and forth to find it.

👍 I'm going to add that in a separate PR as it's something that we can also refactor on a few other places with a new A4APopoverTrigger component.

@matticbot

matticbot commented May 27, 2026 •

Copy link
Copy Markdown
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • help-center
  • notifications
  • odyssey-stats

To test WordPress.com changes, run install-plugin.sh $pluginSlug add/a4a-influenced-revenue-tooltip on your sandbox.

@github-actions

Copy link
Copy Markdown

Looks like one of the E2E tests has failed.

You can fix them following these steps:

  1. Check out this branch locally:
    gh pr checkout 111013
  2. Start Claude Code in the repo:
    claude
  3. Run the /fix-e2e-tests skill, passing this PR number:
    /fix-e2e-tests 111013
    

@tiagonoronha
tiagonoronha merged commit b978153 into trunk May 27, 2026
14 checks passed
@tiagonoronha
tiagonoronha deleted the add/a4a-influenced-revenue-tooltip branch May 27, 2026 13:10
@github-actions github-actions Bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label May 27, 2026
@a8ci18n

a8ci18n commented May 27, 2026 •

Copy link
Copy Markdown

This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/33689782

Some locales (Hebrew, Japanese) have been temporarily machine-translated due to translator availability. All other translations are usually ready within a few days. Untranslated and machine-translated strings will be sent for translation next Monday and are expected to be completed by the following Friday.

Thank you @tiagonoronha for including a screenshot in the description! This is really helpful for our translators.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants