Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: create UI badges for labeling beta features#14661

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Parkreiner merged 48 commits intomainfrommes/beta-badges
Sep 20, 2024

Conversation

Parkreiner
Copy link
Member

@ParkreinerParkreiner commentedSep 12, 2024
edited
Loading

Closes#14499

Changes made

  • Added generalFeatureStageBadge component for labeling components that are beta/experimental
  • Added component to Organizations features
  • UpdatedPopover component to support sending events outside the component

Bonus

  • Updated a few styles surrounding the existing orgs work
    • Updated the colors for the organizations navbar so that they have better contrast in dark mode
    • Updated letter tracking for the navbar header
    • Updated the header for the Provisioners page so that it matches all the other pages
    • Updated some spacing values in general

Notes

  • @aslilac Tagging you for the review because the PR does change how the Preview role is set up

@ParkreinerParkreiner self-assigned thisSep 12, 2024
@@ -1,10 +1,12 @@
import MuiPopover, {
type PopoverProps as MuiPopoverProps,
// biome-ignore lint/nursery/noRestrictedImports:Used asbase component
// biome-ignore lint/nursery/noRestrictedImports:This is thebase component that our custom popover is based on
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I might have Biome configured wrong because my Biome plugin is flagging all of these comments as not doing anything

Accidentally removed this at first, but that's definitely a me problem, right?

Copy link
Member

Choose a reason for hiding this comment

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

I think it doesn't like that our biome.json config is in the site/ directory 🙄 I hate that extensions never bother to handle subdirectories well.

{title}
</h1>
{tooltip}
<Stack direction="row" spacing={2} alignItems="center">
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Only change is that the previous content is in a new stack so that the badges can be placed inside them

@@ -149,7 +149,7 @@ const styles = {
menuItem: (theme) => css`
text-decoration: none;
color: inherit;
gap:20px;
gap:8px;
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This was a change from when the feature badges were still part of the dropdown. Even with that removed, though, the gap seemed way too big for any feature elements we add

@@ -396,7 +412,7 @@ const classNames = {
`,

subLink: (css, theme) => css`
color:inherit;
color:${theme.palette.text.secondary};
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

De-emphasized the colors of the inactive sub links because in dark mode, there wasn't enough contrast to make it obvious which subheader was active

Copy link
Member

@aslilacaslilac left a comment

Choose a reason for hiding this comment

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

I'm not sure I'm sold on whypreview needs to become anInteractiveRole, that's a lot of extra colors to manage for a badge that never uses thedisabled variants (and I don't get why it needshover either. we don't modify the colors of any other UI elements just because they have a tooltip.)

@@ -1,10 +1,12 @@
import MuiPopover, {
type PopoverProps as MuiPopoverProps,
// biome-ignore lint/nursery/noRestrictedImports:Used asbase component
// biome-ignore lint/nursery/noRestrictedImports:This is thebase component that our custom popover is based on
Copy link
Member

Choose a reason for hiding this comment

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

I think it doesn't like that our biome.json config is in the site/ directory 🙄 I hate that extensions never bother to handle subdirectories well.

@ParkreinerParkreiner changed the titlefeat: add UI badges for labeling beta featuresfeat: create UI badges for labeling beta featuresSep 20, 2024
@@ -1,7 +1,7 @@
import type { Branding } from "../branding";
import colors from "../tailwindColors";

export default {
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Forgot to leave a comment on these earlier, but the reason why I switched the syntax fromsatisfies to type annotations is because when I was adding additional properties to the type definitions,satisfies wasn't always immediately kicking up an error when something was only partially updated, and it made way more red squiggles than it needed to

Comment on lines 96 to 110
{({ isOpen }) => (
<span
css={[
styles.badge,
size === "sm" && styles.badgeSmallText,
size === "lg" && styles.badgeLargeText,
isOpen && styles.badgeHover,
]}
{...delegatedProps}
>
<span style={visuallyHidden}> (This is a</span>
{featureStageBadgeTypes[contentType]}
<span style={visuallyHidden}> feature)</span>
</span>
)}
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Ended up using render props to cut down the repetitive state

Comment on lines 81 to 86
type FeatureStageBadgeProps = Readonly<
Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
contentType: keyof typeof featureStageBadgeTypes;
size?: "sm" | "md" | "lg";
}
>;
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Ended up applying YAGNI to the props and removed pretty much everything that isn't part of the current requirements. We have no need for a static version of the component right now

experimental: "experimental",
} as const satisfies Record<string, ReactNode>;

const styles = {
Copy link
Member

Choose a reason for hiding this comment

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

I think we generally definestyles below the component

@ParkreinerParkreinerenabled auto-merge (squash)September 20, 2024 21:08
@ParkreinerParkreiner merged commit661d226 intomainSep 20, 2024
27 checks passed
@ParkreinerParkreiner deleted the mes/beta-badges branchSeptember 20, 2024 21:13
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsSep 20, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@aslilacaslilacaslilac approved these changes

Assignees

@ParkreinerParkreiner

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

UI: add beta labels to Organization feature
2 participants
@Parkreiner@aslilac

[8]ページ先頭

©2009-2025 Movatter.jp