From 4ed54e25716362bcf8b9c3260d06b9483b966181 Mon Sep 17 00:00:00 2001 From: Elizabet Oliveira Date: Fri, 20 Mar 2026 14:42:20 +0000 Subject: [PATCH 1/7] chore: update @tabler/icons-react to v3.40.0 Update from v3.5.0 to get IconConnection (added in v3.39) for the data source select enhancement. Made-with: Cursor --- packages/app/package.json | 2 +- yarn.lock | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/app/package.json b/packages/app/package.json index 18ae7c8319..a768126d5e 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -42,7 +42,7 @@ "@mantine/notifications": "^7.17.8", "@mantine/spotlight": "^7.17.8", "@microsoft/fetch-event-source": "^2.0.1", - "@tabler/icons-react": "^3.5.0", + "@tabler/icons-react": "^3.39.0", "@tanstack/react-query": "^5.56.2", "@tanstack/react-query-devtools": "^5.56.2", "@tanstack/react-table": "^8.7.9", diff --git a/yarn.lock b/yarn.lock index e4ceb35e57..42604e6edb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4330,7 +4330,7 @@ __metadata: "@storybook/addon-themes": "npm:^10.1.4" "@storybook/nextjs": "npm:^10.1.4" "@storybook/react": "npm:^10.1.4" - "@tabler/icons-react": "npm:^3.5.0" + "@tabler/icons-react": "npm:^3.39.0" "@tanstack/react-query": "npm:^5.56.2" "@tanstack/react-query-devtools": "npm:^5.56.2" "@tanstack/react-table": "npm:^8.7.9" @@ -8376,21 +8376,21 @@ __metadata: languageName: node linkType: hard -"@tabler/icons-react@npm:^3.5.0": - version: 3.5.0 - resolution: "@tabler/icons-react@npm:3.5.0" +"@tabler/icons-react@npm:^3.39.0": + version: 3.40.0 + resolution: "@tabler/icons-react@npm:3.40.0" dependencies: - "@tabler/icons": "npm:3.5.0" + "@tabler/icons": "npm:3.40.0" peerDependencies: react: ">= 16" - checksum: 10c0/9669d26e2ab4654d3d1c124a5ffd42c276d5a7ebc83b81ecb200e1f89dc3e9271557cf6eccc78bdd0ebdd0536fa4cd566e2b638ab4407e9415457c28ef05786e + checksum: 10c0/a6985c9e8d1986c14594f5bc7007d2398b7b1efd2202304a24e23eb1fa6a48a23f9a6aaa3c5626781990cc0f0a46773c0a0cb747b6984dde26f03ba4ebd1d9cf languageName: node linkType: hard -"@tabler/icons@npm:3.5.0": - version: 3.5.0 - resolution: "@tabler/icons@npm:3.5.0" - checksum: 10c0/0d6b15266e116dcf56bca417d013f1027b57404e5ed7f9a2a14e216eabdd04980ff971129491b666ffdc11953107c0b4540033c92d611fa74e127fc9d443fc4f +"@tabler/icons@npm:3.40.0": + version: 3.40.0 + resolution: "@tabler/icons@npm:3.40.0" + checksum: 10c0/d335323695dff9218b486bb84a79893f86d5c284dc022c86bfdcfc550605c48ddffe72161c93f6fcab47ba6d828311c101fc5e306fb698b5b5104cf6250ed314 languageName: node linkType: hard From 2a23fa495520399161d01fc5ab96b42182f41374 Mon Sep 17 00:00:00 2001 From: Elizabet Oliveira Date: Fri, 20 Mar 2026 14:43:22 +0000 Subject: [PATCH 2/7] feat: enhance data source select with context-aware icons and inline actions Show IconConnection for trace sources, IconLogs for log sources, and IconStack as fallback. Move Create New Source and Edit Sources actions into the dropdown as a grouped section with icons, replacing the separate gear icon menu. Made-with: Cursor --- .changeset/enhance-data-source-select.md | 5 + packages/app/src/DBSearchPage.tsx | 93 +++---------- .../app/src/components/SelectControlled.tsx | 33 +++-- packages/app/src/components/SourceSelect.tsx | 123 +++++++++++++----- .../styles/SourceSelectControlled.module.scss | 6 + 5 files changed, 144 insertions(+), 116 deletions(-) create mode 100644 .changeset/enhance-data-source-select.md diff --git a/.changeset/enhance-data-source-select.md b/.changeset/enhance-data-source-select.md new file mode 100644 index 0000000000..0d8d25b75c --- /dev/null +++ b/.changeset/enhance-data-source-select.md @@ -0,0 +1,5 @@ +--- +"@hyperdx/app": patch +--- + +feat: Enhance data source select with context-aware icons and inline actions diff --git a/packages/app/src/DBSearchPage.tsx b/packages/app/src/DBSearchPage.tsx index cfa5079ae4..454a9bded2 100644 --- a/packages/app/src/DBSearchPage.tsx +++ b/packages/app/src/DBSearchPage.tsx @@ -11,7 +11,6 @@ import { } from 'react'; import dynamic from 'next/dynamic'; import Head from 'next/head'; -import Link from 'next/link'; import router from 'next/router'; import { parseAsBoolean, @@ -51,7 +50,6 @@ import { Flex, Grid, Group, - Menu, Modal, Paper, Select, @@ -67,10 +65,8 @@ import { import { notifications } from '@mantine/notifications'; import { IconBolt, - IconCirclePlus, IconPlayerPlay, IconPlus, - IconSettings, IconTags, IconX, } from '@tabler/icons-react'; @@ -191,59 +187,6 @@ export function getDefaultSourceId( return sources[0].id; } -function SourceEditMenu({ - setModalOpen, - setModelFormExpanded, -}: { - setModalOpen: (val: SetStateAction) => void; - setModelFormExpanded: (val: SetStateAction) => void; -}) { - return ( - - - - - - - - - - Sources - } - onClick={() => setModalOpen(true)} - > - Create New Source - - {IS_LOCAL_MODE ? ( - } - onClick={() => setModelFormExpanded(v => !v)} - > - Edit Source - - ) : ( - } - component={Link} - href="/team" - > - Edit Sources - - )} - - - ); -} - function SourceEditModal({ opened, onClose, @@ -1568,6 +1511,14 @@ function DBSearchPage() { setModelFormExpanded(false); }, [setModelFormExpanded]); + const onEditSources = useCallback(() => { + if (IS_LOCAL_MODE) { + setModelFormExpanded(v => !v); + } else { + router.push('/team'); + } + }, [setModelFormExpanded]); + const setNewSourceModalClosed = useCallback( () => setNewSourceModalOpened(false), [setNewSourceModalOpened], @@ -1609,22 +1560,18 @@ function DBSearchPage() { > {/* */} - - - - + & { onCreate?: () => void; + onEdit?: () => void; allowDeselect?: boolean; }; @@ -19,35 +20,41 @@ export default function SelectControlled(props: SelectControlledProps) { }, fieldState, } = useController(props); - const { onCreate, allowDeselect = true, ...restProps } = props; + const { onCreate, onEdit, allowDeselect = true, ...restProps } = props; - // This is needed as mantine does not clear the select - // if the value is not in the data after - // if it was previously in the data (ex. data was deleted) - const selected = props.data?.find(d => - typeof d === 'string' - ? d === fieldValue - : 'value' in d - ? d.value === fieldValue - : true, - ); + // Mantine does not clear the select if the value is removed from data + // after it was previously present (ex. data was deleted) + const selected = props.data?.some(d => { + if (typeof d === 'string') return d === fieldValue; + if ('value' in d) return d.value === fieldValue; + if ('items' in d) { + return d.items.some(item => + typeof item === 'string' + ? item === fieldValue + : item.value === fieldValue, + ); + } + return false; + }); const onChange = useCallback( (value: string | null) => { if (value === '_create_new_value' && onCreate != null) { onCreate(); + } else if (value === '_edit_sources_value' && onEdit != null) { + onEdit(); } else if (value !== null || allowDeselect) { fieldOnChange(value); } }, - [fieldOnChange, onCreate, allowDeselect], + [fieldOnChange, onCreate, onEdit, allowDeselect], ); return (