continue-custom/extensions/cli/src/ui/LoadingText.tsx
continue[bot] 977442ac18
Fix gray text readability on light backgrounds in CLI (#7898)
Replace hard-to-read gray text with 'dim' color which is more readable
on both light and dark terminal backgrounds. This primarily affects:

- Startup display: MCP prompt descriptions, model loading text, tips
- Message rendering: user input, system messages, streaming indicators
- Tool displays: result summaries, previews, diff output
- Status displays: action status, timers, loading text

The 'dim' color provides better contrast than 'gray' on light backgrounds
while remaining subtle and unobtrusive on dark backgrounds.

Generated with [Continue](https://continue.dev)

Co-authored-by: Continue Agent <agent@continue.dev>
Co-authored-by: Continue <noreply@continue.dev>
2025-09-22 13:20:22 -07:00

33 lines
635 B
TypeScript

import { Text } from "ink";
import React, { useEffect, useState } from "react";
interface LoadingTextProps {
text: string;
color?: string;
interval?: number;
}
export const LoadingText: React.FC<LoadingTextProps> = ({
text,
color = "dim",
interval = 300,
}) => {
const [dotsCount, setDotsCount] = useState(1);
useEffect(() => {
const timer = setInterval(() => {
setDotsCount((current) => (current % 3) + 1);
}, interval);
return () => clearInterval(timer);
}, [interval]);
const dots = ".".repeat(dotsCount);
return (
<Text color={color}>
{text}
{dots}
</Text>
);
};