fix(web-chat): normalize chat copy to plain text#1114
fix(web-chat): normalize chat copy to plain text#1114ilblackdragon merged 2 commits intonearai:stagingfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the user experience by standardizing the copy-paste functionality within the web chat interface. It addresses an issue where rich-text formatting could be inadvertently carried over when copying chat messages, leading to inconsistent styling in external applications. By ensuring that only plain text is copied, the change provides a cleaner and more predictable interaction for users, backed by a new E2E test to prevent future regressions. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a fix to normalize copied text from chat messages to plain text, preventing rich-text style leakage into other applications. The implementation adds a copy event listener to the chat messages container, which intercepts the copy action, prevents the default behavior, and sets the clipboard data to plain text only. The logic correctly scopes this functionality to selections within the chat area. A new E2E test is also included, which effectively validates the new behavior by simulating a copy event and asserting that only plain text is added to the (mocked) clipboard. The changes are well-implemented and address the described issue effectively.
zmanian
left a comment
There was a problem hiding this comment.
Clean UX fix with thorough E2E testing. The copy handler is properly defensive (null checks, containment check, collapsed selection guard). The second commit improving test determinism shows good attention to flaky-test prevention. LGTM.
* fix(web-chat): force plain-text clipboard copy from chat messages * test(e2e): make chat copy test target deterministic message
Summary
Issue
Validation