Skip to content

Login: Last used login method badge#110447

Draft
nuriapenya wants to merge 3 commits intotrunkfrom
try/last-used-login-badge
Draft

Login: Last used login method badge#110447
nuriapenya wants to merge 3 commits intotrunkfrom
try/last-used-login-badge

Conversation

@nuriapenya
Copy link
Copy Markdown
Contributor

@nuriapenya nuriapenya commented May 5, 2026

Part of DSGCOM-441.

Proposed Changes

  • New LastUsedBadge component: a floating "Last used" chip on the top-right of the matched element, styled to match @wordpress/components.
  • Badges every supported login method, not just socials.
  • Replaces the previous two-card "Previously used" UI in login-form.jsx (which split the form and reshuffled button order) with the inline badge.
  • Hides the dev-only "Continue with PayPal" button by flipping sign-in-with-paypal off in config/development.json (production already had it off).

Why

Returning users often forget which method they used. The existing two-card UI is very confusing: There's a split in the form, we reshuffled button order, and overall, it's not obvious what was used previously. Showing a simple label on top of the option makes it more clear for the users:

Before image
After Screenshot 2026-05-05 at 12 51 33

Testing

  • Make sure you are logged out in a browser you previously logged in to WordPress.com
  • Run Calypso locally and open http://calypso.localhost:3000/log-in
  • Result: One of the options should contain the badge.

To test the other options, use DevToolsApplicationCookiescalypso.localhost and edit the value inline:

  • password → Email / password option.
  • google / apple / github → Social buttons.
  • magic-login → Email me a login link.
  • qr-code → Jetpack.

Open questions

Note

I'm considering only showing the badge for the social buttons (right column). Reason: 90% of logins are already happening via email/password - there's no need to highlight that option. Check the testing below ↓

Replaces the two-card "Previously used" UI with a tab-style badge attached
to the matching social button, so returning users can see at a glance how
they signed in last without splitting the form.

Part of DSGCOM-441.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@matticbot
Copy link
Copy Markdown
Contributor

matticbot commented May 5, 2026

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

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

  • help-center
  • odyssey-stats

To test WordPress.com changes, run install-plugin.sh $pluginSlug try/last-used-login-badge on your sandbox.

@nuriapenya nuriapenya changed the title Login: "Last used" badge on social buttons Login: Last used login method badge May 5, 2026
- Cover password (email/username field) and magic-login as last-used
  methods, in addition to social providers.
- Restyle the badge to a floating chip on the top-right of the matched
  element, mirroring @wordpress/components Badge sizing/typography with
  the WP accent color as fill.
- Override the wp-button's inset grey box-shadow (incl. :hover/:focus)
  so only the accent border is drawn on the matched element.
- Set overflow:visible on the social Card + buttons containers so the
  pill can extend past the right edge.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@nuriapenya
Copy link
Copy Markdown
Contributor Author

nuriapenya commented May 5, 2026

Testing all the options

Password

Screenshot 2026-05-05 at 12 32 32

Google

Screenshot 2026-05-05 at 12 33 21

Apple

Screenshot 2026-05-05 at 12 33 40

GitHub

Screenshot 2026-05-05 at 12 36 16

Magic link

Screenshot 2026-05-05 at 12 35 21

Jetpack

Screenshot 2026-05-05 at 12 37 06

The sign-in-with-paypal flag is only true in development.json, so the
button is dev-only chrome that does not appear for real users. Flipping
it off in dev removes the noise so dev parity matches production.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
overflow: visible;
}

// Mirrors @wordpress/components Badge styling (padding, radius, sizing,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Instead of mirroring, we could use the actual Badge component and apply only absolute positioning styles to it.

See badge variations:

Image

Note that there's also a new badge component in @wordpress/ui, which is the latest, compared to one in Calypso (aka @automattic/components) or older WP components (aka @wordpress/components).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants