Skip to content

Scan: add Jetpack footer to the WP.com page#109888

Open
vianasw wants to merge 2 commits intotrunkfrom
add/jetpack-footer-scan
Open

Scan: add Jetpack footer to the WP.com page#109888
vianasw wants to merge 2 commits intotrunkfrom
add/jetpack-footer-scan

Conversation

@vianasw
Copy link
Copy Markdown
Contributor

@vianasw vianasw commented Apr 8, 2026

Part of JETPACK-1504

Proposed Changes

#109765 added the simplified Jetpack footer to four Calypso pages (Activity Log, Monetize, Traffic, Podcasting) but explicitly left Backup and Scan out due to the additional complexity of testing them. Backup is now closed by the sibling PR #109886. This PR closes the Scan half across all WP.com render paths reachable from /scan/<site-slug>.

Files touched

  • client/my-sites/scan/main.tsx — happy-path ScanPage (when the site has scan active). Footer gated on isWpcom. Pattern matches the Backup sibling PR Backup: add Jetpack footer to the WP.com page #109886 and Podcasting from Jetpack: add footer #109765.
  • client/my-sites/scan/wpcom-scan-upsell.tsxWPCOMScanUpsellPage reached via the showUpsellIfNoScan / showUpsellIfNoScanSelfServeFeature middlewares (client/my-sites/scan/index.js), plus the no_connected_jetpack / vp_active_on_site / multisite_not_supported reasons. File is wpcom-only by construction — the scan controller gates between this and ScanUpsellPage (the Jetpack Cloud variant) at isJetpackCloud() || isA8CForAgencies(), so no gate is needed inside the file itself.
  • client/my-sites/scan/wpcom-upsell.tsx — simpler WPCOMScanUpsellPage (same export name, different file) reached via ScanAtomicTransferWrapper in wpcom-atomic-transfer.tsx when the site doesn't have the scan feature. Same wpcom-only construction.
  • client/my-sites/scan/wpcom-atomic-transfer.tsx — adds footer to the ScanLoadingPlaceholder (the loading state rendered by ScanAtomicTransferWrapper while site features or scan data are still loading). Scan-specific local component, reachable only for non-Jetpack-Cloud sites because wpcomJetpackScanAtomicTransfer short-circuits on isJetpackCloud() || isA8CForAgencies() at the middleware level.

Total diff is 8 added lines across 4 files (one import + one render line per file).

Render path coverage

Scan's route middleware chain (client/my-sites/scan/index.js) means /scan/<site> can resolve to one of several components depending on site plan/features:

Render path Component Covered
Has scan product (happy path) main.tsx::ScanPage ✅ this PR (original commit)
No scan product / feature → upsell wpcom-scan-upsell.tsx::WPCOMScanUpsellPage ✅ this PR
No scan feature via ScanAtomicTransferWrapper wpcom-upsell.tsx::WPCOMScanUpsellPage ✅ this PR
Features/scan data loading wpcom-atomic-transfer.tsx::ScanLoadingPlaceholder ✅ this PR
Atomic transfer activation CTA WPCOMBusinessAT from client/components/jetpack/wpcom-business-at/index.tsx ⏳ fixed in #109886, arrives via trunk
Jetpack Cloud variant ScanUpsellPage (separate component) N/A (gated at controller level, has its own chrome)

Dependency on sibling PR #109886

The Atomic-transfer-activation CTA path routes through the shared <WPCOMBusinessAT /> component at client/components/jetpack/wpcom-business-at/index.tsx. That component is footered in the sibling Backup PR #109886 (in HEADER-008's 3-file expansion). When #109886 merges to trunk, this Scan branch will automatically get the shared fix via rebase/merge.

Until then, on this branch alone, the atomic-transfer CTA state will still be missing a footer. This is acknowledged and expected — merging #109886 first, or merging both together, resolves it. The atomic-transfer state is reached only when a Business-plan WP.com site without Atomic needs to be transferred to get Scan, which is a narrow flow.

Why are these changes being made?

#109765 added the simplified Jetpack footer to four Calypso pages (Activity Log, Monetize, Traffic, Podcasting) but explicitly left Backup and Scan out — quoting that PR's description:

Using the footer at Scan & Backup I'm also leaving for another PR due to a bit more complexity of testing those pages, so this is easier to merge sooner.

Backup is now closed by #109886. This PR closes the Scan half. After both land, JETPACK-1504's checklist will be complete and the parent issue (JETPACK-1391) can tick its remaining Calypso boxes.

Testing Instructions

Before / After (happy path, main.tsx)

calypso-scan-before

Before: Scan page ends at the bottom of the "Don't worry about a thing" status card with empty white space below it — no footer chrome.

calypso-scan-after

After: Same content with a new row at the bottom showing the green Jetpack pill on the left and the "An Automattic airline" byline on the right, matching the existing footer on Activity Log / Monetize / Traffic / Podcasting / Backup.

Steps to verify

  1. Happy path: On a WP.com site with Jetpack Scan active, navigate to /scan/<site-slug>. Expected: footer renders at the bottom.
  2. Upsell path (Simple/no scan): On a WP.com Simple site without Scan, navigate to /scan/<site-slug>. The page renders the upsell (WPCOMScanUpsellPage from either wpcom-scan-upsell.tsx or wpcom-upsell.tsx depending on the plan/feature combo). Expected: footer renders at the bottom.
  3. Loading state: Reload the Scan page while the feature/scan-data fetch is in flight. Expected: the ScanLoadingPlaceholder (shown during the brief loading flash) also renders the footer.
  4. Jetpack Cloud variant (if available): Navigate to the same Scan page from the Jetpack Cloud variant and confirm the footer does not render — Jetpack Cloud has its own chrome and the isWpcom / controller-level isJetpackCloud() gates suppress the new footer for that platform.
  5. Switch to a narrow viewport (≤460px) and confirm the footer wraps cleanly.

DOM check

Quickly verifiable from the browser console:

document.querySelector( 'footer.jetpack-footer' )
// → <footer class="... jetpack-footer" aria-label="Jetpack" role="contentinfo">…</footer>

To confirm there's no duplicate footer rendering:

document.querySelectorAll( 'footer.jetpack-footer' ).length
// → 1

Local validation already performed

Desktop:

  • curlingforbeginners9.wpcomstaging.com (Atomic with scan → main.tsx happy path): footer present, single instance

Mobile viewport (390×844, ≤460px breakpoint):

  • Simple upsell path on willstestdotblog.wordpress.com (routes via ScanAtomicTransferWrapperwpcom-upsell.tsx::WPCOMScanUpsellPage): footer renders below the "What is Jetpack?" section, wraps cleanly, single instance
  • Atomic happy path on curlingforbeginners9.wpcomstaging.com (routes via main.tsx::ScanPage): footer renders below the "Don't worry about a thing" status card, wraps cleanly, single instance

The wpcom-scan-upsell.tsx (full upsell with branching body) and ScanLoadingPlaceholder paths use the exact same pattern as the verified paths (import + <JetpackFooter /> after </Page> inside <Main>) and were code-reviewed rather than visually captured. The loading state is a transient flash too brief to reliably capture with agent-browser.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes? — N/A, wiring change with no logic to test
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)? — Simple verified on willstestdotblog.wordpress.com, Atomic verified on curlingforbeginners9.wpcomstaging.com. Self-hosted Jetpack n/a (these code paths are wpcom-only by construction).
  • Have you checked for TypeScript, React or other console errors? — none in local build; pre-commit Prettier ran clean
  • 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). — <footer role="contentinfo" aria-label="Jetpack"> inherits the same a11y as the existing JetpackFooter usages
  • Have you used memoizing on expensive computations? — N/A, no new computations
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)? — no new strings; the footer's "Jetpack" / "An Automattic airline" labels live in JetpackFooter itself and are already translated
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? — N/A, no new strings
  • 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)? — no, no tracking or data changes

Wires the simplified `JetpackFooter` component (introduced in #109765)
into the Scan page entry point, gated on the existing `isWpcom`
variable so it only renders on the WP.com (Calypso) variant — Jetpack
Cloud and A8C-for-Agencies have their own chrome and don't get a
duplicate footer.

Pattern matches Backup (#109886) and Podcasting from #109765: render
`<JetpackFooter />` after the `<Page>`/fragment branch but inside
`<Main>`, with the same `isWpcom` gate.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vianasw vianasw self-assigned this Apr 8, 2026
@vianasw vianasw requested a review from a team April 8, 2026 10:49
@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 Apr 8, 2026
@matticbot
Copy link
Copy Markdown
Contributor

matticbot commented Apr 8, 2026

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

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

  • notifications

To test WordPress.com changes, run install-plugin.sh $pluginSlug add/jetpack-footer-scan on your sandbox.

Copy link
Copy Markdown
Contributor

@CGastrell CGastrell left a comment

Choose a reason for hiding this comment

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

LGTM!

The original commit only covered the happy-path ScanPage from main.tsx.
Investigation against /scan/<simple-site> revealed three additional
WP.com render paths reachable through the Scan controller middleware
chain (client/my-sites/scan/index.js) that were missing a footer:

1. wpcom-scan-upsell.tsx (WPCOMScanUpsellPage) — reached via the
   showUpsellIfNoScan / showUpsellIfNoScanSelfServeFeature middlewares
   (and also for the no_connected_jetpack / vp_active / multisite
   reasons). Renders one of several PromoCard variants based on the
   reason prop. File is wpcom-only by construction — the scan
   controller gates between this and ScanUpsellPage (the Jetpack Cloud
   variant) at isJetpackCloud() || isA8CForAgencies(), so no gate is
   needed inside the file itself.

2. wpcom-upsell.tsx (WPCOMScanUpsellPage — same export name, simpler
   component) — reached via ScanAtomicTransferWrapper in
   wpcom-atomic-transfer.tsx when ! hasScanFeature. Same wpcom-only
   construction.

3. wpcom-atomic-transfer.tsx (ScanLoadingPlaceholder) — the loading
   state rendered by ScanAtomicTransferWrapper while site features or
   scan data are still loading. Scan-specific local component (not
   shared infrastructure), reachable only for non-Jetpack-Cloud sites
   (wpcomJetpackScanAtomicTransfer short-circuits on isJetpackCloud()
   || isA8CForAgencies() at the middleware level).

The inner atomic-transfer CTA path routes through the shared
<WPCOMBusinessAT /> component from
client/components/jetpack/wpcom-business-at/index.tsx. That component
was footered separately in HEADER-008's sibling PR #109886 and will
reach this branch via trunk once that PR merges.

Verified on willstestdotblog.wordpress.com (Simple, no scan feature →
upsell render path via wpcom-atomic-transfer.tsx → wpcom-upsell.tsx)
at mobile viewport (390×844): footer present, single instance, no
layout issues.

Verified the main.tsx happy path still works on
curlingforbeginners9.wpcomstaging.com with footerCount === 1 (no
duplication from the new additions).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants