From b58d8773c90dc34b22ae3e0999e2e1cec2b1a727 Mon Sep 17 00:00:00 2001 From: Siddharth Ganesan Date: Tue, 8 Jul 2025 16:51:36 -0700 Subject: [PATCH] Spacing --- .../copilot-modal/copilot-modal.tsx | 7 ++-- .../panel/components/copilot/copilot.tsx | 40 +++++++++---------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/copilot-modal/copilot-modal.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/copilot-modal/copilot-modal.tsx index 84193d7a38..fa83fac679 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/copilot-modal/copilot-modal.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/copilot-modal/copilot-modal.tsx @@ -80,7 +80,8 @@ function ModalCopilotMessage({ message }: CopilotModalMessage) { // Handle lists processedText = processedText.replace(/^- (.*$)/gm, '
  • • $1
  • ') - // Handle line breaks + // Handle line breaks (reduce spacing) + processedText = processedText.replace(/\n\n+/g, '

    ') processedText = processedText.replace(/\n/g, '
    ') return processedText @@ -109,8 +110,8 @@ function ModalCopilotMessage({ message }: CopilotModalMessage) {

    -
    diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/copilot.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/copilot.tsx index 69a0e215f0..8fbd85fc62 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/copilot.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/copilot.tsx @@ -259,19 +259,19 @@ export const Copilot = forwardRef( // Handle unordered lists .replace(/^\* (.*$)/gm, '
  • • $1
  • ') .replace(/^- (.*$)/gm, '
  • • $1
  • ') - // Handle line breaks - .replace(/\n\n/g, '

    ') - .replace(/\n/g, '
    ') + // Handle line breaks (reduce spacing) + .replace(/\n\n+/g, '

    ') + .replace(/\n/g, '
    ') - // Wrap in paragraph tags if not already wrapped - if ( - !processedContent.includes('

    ') && - !processedContent.includes('

    ') && - !processedContent.includes('

    ') && - !processedContent.includes('

    ') - ) { - processedContent = `

    ${processedContent}

    ` - } + // Wrap in paragraph tags if not already wrapped + if ( + !processedContent.includes('

    ') && + !processedContent.includes('

    ') && + !processedContent.includes('

    ') && + !processedContent.includes('

    ') + ) { + processedContent = `

    ${processedContent}

    ` + } return processedContent } @@ -329,14 +329,14 @@ export const Copilot = forwardRef(

    {/* Enhanced content rendering with inline citations */} -
    -
    -
    +
    +
    +
    {/* Streaming cursor */} {message.isStreaming && message.content && (