Skip to content

Build your personal knowledge base with Trilium Notes

client/AI chat: add a "More actions" dropdown button in the sidebar chat header

Adorian Doran744865716d5a
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index 9a7c723be8..c35519613d 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -2097,12 +2097,14 @@
"title": "AI Chat",
"launcher_title": "Open AI Chat",
"new_chat": "Start new chat",
+ "more_actions": "More actions",
"save_chat": "Save chat to notes",
"empty_state": "Start a conversation",
"history": "Chat history",
"recent_chats": "Recent chats",
"no_chats": "No previous chats",
"view_all_chats": "View all chats",
+ "delete": "Delete",
"delete_chat": "Delete chat",
"delete_confirm": "Delete this chat? This can't be undone."
},
diff --git a/apps/client/src/widgets/sidebar/SidebarChat.tsx b/apps/client/src/widgets/sidebar/SidebarChat.tsx
index dd6f49143d..084211ec37 100644
--- a/apps/client/src/widgets/sidebar/SidebarChat.tsx
+++ b/apps/client/src/widgets/sidebar/SidebarChat.tsx
@@ -336,12 +336,29 @@ export default function SidebarChat() {
{t("sidebar_chat.view_all_chats")}
</FormListItem>
</Dropdown>
- <ActionButton
- icon="bx bx-save"
- text={t("sidebar_chat.save_chat")}
- onClick={handleSaveChat}
- disabled={chat.messages.length === 0}
- />
+ <Dropdown
+ text=""
+ buttonClassName="bx bx-dots-vertical-rounded"
+ title={t("sidebar_chat.more_actions")}
+ iconAction
+ hideToggleArrow
+ dropdownOptions={{ popperConfig: { strategy: "fixed" } }}
+ >
+ <FormListItem
+ icon="bx bx-save"
+ onClick={() => void handleSaveChat()}
+ disabled={chat.messages.length === 0}
+ >
+ {t("sidebar_chat.save_chat")}
+ </FormListItem>
+ <FormListItem
+ icon="bx bx-trash"
+ onClick={() => { if (chatNoteId) void handleDeleteChat(chatNoteId); }}
+ disabled={!chatNoteId}
+ >
+ {t("sidebar_chat.delete")}
+ </FormListItem>
+ </Dropdown>
</>
}
>