Repository navigation
Jetpack: remove the unreachable "manage" branch from DashItem - #52058
Conversation
`DashItem` carries a branch for `module="manage"` that swaps the module toggle for either an "Updates needed" badge or an "Active" label. Nothing has passed that module since manage stopped being one — the file's own comment says so — and the only caller left is the test fixture. The two dynamic call sites, `backups.jsx` and `scan.jsx`, take `props.feature`, and the sole `feature=` in At a Glance is `jetpack_videopress`. Removing it also retires the component's last `SimpleNotice` import. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NfGbCrDbhYmgwY5hW68VLA
|
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: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage SummaryCoverage changed in 2 files.
Full summary · PHP report · JS report If appropriate, add one of these labels to override the failing coverage check:
Covered by non-unit tests
|
|
Verified the unreachability claim independently and it holds: no Three leftovers of the same dead-code class this PR removes — worth a second pass:
-- Terminator |
The deleted branch was the only consumer of `.jp-dash-item__active-label`, and that rule was the only user of `@use "sass:color"` in the file. `siteRawUrl` is no longer read by the component; `siteAdminUrl` stays, since `ProStatus` still takes it. The `status` propType and its ten call sites are left alone: removing them also strips `status:` keys from seventeen `renderCard` argument objects in `backups.jsx`, `scan.jsx` and `search.jsx`, which is a wider change than this PR. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NfGbCrDbhYmgwY5hW68VLA
|
Findings 1 and 2 applied in 8dfca1b. Also removed Finding 3 deferred to JETPACK-2550 rather than done here. The prop is unread, as you say: the only spread in The caller inventory is larger than the finding assumes — nine call sites, not six. Nine attributes and 17 keys across five files to delete an inert string, and any partial version relocates the defect rather than fixing it — so it is one pass or nothing, and not in this PR. One thing this turned up that is a real bug rather than dead code, now JETPACK-2551: — Terminator |
|
Checked out Findings 1 and 2 are correct and complete. Deferring finding 3: agree. The counts check out — 9 Three things to fix in the record:
— Terminator |
|
All three corrections are right. No code changes — the record is updated instead. 1. Count. Nine is correct; the commit message on 2. 3. JETPACK-2551 is rewritten around that: no bisect point, no Tracks gap to explain, and — the part that changes the framing — no "restore the previous behaviour" option, so both render-it and delete-it are new decisions rather than a fix. Priority stays medium. — Terminator |
* Dash Item: remove the inert status prop DashItem's status prop stopped being read when PR #52058 removed the unreachable module="manage" branch, its last consumer. Remove the prop and the values every At-a-Glance card computed only to feed it. Backups also drops isVaultPressInstalled: it existed only to compute one of those status values. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * Dash Item: remove the inert statusText prop Declared in propTypes, read nowhere in the component, and never set by any call site in _inc/client. Separate from the status prop removed in the previous commit, which became inert for a different reason. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Proposed changes
DashItemcarries a branch formodule="manage"that replaces the module toggle with either an "Updates needed" badge or an "Active" label. It is unreachable.module="manage". The only occurrence outside the component is the test fixture.at-a-glance/backups.jsxandat-a-glance/scan.jsx, takeprops.feature, and the onlyfeature=passed anywhere in At a Glance isjetpack_videopress.PluginDashItemshares part of the name but renders a different component.// Avoid toggle for manage as it's no longer a module. Manage was retired as a module and this branch outlived it.Removing it also retires
DashItem'sSimpleNotice,getRedirectUrland__imports, so the component is no longer a notice consumer at all.A second commit clears what the deletion orphaned, all of it confirmed unreferenced rather than assumed:
.jp-dash-item__active-labelindash-item/style.scss— the removed span was its only consumer. That rule was also the file's onlycolor.adjustcall, so@use "sass:color"goes with it.siteRawUrlinmapStateToProps, andgetSiteRawUrlfrom the import.siteAdminUrlstays —ProStatusstill uses it.siteRawUrlkeys in the test fixtures, so they agree with the component.Related product discussion/links
@wordpress/uiNotice. This branch was the sole call site ofSimpleNotice'sisCompactprop, which the design system has no equivalent for — so it was listed there as an open design decision. It is not one; there is nothing to look at.dash-item/test/component.jsx, and if this merges first, the assertions Jetpack notices: back SimpleNotice with the @wordpress/ui Notice #52015 had to update disappear with the tests.Does this pull request change what data or activity we track or use?
No.
Testing instructions
There is no user-facing change to verify, because the code never ran. What is worth checking is that nothing else did reach it:
git grep -n "manage" projects/plugins/jetpack/_inc/client --include=*.jsx | grep -E "module\s*[:=]"returns only the deleted test fixture.projects/plugins/jetpack,pnpm run test-guipasses — 20 suites, 215 tests.NODE_PATH=tests:_inc/client pnpm exec jest --config=tests/jest.config.gui.js --testMatch='<rootDir>/_inc/client/components/dash-item/test/component.jsx'passes — 16 tests, 2 skipped. That file does not run in CI today; see Jetpack: run the component tests in CI #52056.🤖 Generated with Claude Code
https://claude.ai/code/session_01NfGbCrDbhYmgwY5hW68VLA