Skip to content

Conversation

@zanesq
Copy link
Collaborator

@zanesq zanesq commented Dec 9, 2025

Summary

Add telemetry config management with related UI dialog and settings saved to config.
Existing users see modal, onboarding and settings has inline panel with learn more to launch the modal.

Screenshot 2025-12-09 at 11 56 24 AM Screenshot 2025-12-09 at 11 56 35 AM Screenshot 2025-12-09 at 11 57 10 AM


useEffect(() => {
if (!provider || loadingModels || model || isCustomModel) return;
// Don't auto-select if user explicitly cleared the model
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

noticed a few usability edge cases with the model selector preselection - couldn't clear it easily and needed a better loading state

Copy link
Collaborator

Choose a reason for hiding this comment

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

roger that. still though, maybe revisit. this is a complex if statement now

import TelemetryOptOutModal from '../../TelemetryOptOutModal';

interface TelemetrySettingsProps {
isWelcome?: boolean;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

onboarding needs different styling and html structure to match the other panels

Copy link
Collaborator

Choose a reason for hiding this comment

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

still though, let's stay away from optional booleans - better to be explicit

Copy link
Collaborator

@DOsinga DOsinga left a comment

Choose a reason for hiding this comment

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

left some commnets - I know we're in a rush so could address in a follow up. mostly we should just use the normal way of handling settings, no need for separate environment checking and a separate route etc

/// - GOOSE_TELEMETRY_ENABLED config value is set to false
///
/// Returns true otherwise (telemetry is opt-out, enabled by default)
pub fn is_telemetry_enabled() -> bool {
Copy link
Collaborator

Choose a reason for hiding this comment

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

to be honest, I don't think you need any of this. our config already reads environment variables and you can already read the config from the client. so no need for a special handler here or routes I would think

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah thanks I didn't realize it did all that, will look into refactoring quickly 👍

import TelemetryOptOutModal from '../../TelemetryOptOutModal';

interface TelemetrySettingsProps {
isWelcome?: boolean;
Copy link
Collaborator

Choose a reason for hiding this comment

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

still though, let's stay away from optional booleans - better to be explicit


useEffect(() => {
if (!provider || loadingModels || model || isCustomModel) return;
// Don't auto-select if user explicitly cleared the model
Copy link
Collaborator

Choose a reason for hiding this comment

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

roger that. still though, maybe revisit. this is a complex if statement now

export default function TelemetryOptOutModal({
isOpen: controlledIsOpen,
onClose,
showOnFirstLaunch = true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

hmm, also here. optional boolean and then default to true, just make it explicit

interface TelemetryOptOutModalProps {
isOpen?: boolean;
onClose?: () => void;
showOnFirstLaunch?: boolean;
Copy link
Collaborator

Choose a reason for hiding this comment

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

do any of these need to be optional?

const checkTelemetryChoice = async () => {
try {
// First check if user has a provider configured (existing user)
const providerResponse = await readConfig({
Copy link
Collaborator

Choose a reason for hiding this comment

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

we have a hook for this we should use

});

// If the config value is null/undefined, user hasn't made a choice yet
if (telemetryResponse.data === null || telemetryResponse.data === undefined) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

! will do

setShowModal(true);
}
} catch (error) {
console.error('Failed to check telemetry config:', error);
Copy link
Collaborator

Choose a reason for hiding this comment

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

eh let's not drop errors on the floor

@@ -0,0 +1,134 @@
import { useState, useEffect } from 'react';
Copy link
Collaborator

Choose a reason for hiding this comment

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

this file could do with a quick look over on comments

const title = 'Privacy';
const description = 'Control how your data is used';
const toggleLabel = 'Anonymous usage data';
const toggleDescription = 'Help improve goose by sharing anonymous usage statistics.';
Copy link
Collaborator

Choose a reason for hiding this comment

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

any reason not to inline these?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

because they are reused below, would have to repeat the text twice leading to potentially out of sync later

@zanesq zanesq merged commit ac55924 into micn/posthog Dec 9, 2025
4 checks passed
@zanesq zanesq deleted the zane/posthog/optout branch December 9, 2025 22:21
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.

3 participants