MCPcopy
hub / github.com/codeaashu/claude-code / Onboarding

Function Onboarding

src/components/Onboarding.tsx:30–213  ·  view source on GitHub ↗
({
  onDone
}: Props)

Source from the content-addressed store, hash-verified

28 onDone(): void;
29};
30export function Onboarding({
31 onDone
32}: Props): React.ReactNode {
33 const [currentStepIndex, setCurrentStepIndex] = useState(0);
34 const [skipOAuth, setSkipOAuth] = useState(false);
35 const [oauthEnabled] = useState(() => isAnthropicAuthEnabled());
36 const [theme, setTheme] = useTheme();
37 useEffect(() => {
38 logEvent('tengu_began_setup', {
39 oauthEnabled
40 });
41 }, [oauthEnabled]);
42 function goToNextStep() {
43 if (currentStepIndex < steps.length - 1) {
44 const nextIndex = currentStepIndex + 1;
45 setCurrentStepIndex(nextIndex);
46 logEvent('tengu_onboarding_step', {
47 oauthEnabled,
48 stepId: steps[nextIndex]?.id as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS
49 });
50 } else {
51 onDone();
52 }
53 }
54 function handleThemeSelection(newTheme: ThemeSetting) {
55 setTheme(newTheme);
56 goToNextStep();
57 }
58 const exitState = useExitOnCtrlCDWithKeybindings();
59
60 // Define all onboarding steps
61 const themeStep = <Box marginX={1}>
62 <ThemePicker onThemeSelect={handleThemeSelection} showIntroText={true} helpText="To change this later, run /theme" hideEscToCancel={true} skipExitHandling={true} // Skip exit handling as Onboarding already handles it
63 />
64 </Box>;
65 const securityStep = <Box flexDirection="column" gap={1} paddingLeft={1}>
66 <Text bold>Security notes:</Text>
67 <Box flexDirection="column" width={70}>
68 {/**
69 * OrderedList misnumbers items when rendering conditionally,
70 * so put all items in the if/else
71 */}
72 <OrderedList>
73 <OrderedList.Item>
74 <Text>Claude can make mistakes</Text>
75 <Text dimColor wrap="wrap">
76 You should always review Claude&apos;s responses, especially when
77 <Newline />
78 running code.
79 <Newline />
80 </Text>
81 </OrderedList.Item>
82 <OrderedList.Item>
83 <Text>
84 Due to prompt injection risks, only use it with code you trust
85 </Text>
86 <Text dimColor wrap="wrap">
87 For more details see:

Callers

nothing calls this directly

Calls 13

isAnthropicAuthEnabledFunction · 0.85
logEventFunction · 0.85
isRunningOnHomespaceFunction · 0.85
normalizeApiKeyForConfigFunction · 0.85
getCustomApiKeyStatusFunction · 0.85
shouldOfferTerminalSetupFunction · 0.85
setupTerminalFunction · 0.85
goToNextStepFunction · 0.85
useKeybindingsFunction · 0.85
useThemeFunction · 0.50
onDoneFunction · 0.50

Tested by

no test coverage detected