From 6c1373c33212e26521701acf73c0398721b3a881 Mon Sep 17 00:00:00 2001 From: Jacob Richman Date: Fri, 15 Aug 2025 20:18:31 -0700 Subject: Revert "Update semantic color tokens" (#6365) --- .../src/ui/components/messages/DiffRenderer.tsx | 47 ++++++++-------------- 1 file changed, 16 insertions(+), 31 deletions(-) (limited to 'packages/cli/src/ui/components/messages/DiffRenderer.tsx') diff --git a/packages/cli/src/ui/components/messages/DiffRenderer.tsx b/packages/cli/src/ui/components/messages/DiffRenderer.tsx index edea9939..fda5f1d4 100644 --- a/packages/cli/src/ui/components/messages/DiffRenderer.tsx +++ b/packages/cli/src/ui/components/messages/DiffRenderer.tsx @@ -6,9 +6,11 @@ import React from 'react'; import { Box, Text } from 'ink'; +import { Colors } from '../../colors.js'; import crypto from 'crypto'; import { colorizeCode, colorizeLine } from '../../utils/CodeColorizer.js'; import { MaxSizedBox } from '../shared/MaxSizedBox.js'; +import { theme } from '../../semantic-colors.js'; interface DiffLine { type: 'add' | 'del' | 'context' | 'hunk' | 'other'; @@ -106,20 +108,14 @@ export const DiffRenderer: React.FC = ({ theme, }) => { if (!diffContent || typeof diffContent !== 'string') { - return ( - No diff content. - ); + return No diff content.; } const parsedLines = parseDiffWithLineNumbers(diffContent); if (parsedLines.length === 0) { return ( - + No changes detected. ); @@ -162,7 +158,6 @@ export const DiffRenderer: React.FC = ({ tabWidth, availableTerminalHeight, terminalWidth, - theme, ); } @@ -175,7 +170,6 @@ const renderDiffContent = ( tabWidth = DEFAULT_TAB_WIDTH, availableTerminalHeight: number | undefined, terminalWidth: number, - theme: import('../../themes/theme.js').Theme | undefined, ) => { // 1. Normalize whitespace (replace tabs with spaces) *before* further processing const normalizedLines = parsedLines.map((line) => ({ @@ -190,11 +184,7 @@ const renderDiffContent = ( if (displayableLines.length === 0) { return ( - + No changes detected. ); @@ -258,10 +248,7 @@ const renderDiffContent = ( ) { acc.push( - + {'═'.repeat(terminalWidth)} , @@ -302,12 +289,12 @@ const renderDiffContent = ( acc.push( @@ -315,32 +302,30 @@ const renderDiffContent = ( {line.type === 'context' ? ( <> - - {prefixSymbol}{' '} - + {prefixSymbol} - {colorizeLine(displayContent, language, theme)} + {colorizeLine(displayContent, language)} ) : ( {prefixSymbol} {' '} - {colorizeLine(displayContent, language, theme)} + {colorizeLine(displayContent, language)} )} , -- cgit v1.2.3