feat: Enhance data source select with context-aware icons and inline actions#1948
feat: Enhance data source select with context-aware icons and inline actions#1948kodiakhq[bot] merged 8 commits intomainfrom
Conversation
Update from v3.5.0 to get IconConnection (added in v3.39) for the data source select enhancement. Made-with: Cursor
…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 detectedLatest commit: e6a3f76 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Review
No critical bugs or security issues found. The icon library version bump is the main risk to verify before merging. |
…icons Refactor SourceSelect to utilize a context-aware mapping for option icons, enhancing the user experience by displaying relevant icons based on the source kind. The renderOption function has been updated to accommodate this new logic, improving the visual representation of options in the dropdown.
E2E Test Results✅ All tests passed • 91 passed • 3 skipped • 986s
Tests ran across 4 shards in parallel. |
The source settings menu was removed in favor of inline dropdown actions. Update global setup to wait for the source selector instead of the removed gear icon, and update the SearchPage page object and sources spec to interact with actions via the dropdown. Made-with: Cursor
The previous refactor removed the standalone SourceEditMenu gear icon and moved its actions into the SourceSelectControlled dropdown, but kept the hasLocalDefaultSources guard that hid those actions. Since the gear icon fallback no longer exists, users with HDX_LOCAL_DEFAULT_SOURCES set lost all access to "Create New Source" and "Edit Sources". Remove the hasLocalDefaultSources guard so the actions always appear in the dropdown when onCreate/onEdit callbacks are provided. Made-with: Cursor
Added new icons for session and metric sources in the SourceSelect component, improving visual differentiation of source types. The SourceKind enum now includes IconDeviceLaptop for sessions and IconChartLine for metrics, enhancing the user experience in the dropdown selection.
pulpdrew
left a comment
There was a problem hiding this comment.
LGTM, with one small suggestion
Replace hardcoded string values with SelectControlledSpecialValues enum and rename _edit_sources_value to _edit_value for generality. Made-with: Cursor
Summary
Closes HDX-3784
IconLogsfor logs,IconConnectionfor traces,IconDeviceLaptopfor sessions, andIconChartLinefor metrics. Falls back toIconStackwhen no source is selected.SourceEditMenu).@tabler/icons-reactfrom v3.5.0 to v3.40.0 to getIconConnection.HDX_LOCAL_DEFAULT_SOURCESis set: Before this PR, there were two ways to create/edit sources: (1) options inside the dropdown, which were hidden whenHDX_LOCAL_DEFAULT_SOURCESis set, and (2) a gear icon button next to the dropdown, which was always visible. This PR removed the gear icon and kept only the dropdown options, but they were still configured to hide whenHDX_LOCAL_DEFAULT_SOURCESis set — leaving users with no way to manage sources. Fixed by removing that guard so the dropdown options always appear.Changes
packages/app/src/components/SourceSelect.tsx-- Dynamic left icon based on selected source kind (all 4 kinds: log, trace, session, metric),onEditprop, grouped action items with icons,renderOptionfor source kind and action item icons. RemovedhasLocalDefaultSourcesguard so source management actions are always available.packages/app/src/components/SelectControlled.tsx-- AddedonEditcallback support, fixedselectedcheck to handle grouped data.packages/app/src/DBSearchPage.tsx-- RemovedSourceEditMenucomponent, addedonEditSourcescallback, wiredonEdittoSourceSelectControlled.packages/app/styles/SourceSelectControlled.module.scss-- Group label separator styling with semantic--color-bordertoken.packages/app/package.json-- Updated@tabler/icons-reactto^3.39.0.Test plan
IconLogsappears as the left iconIconConnectionappears as the left iconIconDeviceLaptopappears as the left iconIconChartLineappears as the left iconNEXT_PUBLIC_HDX_LOCAL_DEFAULT_SOURCESset: verify "Create New Source" and "Edit Sources" still appear in the dropdown and work correctly