Repository navigation
feat(web-chat): add hover copy button for user/assistant messages - #948
Conversation
ci(staging): stop assuming main branch exists
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 introduces a significant user experience improvement by adding intuitive message-level copy controls to the web chat interface. Users can now easily copy the full content of any user or assistant message, bringing the UI in line with common chat application patterns and enhancing overall usability. Highlights
Changelog
Ignored Files
Activity
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 adds a useful copy button to user and assistant messages, improving the chat UI's usability. The implementation is mostly solid, with good use of CSS for a clean user experience on both desktop and mobile. I've found a couple of potential issues in the JavaScript logic: one is a minor UI bug in the copy button's state handling, and the other is a more significant issue where the copy button could be removed during message streaming. My review includes suggestions to fix both.
zmanian
left a comment
There was a problem hiding this comment.
Looks good -- clean implementation.
XSS: Safe. User content set via textContent. Assistant content goes through DOMPurify. The data-copy-text attribute is only read via getAttribute() and passed to clipboard.writeText(), never injected as HTML.
Accessibility: Solid. aria-label, :focus-visible outline, :focus-within on parent to reveal button on keyboard navigation.
CSS: Clean use of CSS custom properties, appropriate position: relative anchor, good @media (hover: none) fallback for touch devices.
CSP: The new copy button uses addEventListener -- CSP-compliant. (Note: the pre-existing copyCodeBlock in renderMarkdown still uses inline onclick attribute injection on line 673, which is a CSP violation with the current script-src policy that lacks unsafe-inline. Not introduced by this PR, but worth a follow-up.)
UX: Hover-to-reveal with "Copied"/"Failed" feedback is good. The fallback chain (data-copy-text -> data-raw -> textContent) correctly handles both streamed and static messages.
LGTM.
…arai#948) * ci(staging): use default branch instead of hardcoded main * feat(web-chat): add hover copy button for message bubbles * fix(web-chat): address Gemini review for copy state and streaming safety * chore(pr): drop unrelated staging workflow change from nearai#948
…arai#948) * ci(staging): use default branch instead of hardcoded main * feat(web-chat): add hover copy button for message bubbles * fix(web-chat): address Gemini review for copy state and streaming safety * chore(pr): drop unrelated staging workflow change from nearai#948
Summary
Adds OpenClaw-style message-level copy controls to the web chat UI.
Changes
Copybutton onuserandassistantmessage bubbles.Copied/Failed)..message-contentwhile keeping copy controls intact.Before
After
Validation
http://127.0.0.1:3000):.message-copy-btnpresent for rendered conversation bubbles.Copy -> Copied.ironclaw 0.17.0running/loadedTracking
Closes #946