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

Delete Chat #193

Merged
merged 19 commits into from
Aug 22, 2023
Merged

Delete Chat #193

merged 19 commits into from
Aug 22, 2023

Conversation

teresaqhoang
Copy link
Contributor

Motivation and Context

This PR enables chat deletion. For V1, any user is able to delete any chat they're a part of. This will delete the chat for all participants, including Chat Copilot, as well as all related resources (memories, messages, etc.).

Description

When a chat is deleted,

  • It will be immediately removed for the user who initiated the deletion.
Screenshot 2023-08-16 at 5 54 46 PM
  • If the chat was a multi-user chat, the chat will be disabled in current session. This allows other participants to save any resources before the chat is wiped out. On refresh, chat is removed from list.
Screenshot 2023-08-16 at 5 54 35 PM Screenshot 2023-08-16 at 5 54 58 PM
  • If the chat was the last chat in the user's current session, a new chat will automatically be created to populate the chat list.

Contribution Checklist

@github-actions github-actions bot added webapp Pull requests that update Typescript code webapi Pull requests that update .net code PR: ready for review labels Aug 16, 2023
@teresaqhoang teresaqhoang requested a review from a team August 16, 2023 21:58
@teresaqhoang teresaqhoang self-assigned this Aug 16, 2023
@teresaqhoang teresaqhoang added the enhancement New feature or request label Aug 16, 2023
webapi/Controllers/ChatHistoryController.cs Outdated Show resolved Hide resolved
webapi/Controllers/ChatHistoryController.cs Outdated Show resolved Hide resolved
webapi/Controllers/ChatHistoryController.cs Show resolved Hide resolved
webapi/Models/Request/DeleteChatRequest.cs Outdated Show resolved Hide resolved
webapi/Controllers/ChatHistoryController.cs Outdated Show resolved Hide resolved
webapi/Controllers/ChatHistoryController.cs Outdated Show resolved Hide resolved
webapp/src/assets/strings.ts Outdated Show resolved Hide resolved
webapp/src/libs/hooks/useChat.ts Show resolved Hide resolved
webapi/Controllers/ChatHistoryController.cs Outdated Show resolved Hide resolved
webapi/Controllers/ChatHistoryController.cs Outdated Show resolved Hide resolved
webapi/Controllers/ChatHistoryController.cs Outdated Show resolved Hide resolved
glahaye
glahaye previously approved these changes Aug 21, 2023
@teresaqhoang teresaqhoang dismissed alliscode’s stale review August 22, 2023 21:24

Discussed offline and got sign-off after I addressed his last comments. Ben's oof now for the week, don't want to block

@teresaqhoang teresaqhoang added this pull request to the merge queue Aug 22, 2023
Merged via the queue into microsoft:main with commit c0012fa Aug 22, 2023
8 checks passed
@teresaqhoang teresaqhoang deleted the delete-chat branch August 22, 2023 21:24
teamleader-dev pushed a commit to vlink-group/chat-copilot that referenced this pull request Oct 7, 2024
### Motivation and Context

<!-- Thank you for your contribution to the copilot-chat repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
This PR enables chat deletion. For V1, any user is able to delete any
chat they're a part of. This will delete the chat for all participants,
including Chat Copilot, as well as all related resources (memories,
messages, etc.).

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

When a chat is deleted,
- It will be immediately removed for the user who initiated the
deletion.
<img width="1234" alt="Screenshot 2023-08-16 at 5 54 46 PM"
src="https://github.com/microsoft/chat-copilot/assets/125500434/7fb8a2e7-c70f-44e2-9e35-91bbe9e3f810">

- If the chat was a multi-user chat, the chat will be disabled in
current session. This allows other participants to save any resources
before the chat is wiped out. On refresh, chat is removed from list.
<img width="1680" alt="Screenshot 2023-08-16 at 5 54 35 PM"
src="https://github.com/microsoft/chat-copilot/assets/125500434/5ac2c7d3-f11a-4575-8d8a-5fe2bdb5aba7">
<img width="429" alt="Screenshot 2023-08-16 at 5 54 58 PM"
src="https://github.com/microsoft/chat-copilot/assets/125500434/f1bedd1a-7801-406a-8263-2965f67e5a39">

- If the chat was the last chat in the user's current session, a new
chat will automatically be created to populate the chat list.

### 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/copilot-chat/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/copilot-chat/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
~~- [ ] All unit tests pass, and I have added new tests where possible~~
- [x] I didn't break anyone 😄
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request webapi Pull requests that update .net code webapp Pull requests that update Typescript code
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

6 participants