Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Beta" Badge to First-Party Mode Toggle #9650

Closed
1 task
hussain-t opened this issue Nov 11, 2024 · 5 comments
Closed
1 task

Add "Beta" Badge to First-Party Mode Toggle #9650

hussain-t opened this issue Nov 11, 2024 · 5 comments
Labels
P0 High priority Team M Issues for Squad 2 Type: Enhancement Improvement of an existing feature

Comments

@hussain-t
Copy link
Collaborator

hussain-t commented Nov 11, 2024

Feature Description

Add a "Beta" badge next to the First-party mode toggle label to indicate the feature is in beta.

For details, refer to the Design Doc and the Figma design.

Image


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • A "Beta" badge should be displayed next to the First-party mode toggle label to indicate that the feature is in beta.
  • The badge should be styled according to the specifications in the Figma design.
  • The badge should be non-interactive and serve as a visual indicator of the feature's beta status.

Implementation Brief

  • In FirstPartyModeToggle component in assets/js/components/first-party-mode/
    • Import the Badge component from /assets/js/components.
    • Add the Badge component beside Switch component with label prop passed as Beta and className as googlesitekit-beta-badge.
    • Make sure to conform to the style as per the Figma design. Any styling rules should be added in assets/sass/components/first-party-mode/_googlesitekit-first-party-mode.scss

Test Coverage

  • Update tests for FirstPartyModeToggle component.

QA Brief

  • Open the Components -> First Party Mode -> FirstPartyModeToggle stories in Storybook and verify that the "Beta" badge appears as expected in the ACs.

Changelog entry

  • Add a "Beta" badge to the First-party mode toggle.
@hussain-t hussain-t added Type: Enhancement Improvement of an existing feature Team M Issues for Squad 2 labels Nov 11, 2024
@hussain-t hussain-t self-assigned this Nov 11, 2024
@hussain-t hussain-t added the P0 High priority label Nov 11, 2024
@hussain-t hussain-t removed their assignment Nov 14, 2024
@techanvil techanvil self-assigned this Nov 14, 2024
@techanvil
Copy link
Collaborator

AC ✅

@techanvil
Copy link
Collaborator

techanvil commented Nov 28, 2024

Hi @ankitrox, thanks for drafting this IB. However, I think it should take a slightly different approach.

We don't tend to interpolate badges into translated strings like that and in fact there's an existing component with a badge next to a switch and it simply renders it after the switch:

<Switch
label={ label }
onClick={ onChange }
checked={ useSnippet }
disabled={ isDoingSaveUseSnippet }
hideLabel={ false }
/>{ ' ' }
<Badge
className="googlesitekit-badge--primary"
label={ __( 'Recommended', 'google-site-kit' ) }
/>

I'd suggest we take the same approach here.

@techanvil techanvil assigned ankitrox and unassigned techanvil Nov 28, 2024
@ankitrox
Copy link
Collaborator

Thank you @techanvil .

I updated the IB to simply add the Badge beside Switch component in FirstPartyModeToggle component.

@ankitrox ankitrox assigned techanvil and unassigned ankitrox Nov 29, 2024
@techanvil
Copy link
Collaborator

Thanks @ankitrox!

IB ✅

@techanvil techanvil removed their assignment Nov 29, 2024
@nfmohit nfmohit self-assigned this Dec 3, 2024
@nfmohit nfmohit removed their assignment Dec 3, 2024
@benbowler benbowler assigned benbowler and unassigned benbowler Dec 4, 2024
@techanvil techanvil self-assigned this Dec 4, 2024
@techanvil techanvil assigned nfmohit and unassigned techanvil Dec 4, 2024
@nfmohit nfmohit assigned techanvil and unassigned nfmohit Dec 5, 2024
techanvil added a commit that referenced this issue Dec 5, 2024
@techanvil techanvil removed their assignment Dec 5, 2024
@wpdarren wpdarren self-assigned this Dec 5, 2024
@wpdarren
Copy link
Collaborator

wpdarren commented Dec 5, 2024

QA Update: ✅

Verified:

We're unable to test this on a site right now so as per the QAB, I checked Storybook.

  • A "Beta" badge is displayed next to the First-party mode toggle label to indicate that the feature is in beta.
  • The badge is styled according to the specifications in the Figma design.
  • The badge is non-interactive and serve as a visual indicator of the feature's beta status.

I compared the beta badge for SiWG and checked that the font size, style and dimensions were the same.

Image

@wpdarren wpdarren removed their assignment Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P0 High priority Team M Issues for Squad 2 Type: Enhancement Improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

7 participants