Make conversations optionally shareable (#712)

* Make conversations optionally shareable

- Shared conversations are viewable by anyone, without a login wall
- Can share a conversation from the three dot menu
- Add a new model for Public Conversation
- The rationale for a separate model is that public and private conversations have different assumptions. Separating them reduces some of the code specificity on our server-side code and allows us for easier interpretation and stricter security. Separating the data model makes it harder to accidentally view something that was meant to be private
- Add a new, read-only view for public conversations
This commit is contained in:
sabaimran
2024-05-05 10:46:04 -07:00
committed by GitHub
parent 88daa841fd
commit 14c9bea663
13 changed files with 2337 additions and 94 deletions

View File

@@ -1075,11 +1075,12 @@
threeDotMenu.appendChild(conversationMenu);
let deleteButton = document.createElement('button');
deleteButton.type = "button";
deleteButton.innerHTML = "Delete";
deleteButton.classList.add("delete-conversation-button");
deleteButton.classList.add("three-dot-menu-button-item");
deleteButton.addEventListener('click', function() {
// Ask for confirmation before deleting chat session
deleteButton.addEventListener('click', function(event) {
event.preventDefault();
let confirmation = confirm('Are you sure you want to delete this chat session?');
if (!confirmation) return;
let deleteURL = `/api/chat/history?client=web&conversation_id=${incomingConversationId}`;
@@ -1927,6 +1928,7 @@
text-align: left;
display: flex;
position: relative;
margin: 0 8px;
}
.three-dot-menu {