Skip to content

fix: improve copy button UX in AI assistant responses#358

Merged
dobrinyonkov merged 1 commit into
masterfrom
ai-assistant-copy-button
Jul 2, 2026
Merged

fix: improve copy button UX in AI assistant responses#358
dobrinyonkov merged 1 commit into
masterfrom
ai-assistant-copy-button

Conversation

@NakataCode

Copy link
Copy Markdown
Contributor

Description

  • Move the response-level copy button to the bottom of the message instead of the header
  • Hide the response copy button when the response contains only a single code or JSON block (redundant with the block's own copy button)
  • Unify copy button styling across response and block buttons (ghost/bordered style)

@dobrinyonkov
dobrinyonkov self-requested a review July 2, 2026 08:12
@dobrinyonkov
dobrinyonkov merged commit e6f9e4b into master Jul 2, 2026
2 checks passed
@dobrinyonkov
dobrinyonkov deleted the ai-assistant-copy-button branch July 2, 2026 08:13
dobrinyonkov added a commit that referenced this pull request Jul 2, 2026
Two incoming commits from master:
  0fbafcb feat(elements-registry): highlight control on row hover (#359) — clean auto-merge
  e6f9e4b fix: improve copy button UX in AI assistant responses (#358) — resolved manually

The AIChat.js and AIChat.spec.js conflicts were resolved by taking HEAD, since
those files were substantially restructured by this refactor branch: the
message rendering, streaming, and copy-button logic now live in
AssistantTranscript, driven by AssistantController.

The two behaviour deltas from PR #358 were then ported into AssistantTranscript:
  - Attach the copy-response button to the message element (not the header),
    matching the new AIChat.less layout (display: block on its own line).
  - Skip the copy-response button when the assistant message is a single code
    or JSON block, since those blocks already carry their own copy affordance.
    New helper: _isOnlyCodeOrJsonBlock.

grunt test: 582 passing, lint clean.
dobrinyonkov added a commit that referenced this pull request Jul 2, 2026
Two incoming commits from master:
  0fbafcb feat(elements-registry): highlight control on row hover (#359) — clean auto-merge
  e6f9e4b fix: improve copy button UX in AI assistant responses (#358) — resolved manually

The AIChat.js and AIChat.spec.js conflicts were resolved by taking HEAD, since
those files were substantially restructured by this refactor branch: the
message rendering, streaming, and copy-button logic now live in
AssistantTranscript, driven by AssistantController.

The two behaviour deltas from PR #358 were then ported into AssistantTranscript:
  - Attach the copy-response button to the message element (not the header),
    matching the new AIChat.less layout (display: block on its own line).
  - Skip the copy-response button when the assistant message is a single code
    or JSON block, since those blocks already carry their own copy affordance.
    New helper: _isOnlyCodeOrJsonBlock.

grunt test: 487 passing, lint clean.
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.10.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants