Skip to content

A4A: Add backups to the agency site detail view#112205

Merged
yashwin merged 3 commits into
trunkfrom
a4a-2904-agency-site-backups
Jul 9, 2026
Merged

A4A: Add backups to the agency site detail view#112205
yashwin merged 3 commits into
trunkfrom
a4a-2904-agency-site-backups

Conversation

@yashwin

@yashwin yashwin commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

This PR is built on top of #112208.

Part of A4A-2905
Resolves A4A-2915

This is PR 2 of 2. The shared, route-agnostic backup components it consumes were extracted in PR 1 (#112208); this PR contains only the A4A wiring (client/dashboard/agency/** + the agency router).

Proposed Changes

  • Adds the full Backups experience to the A4A agency site detail view — the activity-log restore-point list, the detail pane with file browser, Download, and Restore — reusing the shared backup components extracted in Dashboard: Extract route-agnostic backup components for reuse #112208.
  • Adds thin A4A shells + routes: /sites/$siteSlug/backups, .../$rewindId, .../restore, .../download, gated on the agency site's has_backup flag.
  • Adds a Backups item in the site-scoped sidebar and a Last-backup card on the Overview.

Why are these changes being made?

Testing Instructions

  1. Build and run the Dashboard client for A4A (yarn start-dashboard) as an agency (non-client) user.
  2. Open a backup-enabled agency site → Backups in the site sidebar (and the Last-backup card on Overview).
  3. Confirm the restore-point list, date-range filtering, and the detail pane (file browser) render.
  4. Confirm Download backup and Restore to this point navigate to their flows and complete.
  5. Confirm the Last-backup card on the Overview links to the site's backups page (using the site URL slug) and reflects backup state.
  6. Confirm the dotcom backups experience (multi-site dashboard) is unchanged.
Screenshot 2026-07-02 at 3 38 25 PM Screenshot 2026-07-02 at 3 38 56 PM

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? (PCYsg-S3g-p2)
  • Have you used memoizing on expensive computations?
  • 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 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)?

@yashwin
yashwin requested a review from a team July 2, 2026 07:03
@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 Jul 2, 2026
@yashwin yashwin self-assigned this Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

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 112205
  2. Start Claude Code in the repo:
    claude
  3. Run the /fix-e2e-tests skill, passing this PR number:
    /fix-e2e-tests 112205
    

@yashwin
yashwin force-pushed the a4a-2904-agency-site-backups branch from 78cceaf to 1914c58 Compare July 2, 2026 07:32
@yashwin
yashwin changed the base branch from a4a-2904-implement-site-details-view to a4a-2904-backups-refactor July 2, 2026 07:32
@yashwin
yashwin marked this pull request as ready for review July 2, 2026 09:54
@yashwin
yashwin requested a review from a team as a code owner July 2, 2026 09:54
@yashwin
yashwin force-pushed the a4a-2904-backups-refactor branch from c304ff8 to e18ce4d Compare July 6, 2026 11:01
@yashwin
yashwin force-pushed the a4a-2904-agency-site-backups branch from 53ef448 to 71b5d87 Compare July 6, 2026 11:07
Comment thread client/dashboard/agency/sites/site/backups-list-page.tsx
Comment thread client/dashboard/agency/sites/site/backups.tsx Outdated
Comment thread client/dashboard/agency/sites/site/backup-download.tsx Outdated

@jkguidaven jkguidaven 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.

Left minor comments. Feel free to address them.

@yashwin
yashwin force-pushed the a4a-2904-backups-refactor branch from e18ce4d to add48e7 Compare July 7, 2026 07:36
@yashwin
yashwin force-pushed the a4a-2904-agency-site-backups branch from 71b5d87 to eaeab36 Compare July 7, 2026 09:29
@yashwin
yashwin force-pushed the a4a-2904-backups-refactor branch 2 times, most recently from ee18a14 to 58a456e Compare July 7, 2026 09:39
@yashwin
yashwin force-pushed the a4a-2904-agency-site-backups branch from eaeab36 to 8691e4a Compare July 7, 2026 09:42
@yashwin

yashwin commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review @jkguidaven 🙏 — addressed all three by extracting shared page shells (BackupsPage, BackupFileBrowserProvider, BackupDownloadPage) into the base PR #112208 and making the agency shells thin consumers. Would you mind taking another look?

@yashwin
yashwin force-pushed the a4a-2904-backups-refactor branch from 58a456e to b8355a1 Compare July 7, 2026 10:21
@yashwin
yashwin force-pushed the a4a-2904-agency-site-backups branch from 8691e4a to 4b75bb0 Compare July 7, 2026 10:29
@yashwin
yashwin force-pushed the a4a-2904-backups-refactor branch from b8355a1 to e63973e Compare July 8, 2026 03:33
Base automatically changed from a4a-2904-backups-refactor to trunk July 8, 2026 03:54
@yashwin
yashwin force-pushed the a4a-2904-agency-site-backups branch from 4b75bb0 to 7a63181 Compare July 8, 2026 04:03
yashwin and others added 2 commits July 9, 2026 08:33
Adds the full Backups experience (list, detail with file browser, Download,
and Restore) to the A4A agency site detail, reusing the multi-site
dashboard's backup components.

Shared, route-agnostic pieces used by both dotcom and A4A:
- BackupsBrowser (list + detail grid + selection + activity log)
- BackupRestoreFlow / BackupDownloadFlow (step machines)
- BackupDetails (navigation injected via callbacks)
- BackupCardContent (parameterized by siteId + backupUrl)

The dotcom pages become thin shells over those shared components; A4A adds
its own thin shells + routes (/sites/$siteSlug/backups[/$rewindId[/restore|/download]]),
gated on the agency site's has_backup flag.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Add the "Back up now" button (with useBackupState and the
  BackupNotices progress banner) to the agency backups list page.
* Forward searchParams to BackupsBrowser so the DataView hydrates
  page/search state from the URL, matching dotcom.
* Add a loader on the backups route to prefetch site settings and
  backups in parallel, removing the site → settings suspense waterfall.
* Fix stale $siteId route comments to $siteSlug.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the duplicated agency backup shells with the shared components
extracted in the base branch, addressing the review feedback:

* backups-list-page renders <BackupsPage> with agency-route navigation
  built via useBackupsNavigation
* backups uses <BackupFileBrowserProvider>
* backup-download renders <BackupDownloadPage>

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@yashwin
yashwin force-pushed the a4a-2904-agency-site-backups branch from 7a63181 to 54e0098 Compare July 9, 2026 03:03
@yashwin
yashwin added this pull request to the merge queue Jul 9, 2026
Merged via the queue into trunk with commit 8a0a1c0 Jul 9, 2026
11 checks passed
@yashwin
yashwin deleted the a4a-2904-agency-site-backups branch July 9, 2026 03:26
@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 Jul 9, 2026
@a8ci18n

a8ci18n commented Jul 9, 2026

Copy link
Copy Markdown

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

Some locales (Hebrew) 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 @yashwin for including a screenshot in the description! This is really helpful for our translators.

@matticbot

Copy link
Copy Markdown
Contributor

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

App Entrypoints (~2143 bytes added 📈 [gzipped])

Details
name                    parsed_size           gzip_size
entry-dashboard-dotcom      +7769 B  (+0.2%)    +2020 B  (+0.2%)
entry-dashboard-ciab        +7769 B  (+0.2%)    +2018 B  (+0.2%)
entry-dashboard-a4a         +7769 B  (+0.2%)    +2016 B  (+0.2%)
entry-subscriptions         +1660 B  (+0.1%)     +415 B  (+0.1%)
entry-stepper               +1660 B  (+0.1%)     +429 B  (+0.1%)
entry-reauth-required       +1660 B  (+0.1%)     +419 B  (+0.1%)
entry-main                  +1660 B  (+0.1%)     +438 B  (+0.1%)
entry-login                 +1660 B  (+0.1%)     +419 B  (+0.1%)
entry-domains-landing       +1660 B  (+0.2%)     +415 B  (+0.2%)
entry-browsehappy           +1660 B  (+0.6%)     +415 B  (+0.6%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Sections (~490 bytes added 📈 [gzipped])

Details
name                parsed_size           gzip_size
staging-site            +5913 B  (+0.2%)     +553 B  (+0.1%)
site-performance        +5913 B  (+0.2%)     +553 B  (+0.1%)
site-monitoring         +5913 B  (+0.2%)     +553 B  (+0.1%)
site-logs               +5913 B  (+0.2%)     +553 B  (+0.1%)
plans                   +5913 B  (+0.1%)     +553 B  (+0.1%)
github-deployments      +5913 B  (+0.2%)     +553 B  (+0.1%)
domains                 +5913 B  (+0.1%)     +553 B  (+0.1%)
sites-dashboard         +5595 B  (+0.2%)     +490 B  (+0.1%)
site-settings           +5595 B  (+0.2%)     +490 B  (+0.1%)
overview                +5595 B  (+0.1%)     +490 B  (+0.0%)
hosting                 +5595 B  (+0.2%)     +490 B  (+0.1%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Async-loaded Components (~485 bytes added 📈 [gzipped])

Details
name                                                                   parsed_size           gzip_size
async-load-calypso-my-sites-customer-home-celebrate-site-launch-modal      +5913 B  (+0.3%)     +553 B  (+0.1%)
async-load-calypso-sites-v2-sites-list                                      -318 B  (-1.2%)      -68 B  (-1.1%)

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants