agent-ecosystem/src/renderer/components/ui/CodeChipBadge.tsx
iliya d6a0f4c3a1 feat: enhance task management features and improve messaging components
- Updated README to include new 'Solo mode' feature for single-agent task management.
- Refactored message handling in TeamDataService and TeamProvisioningService to improve deduplication of lead messages.
- Enhanced linkification in chat components to support team mentions.
- Introduced AnimatedHeightReveal for smoother task item animations in the sidebar.
- Improved task comment input to support chip draft persistence and team suggestions.
- Cleaned up CSS by removing unused animations related to task item entry.
2026-03-10 21:54:53 +02:00

37 lines
1.1 KiB
TypeScript

/**
* Styled span for rendering inline code chip tokens in the backdrop overlay.
* Uses the same text as the textarea (transparent) to maintain pixel-perfect alignment.
*
* Purple color scheme to distinguish from @mention badges (blue).
* Folder chips use a teal color scheme to distinguish from file chips.
*/
import type { InlineChip } from '@renderer/types/inlineChip';
const CHIP_BG = 'rgba(139, 92, 246, 0.15)';
const CHIP_TEXT = '#a78bfa';
const FOLDER_CHIP_BG = 'rgba(45, 212, 191, 0.15)';
const FOLDER_CHIP_TEXT = '#5eead4';
interface CodeChipBadgeProps {
chip: InlineChip;
/** The full chip token text (e.g. "📄auth.ts:10-15") */
tokenText: string;
}
export const CodeChipBadge = ({ chip, tokenText }: CodeChipBadgeProps): React.JSX.Element => {
const bg = chip.isFolder ? FOLDER_CHIP_BG : CHIP_BG;
const text = chip.isFolder ? FOLDER_CHIP_TEXT : CHIP_TEXT;
return (
<span
style={{
backgroundColor: bg,
color: text,
borderRadius: '4px',
boxShadow: `0 0 0 1.5px ${bg}`,
}}
>
{tokenText}
</span>
);
};