Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • fix code viewer in copilot user inp

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Dec 4, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Dec 4, 2025 8:50pm

@waleedlatif1 waleedlatif1 merged commit e581608 into staging Dec 4, 2025
5 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/copilot-user-inp branch December 4, 2025 20:50
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 4, 2025

Greptile Overview

Greptile Summary

Fixed spacing issue in copilot code viewer by removing bottom padding from the <pre> element within Code.Viewer component.

  • Added Tailwind arbitrary variant [&_pre]:!pb-0 to the className prop on line 280
  • Uses descendant selector with important flag to override the p-2 padding class applied by Code.Viewer
  • Resolves visual spacing problem in code blocks displayed in copilot messages

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is a minimal CSS adjustment that only affects visual spacing in code blocks within copilot messages. It uses a properly scoped Tailwind arbitrary variant with the important flag to override inherited padding. The change is isolated, non-breaking, and follows Tailwind best practices for targeted styling overrides.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/copilot-message/components/markdown-renderer.tsx 5/5 Adds Tailwind arbitrary variant to remove bottom padding from code viewer's pre element, fixing layout spacing in copilot code blocks

Sequence Diagram

sequenceDiagram
    participant User
    participant CopilotMarkdownRenderer
    participant ReactMarkdown
    participant CodeViewer
    participant Browser

    User->>CopilotMarkdownRenderer: Display copilot message with code
    CopilotMarkdownRenderer->>ReactMarkdown: Render markdown content
    ReactMarkdown->>ReactMarkdown: Parse code blocks (pre component)
    ReactMarkdown->>CodeViewer: Render with Code.Viewer component
    Note over CodeViewer: className includes [&_pre]:!pb-0
    CodeViewer->>Browser: Apply Tailwind classes
    Browser->>Browser: Apply p-2 to pre element
    Browser->>Browser: Override with !pb-0 (removes bottom padding)
    Browser->>User: Display code block with corrected spacing
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants