Skip to content

feat: Enhance data source select with context-aware icons and inline actions#1948

Merged
kodiakhq[bot] merged 8 commits intomainfrom
feat/enhance-data-source-select
Mar 20, 2026
Merged

feat: Enhance data source select with context-aware icons and inline actions#1948
kodiakhq[bot] merged 8 commits intomainfrom
feat/enhance-data-source-select

Conversation

@elizabetdev
Copy link
Contributor

@elizabetdev elizabetdev commented Mar 20, 2026

Summary

Closes HDX-3784

  • Context-aware icons for all source kinds: The data source dropdown now shows icons for every source type — IconLogs for logs, IconConnection for traces, IconDeviceLaptop for sessions, and IconChartLine for metrics. Falls back to IconStack when no source is selected.
  • Inline source actions: "Create New Source" and "Edit Sources" actions are now part of the dropdown itself under an "Actions" group with a labeled separator, replacing the separate gear icon menu (SourceEditMenu).
  • Dependency update: Updated @tabler/icons-react from v3.5.0 to v3.40.0 to get IconConnection.
  • Fix: source management regression when HDX_LOCAL_DEFAULT_SOURCES is set: Before this PR, there were two ways to create/edit sources: (1) options inside the dropdown, which were hidden when HDX_LOCAL_DEFAULT_SOURCES is 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 when HDX_LOCAL_DEFAULT_SOURCES is set — leaving users with no way to manage sources. Fixed by removing that guard so the dropdown options always appear.
image Screenshot 2026-03-20 at 17 49 30

Changes

  • packages/app/src/components/SourceSelect.tsx -- Dynamic left icon based on selected source kind (all 4 kinds: log, trace, session, metric), onEdit prop, grouped action items with icons, renderOption for source kind and action item icons. Removed hasLocalDefaultSources guard so source management actions are always available.
  • packages/app/src/components/SelectControlled.tsx -- Added onEdit callback support, fixed selected check to handle grouped data.
  • packages/app/src/DBSearchPage.tsx -- Removed SourceEditMenu component, added onEditSources callback, wired onEdit to SourceSelectControlled.
  • packages/app/styles/SourceSelectControlled.module.scss -- Group label separator styling with semantic --color-border token.
  • packages/app/package.json -- Updated @tabler/icons-react to ^3.39.0.

Test plan

  • Select a log source and verify IconLogs appears as the left icon
  • Select a trace source and verify IconConnection appears as the left icon
  • Select a session source and verify IconDeviceLaptop appears as the left icon
  • Select a metric source and verify IconChartLine appears as the left icon
  • Verify each source in the dropdown shows its corresponding kind icon
  • Open the dropdown and verify "Create New Source" and "Edit Sources" appear under the "Actions" group with icons
  • Click "Create New Source" and verify the modal opens
  • Click "Edit Sources" and verify navigation to edit (local mode: modal, cloud mode: /team)
  • Verify the gear icon menu is no longer present next to the select
  • With NEXT_PUBLIC_HDX_LOCAL_DEFAULT_SOURCES set: verify "Create New Source" and "Edit Sources" still appear in the dropdown and work correctly

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-bot
Copy link

changeset-bot bot commented Mar 20, 2026

🦋 Changeset detected

Latest commit: e6a3f76

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@hyperdx/app Patch
@hyperdx/api Patch
@hyperdx/otel-collector Patch

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

@vercel
Copy link

vercel bot commented Mar 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hyperdx-oss Ready Ready Preview, Comment Mar 20, 2026 7:20pm

Request Review

@github-actions
Copy link
Contributor

github-actions bot commented Mar 20, 2026

PR Review

  • ⚠️ @tabler/icons-react jump from 3.5 → 3.40 (35 minor versions) across 93 files → Verify no icons were renamed/removed in the broad codebase; this is a large jump with potential for silent breakage elsewhere (e.g., IconConnection is new, but others may have changed).

  • ⚠️ package.json specifies ^3.39.0 but PR description says "Updated to v3.40.0" → Minor inconsistency; lock resolves to 3.40.0 which is fine, but the stated intent vs. constraint mismatch could cause confusion on next yarn upgrade.

  • SelectControlled.tsx selected fix is correct: The old code used .find() with a true fallback for group objects (no value key), which would incorrectly mark any group-containing data as "selected". The new .some() implementation properly traverses nested items arrays.

  • Removal of HDX_LOCAL_DEFAULT_SOURCES guard: Intentional fix per PR description — the guard was hiding source management options when the gear icon was also removed, leaving users with no way to manage sources. The fix is sound.

  • Sentinel values _create_new_value / _edit_value: Moved to SelectControlledSpecialValues enum (good refactor). Collision with real source IDs is negligible assuming UUIDs.

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.
@github-actions
Copy link
Contributor

github-actions bot commented Mar 20, 2026

E2E Test Results

All tests passed • 91 passed • 3 skipped • 986s

Status Count
✅ Passed 91
❌ Failed 0
⚠️ Flaky 2
⏭️ Skipped 3

Tests ran across 4 shards in parallel.

View full report →

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
pulpdrew previously approved these changes Mar 20, 2026
Copy link
Contributor

@pulpdrew pulpdrew left a comment

Choose a reason for hiding this comment

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

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
@kodiakhq kodiakhq bot merged commit 3d15b3d into main Mar 20, 2026
15 checks passed
@kodiakhq kodiakhq bot deleted the feat/enhance-data-source-select branch March 20, 2026 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants