Repository navigation
My Jetpack: animate the onboarding panel beside each step - #52844
DevinWalker merged 21 commits into
Conversation
The prototype's identity stage, ported: the site's own homepage in a browser window in a receding stack, over a count of what is in it. The screenshot comes from WordPress.com's mshots service, the same one Calypso uses. It has no callback and no status, so it is polled: the same URL answers 200 with a placeholder while the page renders and 200 with the picture once it has. Both are 400 by 300, so the content type is the only thing that separates them and the pixels cannot be measured. Nothing waits on it. The panel draws either way and the picture arrives into it, or it does not. What the panel will not claim: - No window at all for a site that cannot be photographed. A frame around nothing promises a photograph that will never arrive, and the counts on their own are at least all true. - No count of zero. A zero is how an unmeasured field is spelled at least as often as it is a real count. - The backs of the stack are blank. The prototype writes the site's feed URLs on them because its scan really read those pages; we read nothing. - A numeral counts up only when it is large enough for the count to read as motion. Counting to 1 spends most of a second showing 0. The whole panel is hidden from the accessibility tree: the question is on the left, and the picture is of a site the reader is sitting inside. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ReATUyBCovcuj1bAfZ4VNJ
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Measured against the live service on pages it had not seen: 5.0, 5.4 and 6.5 seconds to a picture. The poll ran on a flat 2.5s interval, so a picture ready at 5.4s was not noticed until 7.5s and up to 2.5s of the wait was ours rather than the service's. The polls are 1s apart while the render is plausibly finishing and 2.5s apart afterwards, when they are only there for the slow case, with a 25s deadline. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ReATUyBCovcuj1bAfZ4VNJ
The request went out when the panel mounted, which is the question step, which is where a connected user opens. The service takes around five seconds on a page it has not seen, so the wait landed entirely on the one screen that shows the picture. It is asked for at the wizard instead. The connect step sends the user to WordPress.com and back through a fresh page load, so on an unconnected site the render happens while they are away and the picture is waiting when they return. That meant dropping the connection requirement from the PHP guard. Connecting does not change whether the world can reach this host, it only proves it, and the proof arrives too late to be useful. The local, offline-mode and blog_public checks are what actually answer the question and they stay. Losing the proof exposes a hole that was already there: a host the service cannot reach is answered with a WordPress.com error card, as HTTP 200 and image/jpeg exactly like a homepage, and we would hang it in the frame and call it their site. Measured against the live service, every unreachable host gets back byte for byte the same card, so the two cards are now recognised by size and thrown away. The size comes from the body, because the service sends content-length on the placeholder and not on the picture. Verified against the live service: an unreachable host stops after two polls and shows counts only, a real page appears in about seven seconds from page load. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ReATUyBCovcuj1bAfZ4VNJ
Never photograph a private or coming-soon site. blog_public is not a boolean: 0 asks search engines away, and -1 and below, which More Privacy Options adds on multisite, mean private. Every one of them cast to true, so a private site was sent to the screenshot service and its splash hung in a frame captioned with its own domain. Leave trashed uploads out of the media count. wp_count_attachments returns per-mime-type counts plus a trash total, and summing the lot reported someone's emptied uploads back to them as their library. Add a filter, for hosts serving sites that are public but unreachable from outside. Nothing but the local and offline checks stood between an intranet hostname and a third party. Only count any of it during the takeover. The whole portrait was computed and printed into every My Jetpack page load, and counting attachments groups by a column no index covers. Ask for the picture from the admin head as well, so the render starts at head-parse time rather than when the bundle boots, and so the picture is already downloaded on the way back from connecting. Both sides now assert the whole URL, because a drift between them would warm a render nothing reads. In the poll: reset the picture when the address changes, so a shot of the previous site cannot survive; stop on a refusal, which was read as a slow render and polled for the full twenty-five seconds; abort the request in flight; and read readiness from the redirect rather than the content type, which also drops the placeholder download from every poll. The error-card byte sizes now sit in one object with the dimensions they were measured at. They are a function of those dimensions and nothing said so, so widening the panel would have put a WordPress.com error card on screen as someone's homepage. Numerals are filled in by sprintf next to the plural they belong to. A plain replace left a positional placeholder on screen with no number in it, which is a legal and common way for a translator to write a lone number. Turning motion down part way through a count no longer strands the numeral on whatever it had reached. Eight mutations of the poll, four of the PHP and three of the component were each confirmed to fail a test before being restored. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ReATUyBCovcuj1bAfZ4VNJ
The sheet and the brand panel are both capped at 944px and centred, for the reason written on the panel: the two stop being the same object on a tall window. The rail was never given the same treatment, so it alone stretched to the full window and the step list climbed away from the card it belongs to. On a 1264px window they were 160px apart, which reads as two layouts that have come unstuck. The rail's ground belongs to the shell, so capping it moves the steps and leaves the dark full bleed. The panel also gave up its artwork for a site it cannot photograph and showed three numbers centred in a column six hundred pixels tall. The picture is the portrait; the counts were its caption in the prototype and do not carry a panel on their own. Without a picture the panel keeps the artwork every other step shows. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ReATUyBCovcuj1bAfZ4VNJ
The display copy is gone. It was set in a face we cannot ship, outlined to SVG at build time so no font file ever went out, and outlines cannot be translated. Weighed against re-setting it: there is no wide Inter, the variable axes are opsz and weight with no width; WordPress core bundles no text font at all, only Dashicons and TinyMCE's icons; every font in this monorepo is an icon font; and loading one from Google's CDN would send a self-hosted owner's address to Google from the first screen they see. A subset would have cost 20 to 30KB against the 3.3KB the outlines gzip to. So the words went instead of the typeface, and the panel is artwork. Two things were holding the mesh gradient down and both only existed to protect that copy. The mask dimmed the lower third so the words had somewhere quiet to sit, and the periods were 17 to 29 seconds, which behind a 64px blur could not be seen moving at all. The mask is deleted, the periods are 7 to 17 and still primes so the four never re-align, and the drift is wider. The artwork takes 92% of the panel rather than 77%. The feature step sets on one line at the column's 470px: the heading loses everything but what it is for, and the four site-type lines end "Turn off any you don't need" rather than a sentence that wrapped whatever was in front of it. The site-type question says what the answer actually does, which is order the features, not choose them. The way out of the takeover carries its words. It was a mark with a tooltip, and a tooltip is the one affordance a touch user never gets, on the screen that has taken over their admin. It is padded now so the hover is a shape rather than a box clamped to the text, and pulled back by the same amount so the mark still lines up with the title under it. The finish screen's wash reaches the page. It was clipped twice over: the discs were a fixed multiple of a 64px badge, so they stopped at 768px on a 1600px window, and the screen itself was sitting inside the 470px reading column that clips them. The reach is a share of the window now, and the finish screen is out of the column. One commit because the stylesheet carries nearly all of it and splitting the hunks would have been more risk than the history is worth. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ReATUyBCovcuj1bAfZ4VNJ
The sheet, the rail and the panel were each capped at 944px and centred, so a tall window put bands of shell above and below all three. On a 1255px window that is 155px top and bottom; at 1800 it is 444px, half the screen. The cap could not simply go. Its own comment records why it was added: without it the content sat in the top quarter and the rest was a blank cliff. Measured, deleting it gives the site-type step 562px of empty sheet under the last option at 1255 and 1107px at 1800 — a worse defect than the bands, and the free-text branch puts the field you type in 691px above the button you press. The heading is what made centring look impossible. Auto margins on the content moved it 147px between steps 2 and 3, because the content is a different height on each. So the block that centres is a fixed height instead, and the content sits inside it: the same block on every step centres to the same pixel on all of them. Measured at 800, 1255 and 1800: the heading lands where the capped sheet already put it, and does not move between steps. Only the bands become sheet. The rail goes back to running full height with its steps at the top, which is where a sidebar's belong. Capping it was the wrong lever for a real symptom — the steps sitting 160px away from the card — and the symptom is gone once the sheet fills. Separately, the finish pane clipped its frozen wash discs sideways but not downwards, so they stayed scrollable long after fading out: 319px of dead scroll at 1440 by 800, and one nudge of the wheel took the badge and the heading off the top. Clipped on both axes now, and the dead scroll is zero. Three agents on this: one measured what the content needs, one prototyped every option in the live page, one tried to break it at short windows, the rail breakpoint, phone widths and the finish screen. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ReATUyBCovcuj1bAfZ4VNJ
Pressing Continue showed an empty sheet first. The outgoing step is gone the instant the step changes, and every incoming element waited for its wave, so the first frames were white. The heading leads now, and the sheet is never empty. The content column was also rising under children that were rising themselves: the column carried the step-swap animation while its heading, its description and its list each carried a wave. Only the waves move now. The row cascade started at 0.12s, before the list it sits in began its own wave at 0.26s, so every row carried two rises at once. It starts where the list does, derived from the wave rather than a number of its own. The panel artwork was keyed by step, which remounts it and replays the draw: 2.6 seconds of the same mark erasing and redrawing itself on every Continue, saying something had changed when nothing had. It draws once now and holds. That only became noise when the per-step display copy went; before that the panel really did change. Verified on the live site: the heading is fading in at 105ms where the sheet used to be blank, and the artwork element survives a step change rather than being replaced. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ReATUyBCovcuj1bAfZ4VNJ
The start screen is one screen, not a step in a sequence, so it has no reason to sit in the block that holds the heading still across the steps that follow. Top-anchored in that block it read high: 236px of white above it and 471 below. It centres in the sheet now, the way the finish screen already does. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ReATUyBCovcuj1bAfZ4VNJ
The steps are not the same height — the site-type question is 508px and the feature list 670 — so the sheet carries 162px more empty space under the shorter one. That is a conservation law, not a bug in a number: while the heading holds its place across the step change, no block height, offset or clamp deletes those 162px. They can only be moved. So the shorter step spends them on itself. The block is the tallest step with the heading's offset above it and the same again below, every step stretches to fill it, and the answer rows take the surplus: 80px a row becomes 101. The list holds a seat open the size of the free-text field. Without it the rows absorb the field's height too, and the row you clicked to open the field jumps 45px out from under the pointer that chose it. With it, the field drops into the space that was already there and nothing moves. Measured on the live site at 800, 1255 and 1800: heading drift zero, the feature step centred to the pixel, and opening the free-text field moves nothing. Two corrections. The old comment claimed centring moved the heading 147px; measured, it is 81. And the block carried 65px of slack inherited from the height cap it replaced, which was 65px of white under every step for nothing. The stretch runs through named classes rather than a structural selector, because the content column also holds the connected notice and a bare child selector would have stretched that too. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ReATUyBCovcuj1bAfZ4VNJ
One real defect: a stale `.finish-row*` block was still in the stylesheet after the finish card was rebuilt, and its `option-cascade` animation bled onto the live rows. `--row-index` is never set on a finish `<li>`, so the delay it computed was invalid and every row fired at once. The card carries its own entrance now. The rest is removal. Six comments described code that had changed under them: an artwork share of 77% that is 68%, placeholder steps that are real, an option description said to be unrendered that renders, a breakpoint named as the panel's that is the rail's, and finish-wash scales given as fixed multiples now that they are shares of the viewport. Around thirty more were over the comment budget and are cut to it, and personal names and dates are out of the source entirely. The local `useReducedMotion` is gone in favour of the one in `@wordpress/compose`, which caches per window, drives `useSyncExternalStore` and handles a missing `matchMedia`. `site` is nullable end to end now. The page really does send null on the dashboard, where counting attachments is not worth its query, and the PHP `@return`, `global.d.ts`, the wizard's props and `hasPortrait` all said otherwise. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ReATUyBCovcuj1bAfZ4VNJ
The brand panel now shows the work each step is asking about, instead of one mark on every step: - "What's this site for?" gets a site being run — a colleague's cursor finishes a restore, crosses to the editor and publishes to eight networks at once. - The feature step keeps the plugins feeding the screen. - The start and finish steps keep the mark. Both compositions open on an empty panel and build from there. The first also carries a pointer parallax: five layers at different depths, wired here because it needs a listener, smoothed by a CSS transition so every frame stays on the compositor. **The site portrait is removed.** It showed the reader their own homepage via WordPress.com's screenshot service, which is the more concrete thing, but there is one panel and this is the call. Gone with it: `site-portrait.tsx`, `use-site-shot.ts`, their tests, `Onboarding_Site_Portrait_Test.php`, the four PHP methods and the `admin_head` hook behind them, and the `site` key from both the page payload and `global.d.ts`. Its two changelog entries described a fix to a feature that now never ships, so they are gone too. The art ships as a generated `*-art.ts` module rather than an import, because wp-build's esbuild pipeline has no image loader — the same reason `_inc/assets/inline-svgs.ts` exists. Sources and their check suites live in `jetpack-ai-heroes`; `check.mjs` there is what to run after any re-export. Also cleaned up, found by a red-team pass over the whole diff: - A `.layout--finish` rule hiding the rail and the panel that could never match: neither is rendered on that step. Its comment claimed the opposite. - A test asserting the flow still loops that read only as far as the first `}`, which is the end of the nested `svg` block — `--flow-runs` set after it passed. - Three type-only imports that had drifted into the runtime import block. - Two orphaned comments left behind by an earlier cleanup, and a comment about remounting that no longer described what the code does. - Seven declarations repeated across three rules, now one `panel-artwork` mixin. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ReATUyBCovcuj1bAfZ4VNJ
plugins/jetpack defines major|enhancement|compat|bugfix|other, not the package set, so `fixed` failed Changelogger validity. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ReATUyBCovcuj1bAfZ4VNJ
`admin_init` fires before `load-toplevel_page_jetpack`, where `Jetpack::admin_page_load()` answers `action=register` and the connection package's webhooks answer `connect_url_redirect`. Interrupting every Jetpack screen therefore answered a registration request with a redirect and dropped `redirect`, `redirect_after_auth`, `from` and `skip_pricing` on the way, with the feature flag on or off. The takeover now reaches `my-jetpack` only. A fresh self-hosted activation already redirects there, and a bare `page=jetpack` reaches it through the legacy-route fallback, so nothing is lost on a first install. Network admin is left alone outright. Three further fixes to what the takeover asks of a site: - It asked `is_connected()`, so a site-only connection closed setup for good. It asks for a connected owner when the wizard is on. The single screen can only register the site, so with the wizard off it still asks `is_connected()` rather than stranding a registered site on a screen with no way out. - The first-install check read `id`, which the connection package writes, so a site that had run Boost, Protect, Social, Search, VideoPress or Backup was refused the wizard. It reads `unique_registrations`, which only this plugin writes. - The connection card offered to disconnect a site that is not connected, and promised a click that did not exist. It links to the connect screen and says what connecting is for. The heading was a disabled button painting its label at 3.03:1 against white, under the 4.5:1 AA needs at that size; it is text. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ReATUyBCovcuj1bAfZ4VNJ
Three exits, three different behaviours, and one of them lost work. - A modified or middle click on Skip setup recorded the run as skipped and deleted the saved run while the user was still on the wizard in that tab. React state kept the step on screen, so the loss only showed on the next reload, which restarted at step 0 and was never offered setup again. Opening a link elsewhere is not leaving, so those gestures now change nothing at all. - The rail's exit had no handler, so leaving by it recorded nothing and parked the user on wp-admin, the one screen the takeover does not watch. It settles like the footer's. - The rail and the finish screen's secondary exit shared a name while doing different things, and the name was wrong for where they go. Both now read "Back to your WordPress site". Also: the finish screen's tally pluralised on the first count and hung its verb over the second, so one branch could read "1 feature was switched on and 2 switched off". Each count now declines its own noun. The step's unreachable Finish branch is gone, along with the helper it was the last caller of. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ReATUyBCovcuj1bAfZ4VNJ
…boarding-site-portrait # Conflicts: # projects/packages/my-jetpack/_inc/components/onboarding-screen/wizard/wizard.tsx
…boarding-site-portrait # Conflicts: # projects/packages/my-jetpack/_inc/components/onboarding-screen/wizard/styles.module.scss # projects/packages/my-jetpack/_inc/components/onboarding-screen/wizard/test/smoke.test.tsx # projects/packages/my-jetpack/_inc/components/onboarding-screen/wizard/wizard.tsx
…boarding-site-portrait
…boarding-site-portrait
…boarding-site-portrait
…boarding-site-portrait
e29d7a7
into
add/my-jetpack-onboarding-steps
…telemetry Brings in the animation work folded in from #52844, the shell's skip rule, and `clampStep()`. An exit is still reported before the page goes, then leaves without asking the settle route when the site is not connected.
|
Folded into #52775 so the steps and the animation are reviewed once, as final code. |
The window-sized takeover rules sat on `.jetpack-admin-full-screen`, which the flag-off single screen uses too, and that screen needs the page to scroll. They now hang off a `jetpack-onboarding-wizard` body class the wizard sets while it is open, and trunk's full-screen block is back as it was. Also, now that this branch carries the animation work from #52844: - One My Jetpack changelog entry for the whole branch, and no Jetpack plugin entries: none of it shows with the flag off. - `clampStep()` replaces the unchecked step casts, including the ones on a run read back from sessionStorage. - Reuse My Jetpack's existing `assignLocation` instead of a second copy.
Based on #52775. Review that one first.
Proposed changes
The onboarding wizard's panel was the same brand art and a line of outlined display
copy on every step. The prototype's panel isn't: it shows the thing the step beside it
is asking about. This replaces the panel on the two question steps with two
compositions, and takes the display copy out.
running it. The cards arrive, a colleague's cursor crosses to the restore card and
clicks it, the bar that click started finishes, then the cursor goes to the editor and
publishes to eight networks at once, with a tick landing on each. It runs about six and
a half seconds and settles. Nothing loops: every state in it is a state rather than a
process, and replaying one would claim it is happening again.
screen. This one does loop, on a 3.2 second period, because the flow it draws is a
process and not a state.
that happens, so nothing is simply on when the step arrives.
check.mjsin the sourcerepo asserts it in pixels.
1.25, driven from one
pointermovelistener on the SVG and smoothed by a CSStransition the composition puts on the layers, so every frame stays on the compositor.
It is gated on
(hover: hover) and (pointer: fine). Touch fires one hover on tap andthen nothing, which would leave the cards stuck off centre for good.
deliberately not keyed by step, so continuing does not remount it and replay the draw.
The two compositions do mount and unmount with their own step, so returning to a step
replays it. The finish step has no panel at all, and no rail either; it takes the
whole sheet.
arrives finished: the restore bar complete, the last label rather than all four, both
cursor legs resting where they ended. "Data in" parks its eight segments where they
would have been mid-run, because hiding them would leave eight bare wires, which is the
one thing the piece is not about.
site's own homepage through mshots and put it in the panel. That is gone, with its
poll, its PHP, its
admin_headhook, its tests and thesitekey in the page payload.There is no PHP in this pull request at all.
Also in here, from reviewing the branch end to end: the outlined type and the Python that
generated it are deleted, the local
useReducedMotionis replaced by the one in@wordpress/compose, the finish wash is sized in the stylesheet rather than inJavaScript, and a lot of comments that were restating the code are shorter.
Does this pull request change what data or activity we track or use?
No.
Testing instructions
There is a site up with this branch on it, flag already on:
https://tremendously-little-storm.jurassic.ninja/wp-admin/admin.php?page=my-jetpack&step=onboarding
Log in as
demo. Ask me for the password rather than me putting it in a public repo.It is disconnected on purpose, so the wizard takes over rather than My Jetpack. If you
find the Jetpack plugin switched off when you land, switch it on — I use this site to
record the flow from a cold start. A mu-plugin turns the flag on; delete
wp-content/mu-plugins/000-wizard-harness.phpto get the normal screen back. The siteexpires after 7 days of inactivity.
To run it yourself instead, turn the flag on in a mu-plugin or
functions.php. It is afilter, not an option:
Then open Jetpack → My Jetpack on a disconnected self-hosted site, in a window at
least 1280px wide. Below that the brand panel is hidden and none of this renders.
the editor, the eight network tiles, the stats card, the restore card, a second cursor
arriving and going to the restore card, the bar finishing, then the cursor crossing to
the editor and publishing. About six and a half seconds, then it stops. It should not
start again.
running up the wires. This one keeps going rather than settling, and it is meant to.
from step 1 to step 2 and back does not replay the mark.
at the far edge, the backdrop least and the second cursor most. Leave the panel and they
go back to centre. On a touch screen nothing moves, which is deliberate.
the restore bar full, one label instead of four, the cursor on the button it pressed.
Step 3's segments sit still part-way along the wires rather than disappearing. The
parallax is off. Turning the setting on while the wizard is open should also turn the
parallax off without a reload.
question column takes the width it leaves.
aria-hidden. Nothing in either should reach a screen reader:the question is on the left and the panel is decorative.
🤖 Generated with Claude Code
https://claude.ai/code/session_01ReATUyBCovcuj1bAfZ4VNJ