-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add telemetry config management with related UI dialog and settings #6028
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
| useEffect(() => { | ||
| if (!provider || loadingModels || model || isCustomModel) return; | ||
| // Don't auto-select if user explicitly cleared the model |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
DOsinga
left a comment
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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({ |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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'; | |||
There was a problem hiding this comment.
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.'; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
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.