Repository navigation
feat: show an optional tile description as a tooltip #3352
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
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,8 @@ | ||
| --- | ||
| '@hyperdx/common-utils': patch | ||
| '@hyperdx/api': patch | ||
| '@hyperdx/app': patch | ||
| --- | ||
|
|
||
| Add an optional tile description, accepted by the external Dashboards API and | ||
| shown as an info tooltip next to the tile name. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -107,6 +107,7 @@ import { | |
| IconDotsVertical, | ||
| IconDownload, | ||
| IconFilterEdit, | ||
| IconInfoCircle, | ||
| IconLayoutSidebarRightCollapse, | ||
| IconLayoutSidebarRightExpand, | ||
| IconPencil, | ||
|
|
@@ -1139,9 +1140,20 @@ const Tile = ({ | |
| const title = useMemo( | ||
| () => | ||
| chart.config.name ? ( | ||
|
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 — Description is never shown on tiles with an empty name The info icon is rendered inside the 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 |
||
| <Text size="sm">{chart.config.name}</Text> | ||
| <Group gap={4} wrap="nowrap"> | ||
| <Text size="sm">{chart.config.name}</Text> | ||
| {chart.description && ( | ||
|
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 tooltip rendering has no test The new tests only cover the API converters. No test checks that the icon and tooltip appear when 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 |
||
| <Tooltip label={chart.description} multiline maw={360} withArrow> | ||
|
Comment on lines
+1143
to
+1146
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. |
||
| <IconInfoCircle | ||
|
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 — Tooltip trigger is a non-focusable SVG, so keyboard users can't open the description
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 — Keyboard and screen-reader users can't reach the description The tooltip is attached to a bare 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 |
||
| size={14} | ||
| aria-label={chart.description} | ||
| data-testid={`tile-description-${chart.id}`} | ||
| /> | ||
|
Comment on lines
+1146
to
+1151
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.
|
||
| </Tooltip> | ||
| )} | ||
| </Group> | ||
| ) : undefined, | ||
| [chart.config.name], | ||
| [chart.config.name, chart.description, chart.id], | ||
| ); | ||
|
|
||
| // Render chart content (used in both tile and fullscreen views) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,6 +36,7 @@ export type Tile = { | |
| config: SavedChartConfig; | ||
| containerId?: string; | ||
| tabId?: string; | ||
| description?: string; | ||
|
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 app's Every new tile field now has to be added by hand to both the app type here and 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 |
||
| }; | ||
|
|
||
| export type Dashboard = { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2143,6 +2143,7 @@ export const TileSchema = z.object({ | |
| containerId: z.string().min(1).optional(), | ||
| // For tiles inside a tab container: which tab this tile belongs to | ||
| tabId: z.string().min(1).optional(), | ||
| description: z.string().max(1024).optional(), | ||
|
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 1024 length cap is written separately in two schemas
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 — Tile description max length is a magic number repeated in two schemas
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 1024 limit is hardcoded in three places
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 |
||
| }); | ||
|
|
||
| export const TileTemplateSchema = TileSchema.extend({ | ||
|
|
||
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.
The new
descriptionfield is accepted for tiles usingseries, but only tiles usingconfigpreserve it. Both create and update sendseriestiles throughtranslateExternalChartToTileConfig, which leaves outdescription. Requests succeed, but the text disappears from storage and responses. Copy the field in that converter too, and test this path throughconvertExternalTilesToInternal.