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 && (