From f7edf711906ed8492fc65f3c1cfad1ccd7ede187 Mon Sep 17 00:00:00 2001 From: Taylor Mullen Date: Sat, 19 Apr 2025 12:38:09 -0400 Subject: Give Gemini Code a face lift. - This utilizes `ink-gradient` to render GEMINI CODE in amazing colors. - Added a shared color configuration for UX (should this be in config?). It's very possible that we shouldn't be talking about the specific colors and instead be mentioning "foreground"/"background"/inlineCode etc. type colors. - Updated existing color usages to utilize `Colors.*` Fixes https://b.corp.google.com/issues/411385593 --- packages/cli/src/ui/components/messages/DiffRenderer.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 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 b16a2561..01cc4938 100644 --- a/packages/cli/src/ui/components/messages/DiffRenderer.tsx +++ b/packages/cli/src/ui/components/messages/DiffRenderer.tsx @@ -6,6 +6,7 @@ import React from 'react'; import { Box, Text } from 'ink'; +import { Colors } from '../../colors.js'; interface DiffLine { type: 'add' | 'del' | 'context' | 'hunk' | 'other'; @@ -96,7 +97,7 @@ export const DiffRenderer: React.FC = ({ tabWidth = DEFAULT_TAB_WIDTH, }) => { if (!diffContent || typeof diffContent !== 'string') { - return No diff content.; + return No diff content.; } const parsedLines = parseDiffWithLineNumbers(diffContent); @@ -114,7 +115,7 @@ export const DiffRenderer: React.FC = ({ if (displayableLines.length === 0) { return ( - + No changes detected. ); @@ -137,7 +138,11 @@ export const DiffRenderer: React.FC = ({ // --- End Modification --- return ( - + {/* Iterate over the lines that should be displayed (already normalized) */} {displayableLines.map((line, index) => { const key = `diff-line-${index}`; @@ -165,7 +170,6 @@ export const DiffRenderer: React.FC = ({ break; default: throw new Error(`Unknown line type: ${line.type}`); - break; } // Render the line content *after* stripping the calculated *minimum* baseIndentation. @@ -175,7 +179,7 @@ export const DiffRenderer: React.FC = ({ return ( // Using your original rendering structure - {gutterNumStr} + {gutterNumStr} {prefixSymbol}{' '} -- cgit v1.2.3