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

Function SpinnerWithVerb

src/components/Spinner.tsx:62–81  ·  view source on GitHub ↗
(props: Props)

Source from the content-addressed store, hash-verified

60// hook call chains. Without this split, toggling /brief mid-render would
61// violate Rules of Hooks (the inner variant calls ~10 more hooks).
62export function SpinnerWithVerb(props: Props): React.ReactNode {
63 const isBriefOnly = useAppState(s => s.isBriefOnly);
64 // REPL overrides isBriefOnly→false when viewing a teammate transcript
65 // (see isBriefOnly={viewedTeammateTask ? false : isBriefOnly}). That
66 // prop isn't threaded here, so replicate the gate from the store —
67 // teammate view needs the real spinner (which shows teammate status).
68 const viewingAgentTaskId = useAppState(s_0 => s_0.viewingAgentTaskId);
69 // Hoisted to mount-time — this component re-renders at animation framerate.
70 const briefEnvEnabled = feature('KAIROS') || feature('KAIROS_BRIEF') ?
71 // biome-ignore lint/correctness/useHookAtTopLevel: feature() is a compile-time constant
72 useMemo(() => isEnvTruthy(process.env.CLAUDE_CODE_BRIEF), []) : false;
73
74 // Runtime gate mirrors isBriefEnabled() but inlined — importing from
75 // BriefTool.ts would leak tool-name strings into external builds. Single
76 // spinner instance → hooks stay unconditional (two subs, negligible).
77 if ((feature('KAIROS') || feature('KAIROS_BRIEF')) && (getKairosActive() || getUserMsgOptIn() && (briefEnvEnabled || getFeatureValue_CACHED_MAY_BE_STALE('tengu_kairos_brief', false))) && isBriefOnly && !viewingAgentTaskId) {
78 return <BriefSpinner mode={props.mode} overrideMessage={props.overrideMessage} />;
79 }
80 return <SpinnerWithVerbInner {...props} />;
81}
82function SpinnerWithVerbInner({
83 mode,
84 loadingStartTimeRef,

Callers

nothing calls this directly

Calls 6

useAppStateFunction · 0.85
featureFunction · 0.85
isEnvTruthyFunction · 0.85
getKairosActiveFunction · 0.85
getUserMsgOptInFunction · 0.85

Tested by

no test coverage detected