Skip to content

feat(settings): gate TelemetryField on isEnterprise prop#2298

Merged
peppescg merged 1 commit into
mainfrom
chore/gate-telemetry-field-on-isenterprise
May 29, 2026
Merged

feat(settings): gate TelemetryField on isEnterprise prop#2298
peppescg merged 1 commit into
mainfrom
chore/gate-telemetry-field-on-isenterprise

Conversation

@peppescg

Copy link
Copy Markdown
Collaborator

Summary

Extends the existing isEnterprise prop in GeneralTabWrapper (which already gates ExperimentalFeatures) to also gate the Sentry TelemetryField. Default behavior unchanged for OSS.

Why

Rebranded / enterprise builds (e.g. stacklok-enterprise-platform's Stacklok Desktop distro) ship without a Sentry DSN, so Sentry.init({ enabled: !!import.meta.env.VITE_SENTRY_DSN }) is false. The "Error reporting" toggle in Settings → General is a no-op in those builds and confuses end users.

The enterprise overlay already passes isEnterprise={true} to GeneralTabWrapper (merged in stacklok/stacklok-enterprise-platform#1317). After this PR ships and the submodule is synced, the toggle will disappear in enterprise without any further changes.

Pattern

Mirrors the existing gate for ExperimentalFeatures in the same component.

<AutoLaunchField />
<Separator />
{!isEnterprise && (
  <>
    <TelemetryField />
    <Separator />
  </>
)}
<QuitConfirmationField />

Test plan

  • pnpm run lint
  • pnpm run type-check
  • pnpm run format
  • pnpm run test:nonInteractive — 2451/2451 passing (+1 new test in general-tab.test.tsx)
  • Manual: render <GeneralTabWrapper isEnterprise /> in a story or test app, confirm Error reporting + Experimental Features sections are both hidden, other fields (Theme / Start on login / Quit confirmation) remain visible.

Today GeneralTabWrapper accepts an `isEnterprise` prop that hides
ExperimentalFeatures. Extend the same gate to also hide the Sentry
"Error reporting" toggle when set.

Rebranded / enterprise builds typically ship without a Sentry DSN
(`enabled: !!import.meta.env.VITE_SENTRY_DSN` is false in those builds),
so the toggle is a confusing no-op for end users. Letting downstream
consumers hide it via the existing prop avoids overlay-copying the whole
wrapper component.

OSS behavior is unchanged: `isEnterprise` defaults to `false`, so the
toggle still renders in the OSS GeneralTab.
Copilot AI review requested due to automatic review settings May 29, 2026 10:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Gates the Sentry TelemetryField in the Settings → General tab behind the existing isEnterprise prop on GeneralTabWrapper, so enterprise/branded builds without a Sentry DSN don't show a no-op "Error reporting" toggle. OSS default behavior is unchanged.

Changes:

  • Wrap <TelemetryField /> and its trailing <Separator /> in a !isEnterprise conditional in GeneralTabWrapper.
  • Add a test verifying the telemetry toggle is hidden when isEnterprise is true.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
renderer/src/common/components/settings/tabs/components/general-tab-wrapper.tsx Conditionally render TelemetryField + separator only when not enterprise.
renderer/src/common/components/settings/tabs/tests/general-tab.test.tsx New test asserting telemetry toggle is absent with isEnterprise={true}.

@peppescg peppescg self-assigned this May 29, 2026
@peppescg peppescg merged commit 8d1fb22 into main May 29, 2026
18 checks passed
@peppescg peppescg deleted the chore/gate-telemetry-field-on-isenterprise branch May 29, 2026 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants