From c75488f7e0f490cadb183a8e904420fc7e053dfc Mon Sep 17 00:00:00 2001 From: Pete Miller Date: Mon, 21 Oct 2024 18:47:00 -0700 Subject: [PATCH] close button --- components/ai_chat/core/browser/constants.cc | 1 + .../page/components/header/index.tsx | 23 +++++++++++-------- components/resources/ai_chat_ui_strings.grdp | 3 +++ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/components/ai_chat/core/browser/constants.cc b/components/ai_chat/core/browser/constants.cc index 1cbfc5998f06..7870033ac543 100644 --- a/components/ai_chat/core/browser/constants.cc +++ b/components/ai_chat/core/browser/constants.cc @@ -42,6 +42,7 @@ base::span GetLocalizedStrings() { {"modelCategory-chat", IDS_CHAT_UI_MODEL_CATEGORY_CHAT}, {"menuNewChat", IDS_CHAT_UI_MENU_NEW_CHAT}, {"openFullPageLabel", IDS_CHAT_UI_LABEL_OPEN_FULL_PAGE}, + {"closeLabel", IDS_CHAT_UI_LABEL_CLOSE}, {"menuGoPremium", IDS_CHAT_UI_MENU_GO_PREMIUM}, {"menuManageSubscription", IDS_CHAT_UI_MENU_MANAGE_SUBSCRIPTION}, {"menuSettings", IDS_CHAT_UI_MENU_SETTINGS}, diff --git a/components/ai_chat/resources/page/components/header/index.tsx b/components/ai_chat/resources/page/components/header/index.tsx index 96becc96fde3..290866ef7c1a 100644 --- a/components/ai_chat/resources/page/components/header/index.tsx +++ b/components/ai_chat/resources/page/components/header/index.tsx @@ -28,6 +28,7 @@ const getTitle = (activeConversation?: Conversation) => activeConversation?.titl const newChatButtonLabel = getLocale('newChatButtonLabel') +const closeButtonLabel = getLocale('closeLabel') const openFullPageButtonLabel = getLocale('openFullPageLabel') export const PageTitleHeader = React.forwardRef(function (props: FeatureButtonMenuProps, ref: React.Ref) { @@ -86,16 +87,18 @@ export const PageTitleHeader = React.forwardRef(function (props: FeatureButtonMe } - + { !aiChatContext.isStandalone && + + } )} diff --git a/components/resources/ai_chat_ui_strings.grdp b/components/resources/ai_chat_ui_strings.grdp index ad2b86010be5..0b54a241cdd9 100644 --- a/components/resources/ai_chat_ui_strings.grdp +++ b/components/resources/ai_chat_ui_strings.grdp @@ -75,6 +75,9 @@ Open full page + + Close + New chat