diff --git a/ui/desktop/src/components/BottomMenu.tsx b/ui/desktop/src/components/BottomMenu.tsx index bc8e1132..c0798c1e 100644 --- a/ui/desktop/src/components/BottomMenu.tsx +++ b/ui/desktop/src/components/BottomMenu.tsx @@ -5,6 +5,7 @@ import { Sliders } from 'lucide-react'; import { ModelRadioList } from './settings/models/ModelRadioList'; import { Document, ChevronUp, ChevronDown } from './icons'; import type { View } from '../ChatWindow'; +import { getApiUrl, getSecretKey } from '../config'; export default function BottomMenu({ hasMessages, @@ -14,6 +15,7 @@ export default function BottomMenu({ setView: (view: View) => void; }) { const [isModelMenuOpen, setIsModelMenuOpen] = useState(false); + const [gooseMode, setGooseMode] = useState('approve'); const { currentModel } = useModel(); const { recentModels } = useRecentModels(); // Get recent models const dropdownRef = useRef(null); @@ -35,6 +37,29 @@ export default function BottomMenu({ }; }, [isModelMenuOpen]); + useEffect(() => { + const fetchCurrentMode = async () => { + try { + const response = await fetch(getApiUrl('/configs/get?key=GOOSE_MODE'), { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + 'X-Secret-Key': getSecretKey(), + }, + }); + + if (response.ok) { + const { value } = await response.json(); + setGooseMode(value); + } + } catch (error) { + console.error('Error fetching current mode:', error); + } + }; + + fetchCurrentMode(); + }, []); + // Add effect to handle Escape key useEffect(() => { const handleEsc = (event: KeyboardEvent) => { @@ -76,6 +101,17 @@ export default function BottomMenu({ +
+
{ + setView('settings'); + }} + > + Goose Mode: {gooseMode} +
+
+ {/* Model Selector Dropdown - Only in development */}