MCPcopy Create free account
hub / github.com/Noumena-Network/code / SpinnerWithVerb

Function SpinnerWithVerb

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

isEnvTruthyFunction · 0.90
useAppStateFunction · 0.85
getKairosActiveFunction · 0.85
getUserMsgOptInFunction · 0.85

Tested by

no test coverage detected