Repository navigation
Protect Dashboard: Redesign the Login protection card - #53739
Conversation
|
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. |
Code Coverage SummaryCoverage changed in 6 files. Only the first 5 are listed here.
1 file is newly checked for coverage.
|
| @@ -0,0 +1,90 @@ | |||
| import { ToggleControl } from '@wordpress/components'; | |||
There was a problem hiding this comment.
As of the latest @wordpress/ui package version bump in Jetpack, you can now use SwitchControl from the @wordpress/ui package instead. It's a more modern version of the same component.
Please also rebase onto the latest trunk; you'll see the new linter rule complain about using the old component until you update. If you must use this older component, you can include it in the linter exclusion list for now. Just lemme know!
There was a problem hiding this comment.
Done in 796af65: SsoToggle, the shared SettingToggle and the locked SSO option toggles now use SwitchControl, and setting-toggle.tsx and login-protection-settings-card.tsx are off the ESLint exclude list. Rebased onto trunk too. The Firewall IP-list toggles (ip-rule.tsx, firewall/settings-card.tsx) still use ToggleControl; I left those for a follow-up so this PR stays on the Login card.
|
|
||
| > * { | ||
| box-sizing: border-box; | ||
| padding: 16px var(--wp-ui-card-padding); |
There was a problem hiding this comment.
Preferably could use wpds token here rather than component internal --wp-ui-* tokens.
If you're overriding Card or other component styles, I'd like to understand better because it likely isn't needed, or isn't preferable at least :-)
There was a problem hiding this comment.
Swapped for --wpds-dimension-padding-lg / --wpds-dimension-padding-2xl (the token --wp-ui-card-padding resolves to). On the why: CardRow is Card.FullBleed, so each row's top border runs edge to edge as a divider between sections. FullBleed cancels the card's padding, so the row adds it back to line its content up with the header. The divided-cells row moves that padding onto each cell so the vertical rule also reaches the row's edges. If there's a Card-native way to divide content into sections, I'm happy to drop this.
There was a problem hiding this comment.
CardRow is Card.FullBleed, so each row's top border runs edge to edge as a divider between sections. FullBleed cancels the card's padding, so the row adds it back to line its content up with the header.
Would it work to just have Card.Content (which doesn't eat up the padding) and have Row inside it manage its contents?
The only job Card.FullBleed has is to cancel the padding, so if you're adding it back it's kinda pointless to use it. 😅
|
Heads-up: PR 53743 makes the Overview cards' Settings links open at their own card. This PR splits the login card's link into "Configure brute force protection" and "Configure WordPress.com login (SSO)". Whichever of the two merges second should give both links |
…vailable login toggles A failed save now records its keys, so the Login and Firewall cards only show their own errors. Unavailable brute force and account protection toggles say why, the Secure Sign On link names its feature, and focus stays in the brute force row when its toggle swaps out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…case the login toggles Matches the name Jetpack Settings and the connectors card use, so the Overview toggle, its link, the Settings heading and the turn-off dialog all name the same feature. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gin settings to its card Moves SettingToggle and the WordPress.com login toggles to SwitchControl from @wordpress/ui and drops them from the ESLint exclude list. Card row paddings use wpds dimension tokens instead of fixed pixels and the Card's internal padding variable. Both Login protection links open the Settings tab at the Login protection card, as the other Overview cards' links now do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b679328 to
796af65
Compare
Proposed changes
Reworks the Login protection card on the Protect dashboard's Overview tab so each feature can be turned on from the card itself, instead of only reporting status.
SsoToggleused by both cards.jp-protect-card__cellscard style, used by the Login card's toggles and the Scan card's stats row, and the dismissible settings error row is a sharedSettingsErrorRow, used by the Login and Firewall cards. A failed save now records which settings it was for, so each card shows only its own errors.Before / after
Overview tab, with brute force protection, account protection and WordPress.com login (SSO) all on (captured on a Jurassic Ninja site at 1440×900).
Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions