Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improved code block copying #2802

Merged
merged 2 commits into from
Oct 15, 2024
Merged

improved code block copying #2802

merged 2 commits into from
Oct 15, 2024

Conversation

pablonyx
Copy link
Contributor

@pablonyx pablonyx commented Oct 15, 2024

Description

Fixes code block copying

Copy link

vercel bot commented Oct 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 15, 2024 0:50am

@pablonyx pablonyx marked this pull request as ready for review October 15, 2024 00:47
Copy link

@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.

PR Summary

This PR enhances the code block copying functionality in the chat interface, focusing on improved accuracy and reliability when extracting and formatting code from messages.

  • Updated web/src/app/chat/message/Messages.tsx to use the extractCodeText function for more precise code extraction in the markdownComponents object
  • Improved web/src/app/chat/message/codeUtils.ts with a robust method for extracting code text, including handling of language declarations and indentation normalization
  • Enhanced user experience for copying code from chat messages by ensuring more accurate and consistently formatted code extraction

2 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile

web/src/app/chat/message/codeUtils.ts Show resolved Hide resolved
@rkuo-danswer rkuo-danswer added this pull request to the merge queue Oct 15, 2024
Merged via the queue into main with commit 02cc211 Oct 15, 2024
7 checks passed
@pablonyx pablonyx deleted the code_copying branch October 17, 2024 23:14
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