From a812d6ff7915080323474913e808b0d6b700cf1c Mon Sep 17 00:00:00 2001 From: Zane <75694352+zanesq@users.noreply.github.com> Date: Mon, 5 May 2025 08:48:43 -0700 Subject: [PATCH] Bottom and top bar refinement (#2303) Co-authored-by: Nahiyan Khan --- ui/desktop/package-lock.json | 10 +- ui/desktop/package.json | 2 +- .../components/{Input.tsx => ChatInput.tsx} | 140 ++++++++++-------- ui/desktop/src/components/ChatView.tsx | 21 +-- ui/desktop/src/components/LoadingGoose.tsx | 2 +- ui/desktop/src/components/WelcomeView.tsx | 7 +- .../src/components/bottom_menu/BottomMenu.tsx | 73 ++------- .../bottom_menu/BottomMenuModeSelection.tsx | 30 ++-- .../src/components/more_menu/MoreMenu.tsx | 6 +- .../components/more_menu/MoreMenuLayout.tsx | 52 +++++-- .../sessions/SessionHistoryView.tsx | 3 +- .../components/sessions/SessionListView.tsx | 3 +- .../src/components/settings/SettingsView.tsx | 3 +- .../settings/basic/ModeSelectionItem.tsx | 21 ++- .../settings/models/MoreModelsView.tsx | 3 +- .../providers/ConfigureProvidersView.tsx | 3 +- .../components/settings_v2/SettingsView.tsx | 3 +- .../extensions/modal/ExtensionInfoFields.tsx | 1 - .../settings_v2/mode/ModeSelectionItem.tsx | 18 +-- .../models/bottom_bar/ModelsBottomBar.tsx | 18 +-- .../models/subcomponents/AddModelModal.tsx | 2 +- .../permission/PermissionSetting.tsx | 3 +- .../providers/ProviderRegistry.tsx | 3 +- .../providers/ProviderSettingsPage.tsx | 4 +- ui/desktop/src/components/ui/scroll-area.tsx | 7 +- ui/desktop/src/main.ts | 2 +- 26 files changed, 221 insertions(+), 219 deletions(-) rename ui/desktop/src/components/{Input.tsx => ChatInput.tsx} (68%) diff --git a/ui/desktop/package-lock.json b/ui/desktop/package-lock.json index 4392ad14..c72dee99 100644 --- a/ui/desktop/package-lock.json +++ b/ui/desktop/package-lock.json @@ -37,7 +37,7 @@ "express": "^4.21.1", "framer-motion": "^11.11.11", "lodash": "^4.17.21", - "lucide-react": "^0.454.0", + "lucide-react": "^0.475.0", "react": "^18.3.1", "react-dom": "^18.3.1", "react-icons": "^5.3.0", @@ -11454,12 +11454,12 @@ } }, "node_modules/lucide-react": { - "version": "0.454.0", - "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.454.0.tgz", - "integrity": "sha512-hw7zMDwykCLnEzgncEEjHeA6+45aeEzRYuKHuyRSOPkhko+J3ySGjGIzu+mmMfDFG1vazHepMaYFYHbTFAZAAQ==", + "version": "0.475.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.475.0.tgz", + "integrity": "sha512-NJzvVu1HwFVeZ+Gwq2q00KygM1aBhy/ZrhY9FsAgJtpB+E4R7uxRk9M2iKvHa6/vNxZydIB59htha4c2vvwvVg==", "license": "ISC", "peerDependencies": { - "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0-rc" + "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "node_modules/magic-string": { diff --git a/ui/desktop/package.json b/ui/desktop/package.json index cffe67cd..4eb409e1 100644 --- a/ui/desktop/package.json +++ b/ui/desktop/package.json @@ -109,7 +109,7 @@ "express": "^4.21.1", "framer-motion": "^11.11.11", "lodash": "^4.17.21", - "lucide-react": "^0.454.0", + "lucide-react": "^0.475.0", "react": "^18.3.1", "react-dom": "^18.3.1", "react-icons": "^5.3.0", diff --git a/ui/desktop/src/components/Input.tsx b/ui/desktop/src/components/ChatInput.tsx similarity index 68% rename from ui/desktop/src/components/Input.tsx rename to ui/desktop/src/components/ChatInput.tsx index 6127d0bb..669eaef3 100644 --- a/ui/desktop/src/components/Input.tsx +++ b/ui/desktop/src/components/ChatInput.tsx @@ -1,8 +1,10 @@ import React, { useRef, useState, useEffect, useCallback } from 'react'; import { Button } from './ui/button'; +import type { View } from '../App'; import Stop from './ui/Stop'; import { Attach, Send } from './icons'; import { debounce } from 'lodash'; +import BottomMenu from './bottom_menu/BottomMenu'; interface InputProps { handleSubmit: (e: React.FormEvent) => void; @@ -11,6 +13,8 @@ interface InputProps { commandHistory?: string[]; initialValue?: string; droppedFiles?: string[]; + setView: (view: View) => void; + numTokens?: number; } export default function Input({ @@ -19,10 +23,13 @@ export default function Input({ onStop, commandHistory = [], initialValue = '', + setView, + numTokens, droppedFiles = [], }: InputProps) { const [_value, setValue] = useState(initialValue); const [displayValue, setDisplayValue] = useState(initialValue); // For immediate visual feedback + const [isFocused, setIsFocused] = useState(false); // Update internal value when initialValue changes useEffect(() => { @@ -205,65 +212,82 @@ export default function Input({ }; return ( -
-