Skip to content

Commit ee66c15

Browse files
committed
some fixes
1 parent 4fffc66 commit ee66c15

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/copilot-modal/copilot-modal.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,19 @@ function ModalCopilotMessage({ message }: CopilotModalMessage) {
6161
return match
6262
})
6363

64+
// Also replace standalone ↗ symbols with clickable citation links
65+
if (citations && citations.length > 0) {
66+
let citationIndex = 0
67+
processedText = processedText.replace(//g, () => {
68+
if (citationIndex < citations.length) {
69+
const citation = citations[citationIndex]
70+
citationIndex++
71+
return `<a href="${citation.url}" target="_blank" rel="noopener noreferrer" class="inline-flex items-center text-primary hover:text-primary/80 text-sm" title="${citation.title}">↗</a>`
72+
}
73+
return '↗'
74+
})
75+
}
76+
6477
return processedText
6578
}
6679

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/copilot.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,20 @@ export const Copilot = forwardRef<CopilotRef, CopilotProps>(
342342
return match
343343
})
344344

345+
// Also replace standalone ↗ symbols with clickable citation links
346+
// This handles cases where the LLM outputs ↗ directly
347+
if (citations && citations.length > 0) {
348+
let citationIndex = 0
349+
processedContent = processedContent.replace(//g, () => {
350+
if (citationIndex < citations.length) {
351+
const citation = citations[citationIndex]
352+
citationIndex++
353+
return `<a href="${citation.url}" target="_blank" rel="noopener noreferrer" class="inline-flex items-center text-primary hover:text-primary/80 transition-colors text-sm" title="${citation.title}">↗</a>`
354+
}
355+
return '↗'
356+
})
357+
}
358+
345359
// Basic markdown processing for better formatting
346360
processedContent = processedContent
347361
// Handle code blocks

0 commit comments

Comments
 (0)