Skip to content

Commit b192033

Browse files
committed
Rename AI Assistant to match the OpenOps edition
1 parent e3c6c1b commit b192033

7 files changed

Lines changed: 30 additions & 6 deletions

File tree

packages/react-ui/public/locales/en/translation.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
"Refresh Page": "Refresh Page",
1717
"Contact Support": "Contact Support",
1818
"AI Assistant": "AI Assistant",
19+
"OpenOps Assistant": "OpenOps Assistant",
20+
"OpenOps Agent": "OpenOps Agent",
1921
"Enable AI": "Enable AI",
2022
"Save": "Save",
2123
"Valid Connection": "Valid Connection",

packages/react-ui/src/app/features/ai/ai-assistant-button.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { useAssistantName } from '@/app/features/ai/lib/use-assistant-name';
12
import { useAppStore } from '@/app/store/app-store';
23
import { Button, cn, TooltipWrapper } from '@openops/components/ui';
3-
import { t } from 'i18next';
44
import { Bot } from 'lucide-react';
55
import { useCallback } from 'react';
66

@@ -10,12 +10,14 @@ const AiAssistantButton = ({ className }: { className?: string }) => {
1010
setIsAiChatOpened: s.setIsAiChatOpened,
1111
}));
1212

13+
const assistantName = useAssistantName();
14+
1315
const onToggleAiChat = useCallback(() => {
1416
setIsAiChatOpened(!isAiChatOpened);
1517
}, [isAiChatOpened, setIsAiChatOpened]);
1618

1719
return (
18-
<TooltipWrapper tooltipText={t('AI Assistant')} tooltipPlacement="right">
20+
<TooltipWrapper tooltipText={assistantName} tooltipPlacement="right">
1921
<Button
2022
variant="ai"
2123
className={cn('size-9 p-0 gap-2', className, {

packages/react-ui/src/app/features/ai/ai-configuration-prompt.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { aiSettingsHooks } from '@/app/features/ai/lib/ai-settings-hooks';
2+
import { useAssistantName } from '@/app/features/ai/lib/use-assistant-name';
23
import { useAppStore } from '@/app/store/app-store';
34
import { cn, NoAiEnabledPopover } from '@openops/components/ui';
45

@@ -15,12 +16,15 @@ const AiConfigurationPrompt = ({ className }: AiConfigurationPromptProps) => {
1516
setIsAiChatOpened: s.setIsAiChatOpened,
1617
}));
1718

19+
const assistantName = useAssistantName();
20+
1821
if (isLoading || hasActiveAiSettings || !isAiChatOpened) return null;
1922

2023
return (
2124
<NoAiEnabledPopover
2225
className={cn('absolute left-4 bottom-[17px] z-50', className)}
2326
onCloseClick={() => setIsAiChatOpened(false)}
27+
title={assistantName}
2428
/>
2529
);
2630
};

packages/react-ui/src/app/features/ai/assistant/ai-chat-resizable-panel.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { useResizablePanelGroup } from '@/app/common/hooks/use-resizable-panel-g
22
import { RESIZABLE_PANEL_IDS } from '@/app/constants/layout';
33
import AssistantUiChat from '@/app/features/ai/assistant/assistant-ui-chat';
44
import { aiSettingsHooks } from '@/app/features/ai/lib/ai-settings-hooks';
5+
import { useAssistantName } from '@/app/features/ai/lib/use-assistant-name';
56
import { useAppStore } from '@/app/store/app-store';
67
import { cn, ResizableHandle, ResizablePanel } from '@openops/components/ui';
7-
import { t } from 'i18next';
88
import { useCallback, useEffect, useMemo, useRef } from 'react';
99
import { ImperativePanelHandle } from 'react-resizable-panels';
1010

@@ -21,6 +21,8 @@ const AiChatResizablePanel = ({ onDragging }: AiChatResizablePanelProps) => {
2121
const { hasActiveAiSettings, isLoading } =
2222
aiSettingsHooks.useHasActiveAiSettings();
2323

24+
const assistantName = useAssistantName();
25+
2426
const resizablePanelRef = useRef<ImperativePanelHandle | null>(null);
2527

2628
const { getPanelSize } = useResizablePanelGroup();
@@ -71,7 +73,7 @@ const AiChatResizablePanel = ({ onDragging }: AiChatResizablePanelProps) => {
7173
>
7274
<div className="w-full h-full flex bg-secondary overflow-hidden border-r">
7375
<AssistantUiChat
74-
title={t('AI Assistant')}
76+
title={assistantName}
7577
onClose={() => setIsAiChatOpened(false)}
7678
/>
7779
</div>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { flagsHooks } from '@/app/common/hooks/flags-hooks';
2+
import { FlagId, OpsEdition } from '@openops/shared';
3+
import { t } from 'i18next';
4+
5+
export const useAssistantName = () => {
6+
const edition = flagsHooks.useFlag<OpsEdition>(FlagId.EDITION).data;
7+
return edition === OpsEdition.COMMUNITY
8+
? t('OpenOps Assistant')
9+
: t('OpenOps Agent');
10+
};

packages/ui-components/src/components/ai-chat-container/no-ai-enabled-popover.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,22 @@ import { TooltipWrapper } from '../tooltip-wrapper';
88
const NoAiEnabledPopover = ({
99
className,
1010
onCloseClick,
11+
title,
1112
}: {
1213
className?: string;
1314
onCloseClick: () => void;
15+
title?: string;
1416
}) => {
17+
const displayTitle = title || t('OpenOps Assistant');
18+
1519
return (
1620
<div className={cn('bg-background shadow-editor rounded-lg', className)}>
1721
<div className="h-[58px] pl-4 pr-2 py-[10px] rounded-t-xl flex items-center justify-between bg-white dark:bg-black dark:text-white border-b">
1822
<div className="flex justify-center items-center gap-3">
1923
<div className="size-8 flex justify-center items-center bg-background bg-gradient-to-b from-ring/40 to-primary-200/40 rounded-xl">
2024
<Bot size={20} />
2125
</div>
22-
<h2 className="font-bold text-base">{t('AI Assistant')}</h2>
26+
<h2 className="font-bold text-base">{displayTitle}</h2>
2327
</div>
2428
<TooltipWrapper tooltipText={t('Close')}>
2529
<Button

packages/ui-components/src/components/assistant-ui/assistant-top-bar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type AssistantTopBarProps = {
1818
chatId?: string | null;
1919
};
2020

21-
const AI_ASSISTANT_DEFAULT_TITLE = 'AI Assistant';
21+
const AI_ASSISTANT_DEFAULT_TITLE = t('OpenOps Assistant');
2222

2323
const AssistantTopBar = ({
2424
onNewChat,

0 commit comments

Comments
 (0)