MCPcopy Index your code
hub / github.com/codeaashu/claude-code / BriefSpinner

Function BriefSpinner

src/components/Spinner.tsx:316–436  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

314 overrideMessage?: string | null;
315};
316function BriefSpinner(t0) {
317 const $ = _c(31);
318 const {
319 mode,
320 overrideMessage
321 } = t0;
322 const settings = useSettings();
323 const reducedMotion = settings.prefersReducedMotion ?? false;
324 const [randomVerb] = useState(_temp4);
325 const verb = overrideMessage ?? randomVerb;
326 const connStatus = useAppState(_temp5);
327 let t1;
328 let t2;
329 if ($[0] !== mode) {
330 t1 = () => {
331 const operationId = "spinner-" + mode;
332 activityManager.startCLIActivity(operationId);
333 return () => {
334 activityManager.endCLIActivity(operationId);
335 };
336 };
337 t2 = [mode];
338 $[0] = mode;
339 $[1] = t1;
340 $[2] = t2;
341 } else {
342 t1 = $[1];
343 t2 = $[2];
344 }
345 useEffect(t1, t2);
346 const [, time] = useAnimationFrame(reducedMotion ? null : 120);
347 const runningCount = useAppState(_temp6);
348 const showConnWarning = connStatus === "reconnecting" || connStatus === "disconnected";
349 const connText = connStatus === "reconnecting" ? "Reconnecting" : "Disconnected";
350 const dotFrame = Math.floor(time / 300) % 3;
351 let t3;
352 if ($[3] !== dotFrame || $[4] !== reducedMotion) {
353 t3 = reducedMotion ? "\u2026 " : ".".repeat(dotFrame + 1).padEnd(3);
354 $[3] = dotFrame;
355 $[4] = reducedMotion;
356 $[5] = t3;
357 } else {
358 t3 = $[5];
359 }
360 const dots = t3;
361 let t4;
362 if ($[6] !== verb) {
363 t4 = stringWidth(verb);
364 $[6] = verb;
365 $[7] = t4;
366 } else {
367 t4 = $[7];
368 }
369 const verbWidth = t4;
370 let t5;
371 if ($[8] !== reducedMotion || $[9] !== showConnWarning || $[10] !== time || $[11] !== verb || $[12] !== verbWidth) {
372 const glimmerIndex = reducedMotion || showConnWarning ? -100 : computeGlimmerIndex(Math.floor(time / SHIMMER_INTERVAL_MS), verbWidth);
373 t5 = computeShimmerSegments(verb, glimmerIndex);

Callers

nothing calls this directly

Calls 9

useSettingsFunction · 0.85
useAppStateFunction · 0.85
useAnimationFrameFunction · 0.85
computeGlimmerIndexFunction · 0.85
computeShimmerSegmentsFunction · 0.85
useTerminalSizeFunction · 0.85
startCLIActivityMethod · 0.80
endCLIActivityMethod · 0.80
maxMethod · 0.80

Tested by

no test coverage detected