Skip to content

Conversation

@Cristhianzl
Copy link
Member

@Cristhianzl Cristhianzl commented Sep 17, 2025

This pull request focuses on improving the code rendering and markdown display experience in the frontend, particularly in chat and markdown components. The main changes include a significant redesign of the CodeComponent to add expand/collapse functionality, enhanced styling, and performance optimizations. Additionally, the MarkdownRenderer was updated to provide more consistent and visually appealing markdown formatting, and minor code cleanups were performed in the chat page.

Code Rendering and UI Improvements:

  • The CodeComponent was refactored to support expandable/collapsible code blocks, improved header with language and line count badges, and better styling for code previews. The component is now memoized for performance. (frontend/components/code-component.tsx) [1] [2]
  • The MarkdownRenderer now uses a memoized set of custom components for markdown elements, providing consistent styling for paragraphs, lists, headers, tables, blockquotes, and inline code. Code blocks are rendered using the updated CodeComponent. (frontend/components/markdown-renderer.tsx) [1] [2] [3]

Styling and Consistency:

  • Enhanced the visual appearance of markdown-rendered content, including chat-optimized prose classes, improved spacing, and color usage for various markdown elements. (frontend/components/markdown-renderer.tsx)

Code Cleanup and Minor Fixes:

  • Cleaned up import statements and improved code formatting in the chat page for readability and maintainability. (frontend/src/app/chat/page.tsx) [1] [2]
  • Minor changes to logging and event handler registration for better consistency and clarity in the chat page. (frontend/src/app/chat/page.tsx) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
image image

…onent expansion

♻️ (frontend): Refactor CodeComponent to use memoization for line count, collapse logic, and preview code
📝 (frontend): Update MarkdownRenderer to use memoized components for improved performance and readability
@Cristhianzl Cristhianzl requested a review from phact September 17, 2025 17:17
@Cristhianzl Cristhianzl self-assigned this Sep 17, 2025
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.

3 participants