Skip to content

Included button to copy chat history item#789

Merged
glahaye merged 1 commit intomicrosoft:mainfrom
marcelojsilva:feature_copychathistoryitembutton
Feb 7, 2024
Merged

Included button to copy chat history item#789
glahaye merged 1 commit intomicrosoft:mainfrom
marcelojsilva:feature_copychathistoryitembutton

Conversation

@marcelojsilva
Copy link
Contributor

Motivation and Context

  1. Why is this change required?
    UX
  2. What problem does it solve?
    Improve user experience when need copy chat history item

Description

 If the current message is from a bot and if the message has a prompt, it renders a Tooltip component with a Button inside it.
 The Tooltip component is used to display a small pop-up box when the user hovers over an element. The content of the Tooltip changes based on the state of messagedCopied. If messagedCopied is true, the Tooltip displays 'Copied', otherwise, it displays 'Copy text'.
 Inside the Tooltip, there is a Button component. The icon of the Button changes based on the messagedCopied state. If messagedCopied is true, it shows a ClipboardTask20Regular icon, otherwise, it shows a Clipboard20Regular icon.
 The Button has an onClick event handler that triggers the copyOnClick function when the button is clicked.

Contribution Checklist

copy_button

@github-actions github-actions bot added the webapp Pull requests that update Typescript code label Feb 6, 2024
@glahaye
Copy link
Contributor

glahaye commented Feb 6, 2024

@marcelojsilva As soon as you agree to the contributor license agreement, we'll be able to take in your change.

Thank you for your contribution.

@marcelojsilva
Copy link
Contributor Author

marcelojsilva commented Feb 7, 2024 via email

@glahaye glahaye merged commit 9b7b8dc into microsoft:main Feb 7, 2024
teamleader-dev pushed a commit to vlink-group/chat-copilot that referenced this pull request Oct 7, 2024
### Motivation and Context

  1. Why is this change required?
      UX
  2. What problem does it solve?
      Improve user experience when need copy chat history item

### Description

If the current message is from a bot and if the message has a prompt, it
renders a Tooltip component with a Button inside it.
The Tooltip component is used to display a small pop-up box when the
user hovers over an element. The content of the Tooltip changes based on
the state of messagedCopied. If messagedCopied is true, the Tooltip
displays 'Copied', otherwise, it displays 'Copy text'.
Inside the Tooltip, there is a Button component. The icon of the Button
changes based on the messagedCopied state. If messagedCopied is true, it
shows a ClipboardTask20Regular icon, otherwise, it shows a
Clipboard20Regular icon.
The Button has an onClick event handler that triggers the copyOnClick
function when the button is clicked.

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ x ] The code builds clean without any errors or warnings
- [ x ] The PR follows the [Contribution
Guidelines](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [ x ] All unit tests pass, and I have added new tests where possible
- [ x ] I didn't break anyone 😄


![copy_button](https://github.com/microsoft/chat-copilot/assets/6529846/98f64934-1a64-475e-9727-daf397c97004)

Co-authored-by: Marcelo Jose <msilva@veloe.com.br>
kb0039 pushed a commit to aaronba/chat-copilot that referenced this pull request Jan 8, 2025
### Motivation and Context

  1. Why is this change required?
      UX
  2. What problem does it solve?
      Improve user experience when need copy chat history item

### Description

If the current message is from a bot and if the message has a prompt, it
renders a Tooltip component with a Button inside it.
The Tooltip component is used to display a small pop-up box when the
user hovers over an element. The content of the Tooltip changes based on
the state of messagedCopied. If messagedCopied is true, the Tooltip
displays 'Copied', otherwise, it displays 'Copy text'.
Inside the Tooltip, there is a Button component. The icon of the Button
changes based on the messagedCopied state. If messagedCopied is true, it
shows a ClipboardTask20Regular icon, otherwise, it shows a
Clipboard20Regular icon.
The Button has an onClick event handler that triggers the copyOnClick
function when the button is clicked.

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ x ] The code builds clean without any errors or warnings
- [ x ] The PR follows the [Contribution
Guidelines](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [ x ] All unit tests pass, and I have added new tests where possible
- [ x ] I didn't break anyone 😄


![copy_button](https://github.com/microsoft/chat-copilot/assets/6529846/98f64934-1a64-475e-9727-daf397c97004)

Co-authored-by: Marcelo Jose <msilva@veloe.com.br>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

webapp Pull requests that update Typescript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants