Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

Remove deprecated AI chat components to streamline codebase

Salman-Ahamed70705353404a
diff --git a/packages/app/src/react/features/ai-chat/components/chat.tsx b/packages/app/src/react/features/ai-chat/components/chat/chat.tsx
similarity index 91%
rename from packages/app/src/react/features/ai-chat/components/chat.tsx
rename to packages/app/src/react/features/ai-chat/components/chat/chat.tsx
index ce2ba5d0..0690c0f9 100644
--- a/packages/app/src/react/features/ai-chat/components/chat.tsx
+++ b/packages/app/src/react/features/ai-chat/components/chat/chat.tsx
@@ -8,9 +8,9 @@ import {
UserMessage,
} from '@react/features/ai-chat/components';
-import { MESSAGE_TYPES } from '../constants';
-import '../styles/index.css';
-import { IMessage } from '../types/chat';
+import { MESSAGE_TYPES } from '../../constants';
+import '../../styles/index.css';
+import { IMessage } from '../../types/chat';
interface IChatProps extends IMessage {
avatar: string;
diff --git a/packages/app/src/react/features/ai-chat/components/chats-with-group.tsx b/packages/app/src/react/features/ai-chat/components/chat/chats-with-group.tsx
similarity index 100%
rename from packages/app/src/react/features/ai-chat/components/chats-with-group.tsx
rename to packages/app/src/react/features/ai-chat/components/chat/chats-with-group.tsx
diff --git a/packages/app/src/react/features/ai-chat/components/chats.tsx b/packages/app/src/react/features/ai-chat/components/chat/chats.tsx
similarity index 100%
rename from packages/app/src/react/features/ai-chat/components/chats.tsx
rename to packages/app/src/react/features/ai-chat/components/chat/chats.tsx
diff --git a/packages/app/src/react/features/ai-chat/components/code-block.tsx b/packages/app/src/react/features/ai-chat/components/chat/code-block.tsx
similarity index 100%
rename from packages/app/src/react/features/ai-chat/components/code-block.tsx
rename to packages/app/src/react/features/ai-chat/components/chat/code-block.tsx
diff --git a/packages/app/src/react/features/ai-chat/components/error-message.tsx b/packages/app/src/react/features/ai-chat/components/chat/error-message.tsx
similarity index 100%
rename from packages/app/src/react/features/ai-chat/components/error-message.tsx
rename to packages/app/src/react/features/ai-chat/components/chat/error-message.tsx
diff --git a/packages/app/src/react/features/ai-chat/components/chat/index.ts b/packages/app/src/react/features/ai-chat/components/chat/index.ts
new file mode 100644
index 00000000..d7344179
--- /dev/null
+++ b/packages/app/src/react/features/ai-chat/components/chat/index.ts
@@ -0,0 +1,11 @@
+export * from './chat';
+export * from './chats';
+export * from './chats-with-group';
+export * from './code-block';
+export * from './error-message';
+export * from './markdown-renderer';
+export * from './reply-loader';
+export * from './system-message';
+export * from './thinking-message';
+export * from './typewriter';
+export * from './user-message';
diff --git a/packages/app/src/react/features/ai-chat/components/markdown-renderer.tsx b/packages/app/src/react/features/ai-chat/components/chat/markdown-renderer.tsx
similarity index 100%
rename from packages/app/src/react/features/ai-chat/components/markdown-renderer.tsx
rename to packages/app/src/react/features/ai-chat/components/chat/markdown-renderer.tsx
diff --git a/packages/app/src/react/features/ai-chat/components/reply-loader.tsx b/packages/app/src/react/features/ai-chat/components/chat/reply-loader.tsx
similarity index 100%
rename from packages/app/src/react/features/ai-chat/components/reply-loader.tsx
rename to packages/app/src/react/features/ai-chat/components/chat/reply-loader.tsx
diff --git a/packages/app/src/react/features/ai-chat/components/system-message.tsx b/packages/app/src/react/features/ai-chat/components/chat/system-message.tsx
similarity index 100%
rename from packages/app/src/react/features/ai-chat/components/system-message.tsx
rename to packages/app/src/react/features/ai-chat/components/chat/system-message.tsx
diff --git a/packages/app/src/react/features/ai-chat/components/thinking-message.tsx b/packages/app/src/react/features/ai-chat/components/chat/thinking-message.tsx
similarity index 98%
rename from packages/app/src/react/features/ai-chat/components/thinking-message.tsx
rename to packages/app/src/react/features/ai-chat/components/chat/thinking-message.tsx
index 2ded7ec1..86439391 100644
--- a/packages/app/src/react/features/ai-chat/components/thinking-message.tsx
+++ b/packages/app/src/react/features/ai-chat/components/chat/thinking-message.tsx
@@ -3,7 +3,7 @@ import {
formatStatusMessage,
} from '@react/features/ai-chat/utils/stream.utils';
import { FC, useEffect, useRef, useState } from 'react';
-import { IMetaMessages } from '../types/chat';
+import { IMetaMessages } from '../../types/chat';
interface IProps {
data: {
diff --git a/packages/app/src/react/features/ai-chat/components/typewriter.tsx b/packages/app/src/react/features/ai-chat/components/chat/typewriter.tsx
similarity index 100%
rename from packages/app/src/react/features/ai-chat/components/typewriter.tsx
rename to packages/app/src/react/features/ai-chat/components/chat/typewriter.tsx
diff --git a/packages/app/src/react/features/ai-chat/components/user-message.tsx b/packages/app/src/react/features/ai-chat/components/chat/user-message.tsx
similarity index 91%
rename from packages/app/src/react/features/ai-chat/components/user-message.tsx
rename to packages/app/src/react/features/ai-chat/components/chat/user-message.tsx
index a2b77432..c30b40ef 100644
--- a/packages/app/src/react/features/ai-chat/components/user-message.tsx
+++ b/packages/app/src/react/features/ai-chat/components/chat/user-message.tsx
@@ -1,6 +1,6 @@
import { FC } from 'react';
-import { IAttachment } from '../types/chat';
-import { FileItemPreview } from './FileItemPreview';
+import { IAttachment } from '../../types/chat';
+import { FileItemPreview } from '../common/FileItemPreview';
/**
* User Message Component Properties
diff --git a/packages/app/src/react/features/ai-chat/components/FileItemPreview.tsx b/packages/app/src/react/features/ai-chat/components/common/FileItemPreview.tsx
similarity index 99%
rename from packages/app/src/react/features/ai-chat/components/FileItemPreview.tsx
rename to packages/app/src/react/features/ai-chat/components/common/FileItemPreview.tsx
index d305d3c4..4215c2c2 100644
--- a/packages/app/src/react/features/ai-chat/components/FileItemPreview.tsx
+++ b/packages/app/src/react/features/ai-chat/components/common/FileItemPreview.tsx
@@ -9,7 +9,7 @@ import {
FaRegFileWord,
FaXmark,
} from 'react-icons/fa6';
-import type { IAttachment } from '../types/chat';
+import type { IAttachment } from '../../types/chat';
/** Map of file extensions to their corresponding icons */
const FILE_ICONS: Record<string, ReactElement> = {
diff --git a/packages/app/src/react/features/ai-chat/components/file-item-preview.tsx b/packages/app/src/react/features/ai-chat/components/common/file-item-preview.tsx
similarity index 96%
rename from packages/app/src/react/features/ai-chat/components/file-item-preview.tsx
rename to packages/app/src/react/features/ai-chat/components/common/file-item-preview.tsx
index 509daec0..f6352478 100644
--- a/packages/app/src/react/features/ai-chat/components/file-item-preview.tsx
+++ b/packages/app/src/react/features/ai-chat/components/common/file-item-preview.tsx
@@ -1,5 +1,5 @@
-import { CloseIcon } from '@react/features/ai-chat/components/icons';
import { IMessageFile } from '@react/features/ai-chat/types/chat.types';
+import { CloseIcon } from '@src/react/features/ai-chat/components/common/icons';
import classNames from 'classnames';
import { FC, useEffect, useMemo, useState } from 'react';
import {
@@ -53,7 +53,7 @@ const RemoveButton: FC<{ onRemove: () => void }> = ({ onRemove }) => (
</button>
);
-export const FileItemPreview: FC<FileItemPreviewProps> = ({
+export const FileItemPreviews: FC<FileItemPreviewProps> = ({
file,
onRemove,
isUploading,
diff --git a/packages/app/src/react/features/ai-chat/components/icons.tsx b/packages/app/src/react/features/ai-chat/components/common/icons.tsx
similarity index 100%
rename from packages/app/src/react/features/ai-chat/components/icons.tsx
rename to packages/app/src/react/features/ai-chat/components/common/icons.tsx
diff --git a/packages/app/src/react/features/ai-chat/components/common/index.ts b/packages/app/src/react/features/ai-chat/components/common/index.ts
new file mode 100644
index 00000000..598aaf83
--- /dev/null
+++ b/packages/app/src/react/features/ai-chat/components/common/index.ts
@@ -0,0 +1,3 @@
+export * from './file-item-preview';
+export * from './FileItemPreview';
+export * from './icons';
diff --git a/packages/app/src/react/features/ai-chat/components/attachment-button.tsx b/packages/app/src/react/features/ai-chat/components/footer/attachment-button.tsx
similarity index 100%
rename from packages/app/src/react/features/ai-chat/components/attachment-button.tsx
rename to packages/app/src/react/features/ai-chat/components/footer/attachment-button.tsx
diff --git a/packages/app/src/react/features/ai-chat/components/error-toast.tsx b/packages/app/src/react/features/ai-chat/components/footer/error-toast.tsx
similarity index 94%
rename from packages/app/src/react/features/ai-chat/components/error-toast.tsx
rename to packages/app/src/react/features/ai-chat/components/footer/error-toast.tsx
index 1997f209..0cd7b161 100644
--- a/packages/app/src/react/features/ai-chat/components/error-toast.tsx
+++ b/packages/app/src/react/features/ai-chat/components/footer/error-toast.tsx
@@ -1,6 +1,6 @@
import { FC } from 'react';
import { FaCircleExclamation } from 'react-icons/fa6';
-import { CloseIcon } from './icons';
+import { CloseIcon } from '../common/icons';
interface ErrorToastProps {
message: string;
diff --git a/packages/app/src/react/features/ai-chat/components/footer.tsx b/packages/app/src/react/features/ai-chat/components/footer/footer.tsx
similarity index 100%
rename from packages/app/src/react/features/ai-chat/components/footer.tsx
rename to packages/app/src/react/features/ai-chat/components/footer/footer.tsx
diff --git a/packages/app/src/react/features/ai-chat/components/footer/index.ts b/packages/app/src/react/features/ai-chat/components/footer/index.ts
new file mode 100644
index 00000000..cb620187
--- /dev/null
+++ b/packages/app/src/react/features/ai-chat/components/footer/index.ts
@@ -0,0 +1,6 @@
+export * from './attachment-button';
+export * from './error-toast';
+export * from './footer';
+export * from './input';
+export * from './scroll-to-bottom-button';
+export * from './send-button';
diff --git a/packages/app/src/react/features/ai-chat/components/input.tsx b/packages/app/src/react/features/ai-chat/components/footer/input.tsx
similarity index 98%
rename from packages/app/src/react/features/ai-chat/components/input.tsx
rename to packages/app/src/react/features/ai-chat/components/footer/input.tsx
index df97d60d..7aa83f1d 100644
--- a/packages/app/src/react/features/ai-chat/components/input.tsx
+++ b/packages/app/src/react/features/ai-chat/components/footer/input.tsx
@@ -7,10 +7,9 @@ import {
useRef,
useState,
} from 'react';
-import '../styles/index.css';
+import '../../styles/index.css';
import { AttachmentButton, SendButton } from '@react/features/ai-chat/components';
-import { FileItemPreview } from '@react/features/ai-chat/components/FileItemPreview';
import { CHAT_ACCEPTED_FILE_TYPES } from '@react/features/ai-chat/constants';
import { useChatStores, useClipboardPaste } from '@react/features/ai-chat/hooks';
import { createFileFromText } from '@react/features/ai-chat/utils';
@@ -20,6 +19,7 @@ import {
} from '@react/features/ai-chat/utils/scroll-utils';
import { MAX_CHAT_MESSAGE_LENGTH } from '@react/shared/constants';
import { cn } from '@react/shared/utils/general';
+import { FileItemPreview } from '@src/react/features/ai-chat/components/common/FileItemPreview';
const TEXTAREA_MAX_HEIGHT = 160;
const LARGE_TEXT_THRESHOLD = 4000;
diff --git a/packages/app/src/react/features/ai-chat/components/scroll-to-bottom-button.tsx b/packages/app/src/react/features/ai-chat/components/footer/scroll-to-bottom-button.tsx
similarity index 100%
rename from packages/app/src/react/features/ai-chat/components/scroll-to-bottom-button.tsx
rename to packages/app/src/react/features/ai-chat/components/footer/scroll-to-bottom-button.tsx
diff --git a/packages/app/src/react/features/ai-chat/components/send-button.tsx b/packages/app/src/react/features/ai-chat/components/footer/send-button.tsx
similarity index 100%
rename from packages/app/src/react/features/ai-chat/components/send-button.tsx
rename to packages/app/src/react/features/ai-chat/components/footer/send-button.tsx
diff --git a/packages/app/src/react/features/ai-chat/components/header.tsx b/packages/app/src/react/features/ai-chat/components/header/header.tsx
similarity index 99%
rename from packages/app/src/react/features/ai-chat/components/header.tsx
rename to packages/app/src/react/features/ai-chat/components/header/header.tsx
index afa4ba37..1a5a5ae6 100644
--- a/packages/app/src/react/features/ai-chat/components/header.tsx
+++ b/packages/app/src/react/features/ai-chat/components/header/header.tsx
@@ -6,9 +6,9 @@ import { IoChevronDown } from 'react-icons/io5';
import { Link } from 'react-router-dom';
import { Skeleton } from '@react/features/ai-chat/components';
-import { CloseIcon } from '@react/features/ai-chat/components/icons';
import { DEFAULT_AVATAR_URL } from '@react/features/ai-chat/constants';
import { useChatStores } from '@react/features/ai-chat/hooks';
+import { CloseIcon } from '@src/react/features/ai-chat/components/common/icons';
import { cn } from '@src/react/shared/utils/general';
import { Observability } from '@src/shared/observability';
import { EVENTS } from '@src/shared/posthog/constants/events';
diff --git a/packages/app/src/react/features/ai-chat/components/header/index.ts b/packages/app/src/react/features/ai-chat/components/header/index.ts
new file mode 100644
index 00000000..1b8e01c4
--- /dev/null
+++ b/packages/app/src/react/features/ai-chat/components/header/index.ts
@@ -0,0 +1,2 @@
+export * from './header';
+export * from './skeleton';
diff --git a/packages/app/src/react/features/ai-chat/components/skeleton.tsx b/packages/app/src/react/features/ai-chat/components/header/skeleton.tsx
similarity index 100%
rename from packages/app/src/react/features/ai-chat/components/skeleton.tsx
rename to packages/app/src/react/features/ai-chat/components/header/skeleton.tsx
diff --git a/packages/app/src/react/features/ai-chat/components/index.ts b/packages/app/src/react/features/ai-chat/components/index.ts
index c15f435e..bbddda1f 100644
--- a/packages/app/src/react/features/ai-chat/components/index.ts
+++ b/packages/app/src/react/features/ai-chat/components/index.ts
@@ -1,21 +1,5 @@
-export * from './attachment-button';
export * from './chat';
-export * from './chats';
-export * from './code-block';
+export * from './common';
export * from './container';
-export * from './error-message';
-export * from './error-toast';
-export * from './file-item-preview';
export * from './footer';
export * from './header';
-export * from './input';
-export * from './markdown-renderer';
-export * from './chats-with-group';
-export * from './reply-loader';
-export * from './scroll-to-bottom-button';
-export * from './send-button';
-export * from './skeleton';
-export * from './system-message';
-export * from './thinking-message';
-export * from './typewriter';
-export * from './user-message';