Skip to content

Commit 6ea93c1

Browse files
committed
cleanup
1 parent 4403707 commit 6ea93c1

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

ai/ai-react-app/src/components/Specific/ChatMessage.module.css

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,18 +100,17 @@
100100
background-color: rgba(
101101
var(--google-blue-rgb),
102102
0.15
103-
); /* Use RGB version of your blue for opacity */
104-
/* border-bottom: 1.5px dashed rgba(var(--google-blue-rgb), 0.6); */
103+
);
105104
padding: 1px 0;
106105
border-radius: 2px;
107-
cursor: default; /* Or pointer if you add click interactivity */
106+
cursor: default;
108107
}
109108

110109
.sourceSuperscript {
111110
font-size: 0.7em;
112111
vertical-align: super;
113-
color: var(--google-blue); /* Or a color that stands out */
112+
color: var(--google-blue);
114113
margin-left: 2px;
115114
font-weight: bold;
116-
user-select: none; /* Makes it non-selectable */
115+
user-select: none;
117116
}

ai/ai-react-app/src/components/Specific/ChatMessage.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const getMessageText = (message: Content): string => {
4040
const renderTextWithInlineHighlighting = (
4141
text: string,
4242
supports: GroundingSupport[],
43-
chunks: GroundingChunk[], // Pass chunks for tooltips/links
43+
chunks: GroundingChunk[],
4444
): React.ReactNode[] => {
4545
if (!supports || supports.length === 0 || !text) {
4646
return [text];
@@ -50,11 +50,8 @@ const renderTextWithInlineHighlighting = (
5050

5151
supports.forEach((support, supportIndex) => {
5252
if (support.segment && support.groundingChunkIndices) {
53-
// Assuming partIndex is 0 for concatenated text.
54-
// If message.parts can have multiple text parts, this needs adjustment.
5553
const segment = support.segment;
5654
if (segment.partIndex === undefined || segment.partIndex === 0) {
57-
// check if partIndex is specified and is 0 or not specified
5855
segmentsToHighlight.push({
5956
startIndex: segment.startIndex,
6057
endIndex: segment.endIndex, // API's endIndex is typically exclusive
@@ -69,7 +66,7 @@ const renderTextWithInlineHighlighting = (
6966
return [text];
7067
}
7168

72-
// Sort segments by start index, then by end index (longer segments first if they start at same point)
69+
// Sort segments by start index, then by end index
7370
segmentsToHighlight.sort((a, b) => {
7471
if (a.startIndex !== b.startIndex) {
7572
return a.startIndex - b.startIndex;
@@ -100,7 +97,7 @@ const renderTextWithInlineHighlighting = (
10097
<span
10198
key={`seg-${i}`}
10299
className={styles.highlightedSegment}
103-
title={`Sources: ${tooltipText}`} // Tooltip for hover
100+
title={`Sources: ${tooltipText}`}
104101
data-source-indices={seg.chunkIndices.join(",")}
105102
>
106103
{currentSegmentText}
@@ -145,7 +142,6 @@ const ChatMessage: React.FC<ChatMessageProps> = ({
145142
return null;
146143
}
147144

148-
// Determine content to render
149145
let messageContentNodes: React.ReactNode[];
150146
if (
151147
isModel &&

0 commit comments

Comments
 (0)