feat: Improve markdown and code block display components #41
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
CodeComponentto add expand/collapse functionality, enhanced styling, and performance optimizations. Additionally, theMarkdownRendererwas 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:
CodeComponentwas 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]MarkdownRenderernow 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 updatedCodeComponent. (frontend/components/markdown-renderer.tsx) [1] [2] [3]Styling and Consistency:
frontend/components/markdown-renderer.tsx)Code Cleanup and Minor Fixes:
frontend/src/app/chat/page.tsx) [1] [2]frontend/src/app/chat/page.tsx) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]