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.

feat: replace ChatInput with ClaudeInput in chat footer and export upload-menu

Salman-Ahamed633ec2c2cf25
diff --git a/packages/app/src/react/features/ai-chat/components/footer/footer.tsx b/packages/app/src/react/features/ai-chat/components/footer/footer.tsx
index 414c39e7..ed80d08f 100644
--- a/packages/app/src/react/features/ai-chat/components/footer/footer.tsx
+++ b/packages/app/src/react/features/ai-chat/components/footer/footer.tsx
@@ -1,6 +1,7 @@
-import { ChatInput, ErrorToast, ScrollToBottomButton } from '@react/features/ai-chat/components';
+import { ErrorToast, ScrollToBottomButton } from '@react/features/ai-chat/components';
import { useChatStores } from '@react/features/ai-chat/hooks';
import { FC } from 'react';
+import ClaudeInput from './claude-input';
export const Footer: FC = () => {
const { files, scroll } = useChatStores();
@@ -12,7 +13,7 @@ export const Footer: FC = () => {
{errorMessage && <ErrorToast message={errorMessage} onClose={clearError} />}
<div className="relative">
{showScrollButton && <ScrollToBottomButton onClick={() => scrollToBottom()} />}
- <ChatInput />
+ <ClaudeInput />
</div>
<h6 className="py-4 text-center text-xs text-gray-500">
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
index cb620187..00c41631 100644
--- a/packages/app/src/react/features/ai-chat/components/footer/index.ts
+++ b/packages/app/src/react/features/ai-chat/components/footer/index.ts
@@ -4,3 +4,4 @@ export * from './footer';
export * from './input';
export * from './scroll-to-bottom-button';
export * from './send-button';
+export * from './upload-menu';
diff --git a/packages/app/src/react/features/ai-chat/components/footer/upload-menu.tsx b/packages/app/src/react/features/ai-chat/components/footer/upload-menu.tsx
new file mode 100644
index 00000000..b478f599
--- /dev/null
+++ b/packages/app/src/react/features/ai-chat/components/footer/upload-menu.tsx
@@ -0,0 +1,137 @@
+import { FC, useCallback, useEffect, useRef, useState } from 'react';
+
+import { Camera, Paperclip } from 'lucide-react';
+
+interface MenuItem {
+ id: string;
+ label: string;
+ shortcut?: string;
+ icon: FC<{ className?: string }>;
+ onClick: () => void;
+}
+
+interface UploadMenuProps {
+ isOpen: boolean;
+ onClose: () => void;
+ onAddFiles: () => void;
+ onTakeScreenshot: () => void;
+ triggerRef: React.RefObject<HTMLButtonElement | null>;
+}
+export const UploadMenu: FC<UploadMenuProps> = (props) => {
+ const { isOpen, onClose, onAddFiles, onTakeScreenshot, triggerRef } = props;
+
+ const menuRef = useRef<HTMLDivElement>(null);
+ const [isVisible, setIsVisible] = useState(false);
+
+ const menuItems: MenuItem[] = [
+ {
+ id: 'add-files',
+ label: 'Add files or photos',
+ icon: Paperclip,
+ shortcut: 'Ctrl+U',
+ onClick: () => {
+ onAddFiles();
+ onClose();
+ },
+ },
+ {
+ id: 'take-screenshot',
+ label: 'Take a screenshot',
+ icon: Camera,
+ onClick: () => {
+ onTakeScreenshot();
+ onClose();
+ },
+ },
+ ];
+
+ useEffect(() => {
+ if (isOpen) {
+ requestAnimationFrame(() => {
+ setIsVisible(true);
+ });
+ } else {
+ setIsVisible(false);
+ }
+ }, [isOpen]);
+
+ const handleClickOutside = useCallback(
+ (event: MouseEvent) => {
+ const target = event.target as Node;
+ const isOutsideMenu = menuRef.current && !menuRef.current.contains(target);
+ const isOutsideTrigger = triggerRef.current && !triggerRef.current.contains(target);
+
+ if (isOutsideMenu && isOutsideTrigger) {
+ onClose();
+ }
+ },
+ [onClose, triggerRef],
+ );
+
+ const handleKeyDown = useCallback(
+ (event: KeyboardEvent) => {
+ if (event.key === 'Escape') {
+ onClose();
+ }
+ },
+ [onClose],
+ );
+
+ useEffect(() => {
+ if (isOpen) {
+ document.addEventListener('mousedown', handleClickOutside);
+ document.addEventListener('keydown', handleKeyDown);
+ }
+
+ return () => {
+ document.removeEventListener('mousedown', handleClickOutside);
+ document.removeEventListener('keydown', handleKeyDown);
+ };
+ }, [isOpen, handleClickOutside, handleKeyDown]);
+
+ if (!isOpen) {
+ return null;
+ }
+
+ return (
+ <div
+ ref={menuRef}
+ role="menu"
+ aria-label="Upload options"
+ className={`
+ absolute bottom-full left-0 mb-2 z-50
+ min-w-[220px] p-1.5
+ bg-white rounded-xl
+ border border-gray-200
+ shadow-[0_4px_16px_rgba(0,0,0,0.08),0_0_0_0.5px_rgba(0,0,0,0.05)]
+ transition-all duration-150 ease-out
+ ${isVisible ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-1'}
+ `}
+ >
+ {menuItems.map((item) => (
+ <button
+ key={item.id}
+ type="button"
+ role="menuitem"
+ onClick={item.onClick}
+ className="
+ w-full flex items-center gap-1.5
+ px-2.5 py-1.5 rounded-xl
+ text-gray-700 text-sm text-left
+ hover:bg-gray-50
+ transition-colors duration-100
+ cursor-pointer
+ "
+ >
+ <item.icon className="size-4 text-gray-500 shrink-0" />
+ <span>{item.label}</span>
+ {item.shortcut && (
+ <span className="text-[10px] text-gray-500 ml-auto">{item.shortcut}</span>
+ )}
+ </button>
+ ))}
+ </div>
+ );
+};
+
+export default UploadMenu;