|
10 | 10 | */ |
11 | 11 |
|
12 | 12 | import { Box, Text } from 'ink'; |
13 | | -import { useSyncExternalStore } from 'react'; |
| 13 | +import { useEffect, useSyncExternalStore } from 'react'; |
14 | 14 | import type { WizardStore } from '@ui/tui/store'; |
15 | 15 | import { ConfirmationInput, ModalOverlay } from '@ui/tui/primitives/index'; |
16 | 16 | import { Icons } from '@ui/tui/styles'; |
17 | 17 | import type { SettingsConflict } from '@lib/agent/claude-settings'; |
| 18 | +import { analytics } from '@utils/analytics'; |
18 | 19 |
|
19 | 20 | function sourceLabel(source: SettingsConflict['source']): string { |
20 | 21 | switch (source) { |
@@ -44,12 +45,26 @@ export const ManagedSettingsScreen = ({ |
44 | 45 | const conflicts = store.session.settingsConflicts; |
45 | 46 | const readOnlyConflicts = conflicts?.filter((c) => !c.writable); |
46 | 47 |
|
| 48 | + const hasManaged = Boolean( |
| 49 | + readOnlyConflicts?.some((c) => c.source === 'managed'), |
| 50 | + ); |
| 51 | + const hasReadOnly = Boolean( |
| 52 | + readOnlyConflicts && readOnlyConflicts.length > 0, |
| 53 | + ); |
| 54 | + useEffect(() => { |
| 55 | + // Read-only conflict — nothing to accept, so impression only. |
| 56 | + if (hasReadOnly) { |
| 57 | + analytics.wizardCapture('settings conflict shown', { |
| 58 | + kind: 'managed', |
| 59 | + has_managed: hasManaged, |
| 60 | + }); |
| 61 | + } |
| 62 | + }, [hasReadOnly, hasManaged]); |
| 63 | + |
47 | 64 | if (!readOnlyConflicts || readOnlyConflicts.length === 0) { |
48 | 65 | return null; |
49 | 66 | } |
50 | 67 |
|
51 | | - const hasManaged = readOnlyConflicts.some((c) => c.source === 'managed'); |
52 | | - |
53 | 68 | return ( |
54 | 69 | <ModalOverlay |
55 | 70 | borderColor="red" |
|
0 commit comments