Skip to content

Conversation

@alok87
Copy link
Contributor

@alok87 alok87 commented Jan 7, 2026

Summary

Fixes #1545

This PR implements the ability to enable/disable data sources from the UI. Disabled sources remain visible in the Sources management page but are automatically hidden from all dropdowns and selection menus throughout the application.

image image image

Changes

Backend

  • Added disabled field to the Source model (MongoDB schema)
    • Type: Boolean
    • Default: false
    • Sources are enabled by default

Frontend - Schema & Types

  • Updated SourceBaseSchema in common-utils to include optional disabled field
  • Type validation ensures backward compatibility with existing sources

Frontend - UI Components

Sources Management Page

  • Added toggle switch to enable/disable each source
  • Switch displays current state: "Enabled" or "Disabled"
  • Sources can be toggled on/off with a single click
  • All sources (enabled and disabled) remain visible in this management view

Source Filtering

Updated all source selection dropdowns to filter out disabled sources:

  • Search Page: Default source selection now excludes disabled sources
  • Sessions Page: Auto-selection only considers enabled session sources
  • Services Dashboard: Trace source dropdown filters out disabled sources
  • Kubernetes Dashboard: Log and metric source selection excludes disabled sources
  • All dropdowns: Generic source selector component filters disabled sources

User Experience

When a source is disabled:

  • ✅ Still visible in Team Settings → Sources (management page)
  • ✅ Can be re-enabled via toggle switch
  • ❌ Not shown in any source selection dropdowns
  • ❌ Not auto-selected as default source
  • ❌ Not available for new searches, dashboards, or queries

When a source is enabled:

  • ✅ Visible everywhere (management page + all dropdowns)
  • ✅ Available for selection in all features
  • ✅ Can be auto-selected as default
  • ✅ Normal behavior throughout the app

Use Cases

This feature enables teams to:

  1. Temporarily hide data sources without deleting them
  2. Keep development/staging sources configured but hidden in production
  3. Manage seasonal data sources that are only needed periodically
  4. Reduce clutter in source selection dropdowns
  5. Maintain source configurations while preventing accidental use

Testing

Manually tested:

  • ✅ Toggle switch works correctly in Sources list
  • ✅ Disabled sources hidden from Search page dropdown
  • ✅ Disabled sources hidden from Sessions page
  • ✅ Disabled sources hidden from Services dashboard
  • ✅ Disabled sources hidden from Kubernetes dashboard
  • ✅ Default source selection skips disabled sources
  • ✅ Re-enabling a source makes it immediately available
  • ✅ Existing sources without the field work correctly (default enabled)

Backward Compatibility

  • ✅ Existing sources without disabled field are treated as enabled
  • ✅ No database migration required
  • ✅ No breaking changes to API
  • ✅ Field is optional in schema validation

Changelog

Updated changelogs for all affected packages:

  • @hyperdx/app - UI components and filtering logic
  • @hyperdx/api - Backend model changes
  • @hyperdx/common-utils - Schema updates

@changeset-bot
Copy link

changeset-bot bot commented Jan 7, 2026

🦋 Changeset detected

Latest commit: 15ed071

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

This PR includes changesets to release 3 packages
Name Type
@hyperdx/common-utils Patch
@hyperdx/api Patch
@hyperdx/app 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 Jan 7, 2026

@alok87 is attempting to deploy a commit to the HyperDX Team on Vercel.

A member of the Team first needs to authorize it.


### Patch Changes

- feat: Add ability to disable data sources (fixes #1545) - Added 'disabled' field to Source model for toggling source visibility
Copy link
Member

@brandon-pereira brandon-pereira Jan 7, 2026

Choose a reason for hiding this comment

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

Note: we should run yarn changeset and revert changes to CHANGELOG.md as this file is generated at release time

</Group>
</Group>
</Text>
<div style={{ flex: 1 }}>
Copy link
Member

Choose a reason for hiding this comment

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

@elizabetdev can you provide UX feedback here? My gut tells me this feature won't be one of the main things people are doing it, so we should move it inside the form itself (see screenshots):

Example of where to put disabled potentially
Image

Closed UI (toggle could be removed and add "Disabled" badge to details row?)
Image

Copy link
Member

Choose a reason for hiding this comment

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

@alok87 functionality wise, things look good. pending @elizabetdev's feedback we could simplify some form code, lets see what she says :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Also made the disabled one less highlighted.
image

image

Copy link
Contributor

Choose a reason for hiding this comment

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

@alok87 The enabled/disabled toggle placement looks good to me 👍 Since it’s a high-level state, I agree it shouldn’t be buried under “Optional Fields.”

For the disabled state in the list view, the reduced opacity works well to show the status. One small thing to watch out for is the expand or collapse arrow (chevron). It would be good to keep that at full opacity.

If the arrow dims along with the text, the row can feel unclickable or read-only. Keeping the arrow bright helps signal that the row is still interactive and can be opened to update settings or re-enable it.

@alok87 alok87 force-pushed the fix-1545-disable-datasource branch 3 times, most recently from 8c0e4d4 to a2e1e18 Compare January 8, 2026 03:42
- Add 'disabled' field to source schema (common-utils, api, app)
- Move enable/disable toggle to expanded form header (top right)
- Dim disabled sources in list view (50% opacity when closed)
- Show full opacity when form is open for editing
- Filter out disabled sources in search page, dashboards, sessions
- Add changeset for release management
- Smooth transition effects for visual feedback

Based on PR feedback, form simplification will be addressed separately.
@alok87 alok87 force-pushed the fix-1545-disable-datasource branch from a2e1e18 to 15ed071 Compare January 8, 2026 03:52
@vercel
Copy link

vercel bot commented Jan 8, 2026

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

Project Deployment Review Updated (UTC)
hyperdx-v2-oss-app Ready Ready Preview, Comment Jan 8, 2026 0:12am

const { data: connections } = useConnections();
const updateSourceMutation = useUpdateSource();

const handleDisabledToggle = useCallback(
Copy link
Member

Choose a reason for hiding this comment

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

Thoughts on removing this code and just allowing the form to manage updating this value on save?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to Disable Certain Data Sources

3 participants