feat: Add ability to disable data sources (fixes #1545)#2186
feat: Add ability to disable data sources (fixes #1545)#2186brandon-pereira wants to merge 5 commits intomainfrom
Conversation
- 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.
…ource # Conflicts: # packages/api/src/models/source.ts # packages/app/src/KubernetesDashboardPage.tsx # packages/app/src/components/SourceSelect.tsx # packages/app/src/source.ts # packages/common-utils/src/types.ts
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 51348f6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 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 |
🟡 Tier 3 — StandardIntroduces new logic, modifies core functionality, or touches areas with non-trivial risk. Why this tier:
Review process: Full human review — logic, architecture, edge cases. Stats
|
PR Review✅ No critical issues found. A few minor observations:
Overall the implementation is clean: schema, Zod type, UI toggle, and all filtering sites are consistent; test coverage for |
- Add unit tests for getDefaultSourceId covering all-disabled, disabled-last-selected fallback, mixed enabled/disabled, and unknown-id fallback cases - Show a 'Disabled' Badge next to the source name in SourcesList so the state is immediately apparent (not just lower opacity). Also drops the now-vestigial <Flex> wrapper around the source details that had no siblings.
E2E Test Results✅ All tests passed • 160 passed • 3 skipped • 1198s
Tests ran across 4 shards in parallel. |
|
Claude finished @brandon-pereira's task in 1m 11s —— View job Re-review: All items addressed ✅
Test coverage (
Alerts out-of-scope: Agreed — silently suppressing alerts on disable would be a footgun. The clear call-out in the PR description is the right approach. This looks ready to merge. |
Summary
Continues #1567 (originally authored by @alok87) — adds the ability to enable/disable data sources from the UI. Disabled sources remain visible in Team Settings → Sources but are filtered out of every source-selection dropdown across the app.
This branch was opened to take #1567 across the finish line: address the open review comments and bring it up to date with
main.Screenshots
Changes vs. the original PR
Review feedback addressed
@brandon-pereira: Form-managed save instead of inline mutation — RemovedhandleDisabledToggleinSourceForm.tsx. The toggle now just updates form state viaController/onChange; the value is persisted on Save Source like every other field, which is consistent with the rest of the form.@elizabetdev: Keep the chevron at full opacity when a source is disabled — Moved theopacity: 0.5rule from the outerFlexto the inner content<div>inSourcesList.tsx. The expand/collapse arrow stays bright so the row still reads as interactive and the user can re-enable the source.@brandon-pereira: Use a changeset, not direct CHANGELOG edits — Already addressed by @alok87 in15ed071b;.changeset/clever-sources-disable.mdis in place and the manualCHANGELOG.mdedits were dropped.Merge with main
mainhad moved significantly (Mantine v7 → v9 upgrade, source-model refactor to a discriminated union, local-mode storage moved tolocalStore, etc.). Conflict resolution highlights:packages/api/src/models/source.ts— Addeddisabled: { type: Boolean, default: false }to the newsourceBaseSchema(the common-fields base for the discriminator), instead of the old monolithic schema the original PR was modifying.packages/common-utils/src/types.ts—disabled: z.boolean().optional()lives onBaseSourceSchemaalongsidequerySettingsandtimestampValueExpression, so all source kinds inherit it via.extend(...).packages/app/src/source.ts— Adoptedmain's cleanerlocalSources.update(...)+ standardinvalidateQueriesflow. The original PR's bespokesetQueryDatainonSuccessis no longer needed now that the toggle goes through the regular form-save path.packages/app/src/components/SourceSelect.tsx— Added!source.disabledtomain's restructuredvaluesuseMemo (which now handles connection/kind filtering and create/edit action items).packages/app/src/KubernetesDashboardPage.tsx— Combinedmain's!!truthy coercion with the!s.disabledfilter.Behavior (unchanged from #1567)
disabledboolean (defaultfalse).SourceSelect, and the auto-default-source logic.Verification
make ci-lint✅make ci-unit✅ (815 + 1537 = 2,352 tests passing)tsc --noEmitclean acrosscommon-utils,api, andappRelated