Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui/desktop/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const noWindowLocationHref = {
) {
context.report({
node,
message: 'Do not use window.location.href directly in Electron apps. Use React Router\'s navigate() instead.'
message: 'Do not use window.location.href directly in Electron apps. Use setView from the project instead'
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion ui/desktop/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"license": {
"name": "Apache-2.0"
},
"version": "1.0.5"
"version": "1.0.7"
},
"paths": {
"/config": {
Expand Down
42 changes: 0 additions & 42 deletions ui/desktop/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion ui/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
"react-dom": "^18.3.1",
"react-icons": "^5.3.0",
"react-markdown": "^9.0.1",
"react-router-dom": "^6.28.0",
"react-select": "^5.9.0",
"react-syntax-highlighter": "^15.6.1",
"react-toastify": "^8.0.0",
Expand Down
5 changes: 2 additions & 3 deletions ui/desktop/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useEffect, useState } from 'react';
import { addExtensionFromDeepLink } from './extensions';
import { useNavigate } from 'react-router-dom';
import LauncherWindow from './LauncherWindow';
import ChatWindow from './ChatWindow';
import ErrorScreen from './components/ErrorScreen';
Expand All @@ -19,7 +18,7 @@
const [isInstalling, setIsInstalling] = useState(false); // Track installation progress
const searchParams = new URLSearchParams(window.location.search);
const isLauncher = searchParams.get('window') === 'launcher';
const navigate = useNavigate();
const navigate = () => console.log('todo - bring back nav');

// Utility function to extract the command from the link
function extractCommand(link: string): string {
Expand Down Expand Up @@ -55,7 +54,7 @@
console.log('Confirming installation for link:', pendingLink);

try {
await addExtensionFromDeepLink(pendingLink, navigate); // Proceed with adding the extension
await addExtensionFromDeepLink(pendingLink, navigate);
} catch (error) {
console.error('Failed to add extension:', error);
} finally {
Expand All @@ -74,7 +73,7 @@
};

useEffect(() => {
const handleFatalError = (_: any, errorMessage: string) => {

Check warning on line 76 in ui/desktop/src/App.tsx

View workflow job for this annotation

GitHub Actions / Lint Electron Desktop App

Unexpected any. Specify a different type
setFatalError(errorMessage);
};

Expand Down
14 changes: 0 additions & 14 deletions ui/desktop/src/ChatWindow.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useRef, useState } from 'react';
import { Message, useChat } from './ai-sdk-fork/useChat';
import { getApiUrl, getSecretKey } from './config';

Check warning on line 3 in ui/desktop/src/ChatWindow.tsx

View workflow job for this annotation

GitHub Actions / Lint Electron Desktop App

'getSecretKey' is defined but never used. Allowed unused vars must match /^_/u
import BottomMenu from './components/BottomMenu';
import FlappyGoose from './components/FlappyGoose';
import GooseMessage from './components/GooseMessage';
Expand All @@ -10,9 +10,9 @@
import { Card } from './components/ui/card';
import { ScrollArea, ScrollAreaHandle } from './components/ui/scroll-area';
import UserMessage from './components/UserMessage';
import WingToWing, { Working } from './components/WingToWing';

Check warning on line 13 in ui/desktop/src/ChatWindow.tsx

View workflow job for this annotation

GitHub Actions / Lint Electron Desktop App

'WingToWing' is defined but never used. Allowed unused vars must match /^_/u
import { askAi } from './utils/askAI';
import { getStoredModel, Provider } from './utils/providerUtils';

Check warning on line 15 in ui/desktop/src/ChatWindow.tsx

View workflow job for this annotation

GitHub Actions / Lint Electron Desktop App

'Provider' is defined but never used. Allowed unused vars must match /^_/u
import { ChatLayout } from './components/chat_window/ChatLayout';
import { WelcomeScreen } from './components/welcome_screen/WelcomeScreen';
import { getStoredProvider, initializeSystem } from './utils/providerUtils';
Expand All @@ -24,7 +24,7 @@
import Settings from './components/settings/Settings';
import MoreModelsSettings from './components/settings/models/MoreModels';
import ConfigureProviders from './components/settings/providers/ConfigureProviders';
import { ConfigPage } from './components/pages/ConfigPage';

Check warning on line 27 in ui/desktop/src/ChatWindow.tsx

View workflow job for this annotation

GitHub Actions / Lint Electron Desktop App

'ConfigPage' is defined but never used. Allowed unused vars must match /^_/u

export interface Chat {
id: number;
Expand All @@ -50,7 +50,7 @@
chats,
setChats,
selectedChatId,
setSelectedChatId,

Check warning on line 53 in ui/desktop/src/ChatWindow.tsx

View workflow job for this annotation

GitHub Actions / Lint Electron Desktop App

'setSelectedChatId' is defined but never used. Allowed unused args must match /^_/u
initialQuery,
setProgressMessage,
setWorking,
Expand Down Expand Up @@ -123,7 +123,7 @@
useEffect(() => {
const updatedChats = chats.map((c) => (c.id === selectedChatId ? { ...c, messages } : c));
setChats(updatedChats);
}, [messages, selectedChatId]);

Check warning on line 126 in ui/desktop/src/ChatWindow.tsx

View workflow job for this annotation

GitHub Actions / Lint Electron Desktop App

React Hook useEffect has missing dependencies: 'chats' and 'setChats'. Either include them or remove the dependency array. If 'setChats' changes too often, find the parent component that defines it and wrap that definition in useCallback

const initialQueryAppended = useRef(false);
useEffect(() => {
Expand All @@ -131,7 +131,7 @@
append({ role: 'user', content: initialQuery });
initialQueryAppended.current = true;
}
}, [initialQuery]);

Check warning on line 134 in ui/desktop/src/ChatWindow.tsx

View workflow job for this annotation

GitHub Actions / Lint Electron Desktop App

React Hook useEffect has a missing dependency: 'append'. Either include it or remove the dependency array

useEffect(() => {
if (messages.length > 0) {
Expand Down Expand Up @@ -299,8 +299,8 @@
const [selectedChatId, setSelectedChatId] = useState(1);

// Additional states
const [mode, setMode] = useState<'expanded' | 'compact'>('expanded');

Check warning on line 302 in ui/desktop/src/ChatWindow.tsx

View workflow job for this annotation

GitHub Actions / Lint Electron Desktop App

'setMode' is assigned a value but never used. Allowed unused vars must match /^_/u
const [working, setWorking] = useState<Working>(Working.Idle);

Check warning on line 303 in ui/desktop/src/ChatWindow.tsx

View workflow job for this annotation

GitHub Actions / Lint Electron Desktop App

'working' is assigned a value but never used. Allowed unused vars must match /^_/u
const [progressMessage, setProgressMessage] = useState<string>('');
const [initialQuery, setInitialQuery] = useState<string | null>(null);

Expand Down Expand Up @@ -363,12 +363,6 @@
setupStoredProvider();
}, []);

// Render everything inside ChatLayout now
// We'll switch views inside the ChatLayout children.

// If we want to skip showing ChatLayout for the welcome screen, we can do so.
// But let's do exactly what's requested: put all view options under ChatLayout.

return (
<ChatLayout mode={mode}>
{/* Conditionally render based on `view` */}
Expand All @@ -395,14 +389,6 @@
setView={setView}
/>
)}
{view === 'configPage' && (
<ConfigPage
onClose={() => {
setView('chat');
}}
setView={setView}
/>
)}
{view === 'configureProviders' && (
<ConfigureProviders
onClose={() => {
Expand Down
150 changes: 0 additions & 150 deletions ui/desktop/src/ConfigTestingWindow.tsx

This file was deleted.

7 changes: 2 additions & 5 deletions ui/desktop/src/components/BottomMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { useModel } from './settings/models/ModelContext';
import { useRecentModels } from './settings/models/RecentModels'; // Hook for recent models
import { Sliders } from 'lucide-react';
import { ModelRadioList } from './settings/models/ModelRadioList';
// Remove react-router-dom usage
// import { useNavigate } from 'react-router-dom';
import { Document, ChevronUp, ChevronDown } from './icons';
import type { View } from '../ChatWindow';

Expand All @@ -13,7 +11,7 @@ export default function BottomMenu({
setView,
}: {
hasMessages: boolean;
setView?: (view: View) => void;
setView: (view: View) => void;
}) {
const [isModelMenuOpen, setIsModelMenuOpen] = useState(false);
const { currentModel } = useModel();
Expand Down Expand Up @@ -133,8 +131,7 @@ export default function BottomMenu({
border-t border-borderSubtle mt-2"
onClick={() => {
setIsModelMenuOpen(false);
// Instead of navigate('/settings'), call setView('settings').
setView?.('settings');
setView('settings');
}}
>
<span className="text-sm">Tools and Settings</span>
Expand Down
11 changes: 2 additions & 9 deletions ui/desktop/src/components/MoreMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import { Popover, PopoverContent, PopoverTrigger, PopoverPortal } from '@radix-ui/react-popover';
import React, { useEffect, useState } from 'react';
import { FaMoon, FaSun } from 'react-icons/fa';
import VertDots from './ui/VertDots';
// Removed react-router-dom import
// import { useNavigate } from 'react-router-dom';
import { More } from './icons';
import { Settings, Grid, MessageSquare } from 'lucide-react';
import { Button } from './ui/button';
import type { View } from '../../ChatWindow';

interface VersionInfo {
Expand All @@ -15,7 +9,7 @@ interface VersionInfo {
}

// Accept setView as a prop from the parent (e.g. ChatContent)
export default function MoreMenu({ setView }: { setView?: (view: View) => void }) {
export default function MoreMenu({ setView }: { setView: (view: View) => void }) {
const [open, setOpen] = useState(false);
const [versions, setVersions] = useState<VersionInfo | null>(null);
const [showVersions, setShowVersions] = useState(false);
Expand Down Expand Up @@ -231,8 +225,7 @@ export default function MoreMenu({ setView }: { setView?: (view: View) => void }
<button
onClick={() => {
setOpen(false);
// Instead of navigate('/settings'), call setView to switch.
setView?.('settings');
setView('settings');
}}
className="w-full text-left p-2 text-sm hover:bg-bgSubtle transition-colors"
>
Expand Down
Loading