Repository navigation
refactor: switch out mantine badges for click-ui badges in tags and experimental sections #3398
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
Changes from all commits
9d702d5
b7523ef
0fb6223
3c14a8d
3e965d9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| '@hyperdx/app': patch | ||
| --- | ||
|
|
||
| feat: use the click-ui `Badge` for dashboard and alert tags, and for the | ||
| "Experimental", "Beta", "Disabled", "Dev only", team member, and pending | ||
| invite badges in settings. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| import { Badge } from '@clickhouse/click-ui'; | ||
| import { SourceKind } from '@hyperdx/common-utils/dist/types'; | ||
| import { Badge, Group, Stack, Text } from '@mantine/core'; | ||
| import { Group, Stack, Text } from '@mantine/core'; | ||
|
|
||
| import { useSource } from '@/source'; | ||
|
|
||
|
|
@@ -24,9 +25,12 @@ export default function ServiceMapSidePanel({ | |
| <Text size="sm" ps="sm"> | ||
| Service Map | ||
| </Text> | ||
| <Badge size="xs" ms="xs" color="gray" autoContrast radius="sm"> | ||
| Beta | ||
| </Badge> | ||
| <Badge | ||
| size="sm" | ||
| text="Beta" | ||
| state="info" | ||
| style={{ marginInlineStart: 'var(--mantine-spacing-xs)' }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔵 minor — Raw inline margin style where the parent Group's gap would do the same job The repo conventions say to prefer Mantine style props over raw Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔵 minor — The Beta badge's spacing is set with a raw style using a Mantine CSS variable, when the parent Group could provide the gap Change the parent to Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond |
||
| /> | ||
| </Group> | ||
| {traceTableSource && traceTableSource.kind === SourceKind.Trace ? ( | ||
| <ServiceMap | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| import { useState } from 'react'; | ||
| import { HTTPError } from 'ky'; | ||
| import CopyToClipboard from 'react-copy-to-clipboard'; | ||
| import { Badge } from '@clickhouse/click-ui'; | ||
| import { | ||
| Badge, | ||
| Box, | ||
| Button, | ||
| Card, | ||
|
|
@@ -243,9 +243,14 @@ export default function TeamMembersSection() { | |
| <Table.Td> | ||
| <div> | ||
| {member.isCurrentUser && ( | ||
| <Badge variant="light" mr="xs" tt="none"> | ||
| You | ||
| </Badge> | ||
| <Badge | ||
| size="sm" | ||
| text="You" | ||
| state="info" | ||
| style={{ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔵 minor — The 'You' badge's spacing is set with a hand-written Replace the wrapping Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond |
||
| marginRight: 'var(--mantine-spacing-xs)', | ||
| }} | ||
| /> | ||
| )} | ||
| <span className="text-white fw-bold fs-7"> | ||
| {member.name} | ||
|
|
@@ -263,13 +268,10 @@ export default function TeamMembersSection() { | |
| <Table.Td> | ||
| {member.groupName && ( | ||
| <Badge | ||
| variant="light" | ||
| color="green" | ||
| fw="normal" | ||
| tt="none" | ||
| > | ||
| {member.groupName} | ||
| </Badge> | ||
| size="sm" | ||
| text={member.groupName} | ||
| state="success" | ||
| /> | ||
| )} | ||
| </Table.Td> | ||
| <Table.Td style={{ textAlign: 'right' }}> | ||
|
|
@@ -303,9 +305,13 @@ export default function TeamMembersSection() { | |
| </span> | ||
| </Table.Td> | ||
| <Table.Td> | ||
| <Badge variant="dot" color="gray" fw="normal" tt="none"> | ||
| Pending Invite | ||
| </Badge> | ||
| <Badge | ||
| size="sm" | ||
| text="Pending invite" | ||
| state="neutral" | ||
| icon="dot" | ||
| iconDir="start" | ||
| /> | ||
| <CopyToClipboard text={invitation.url}> | ||
| <Button size="compact-xs" variant="secondary" ml="xs"> | ||
| 📋 Copy URL | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔵 minor — Mantine Tooltip now wraps a click-ui Badge, and the Tooltip may not be able to attach a ref to it
Mantine
Tooltipclones its child and attaches a ref so floating-ui can position the tooltip. Unless click-ui'sBadgeforwards refs, the 'Only available in local/dev mode…' tooltip will be mispositioned or won't show. I couldn't check the click-ui source (node_modules isn't in this checkout), so confirm whetherBadgeforwards refs. If it doesn't, wrap it in an element that takes a ref, e.g.<Tooltip …><span><Badge … /></span></Tooltip>, and check the tooltip still appears on hover.Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond