Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions ui/desktop/src/components/FlappyGoose.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface FlappyGooseProps {
}

const FlappyGoose: React.FC<FlappyGooseProps> = ({ onClose }) => {
const canvasRef = useRef<HTMLCanvasElement>(null);
const canvasRef = useRef<HTMLCanvasElement | null>(null);
const [gameOver, setGameOver] = useState(false);
const [displayScore, setDisplayScore] = useState(0);
const gooseImages = useRef<HTMLImageElement[]>([]);
Expand Down Expand Up @@ -272,7 +272,7 @@ const FlappyGoose: React.FC<FlappyGooseProps> = ({ onClose }) => {
onClick={flap}
>
<canvas
ref={canvasRef}
ref={(el) => { canvasRef.current = el; }}
style={{
border: '2px solid #333',
borderRadius: '8px',
Expand Down
4 changes: 2 additions & 2 deletions ui/desktop/src/components/ProviderGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ export function ProviderGrid({ onSubmit }: ProviderGridProps) {
<div className="relative z-[9999]">
<ProviderSetupModal
provider={providers.find((p) => p.id === selectedId)?.name || 'Unknown Provider'}
model="Example Model"
endpoint="Example Endpoint"
_model="Example Model"
_endpoint="Example Endpoint"
onSubmit={handleModalSubmit}
onCancel={() => {
setShowSetupModal(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ interface ExtensionListProps {
onToggle: (extension: FixedExtensionEntry) => Promise<boolean | void> | void;
onConfigure?: (extension: FixedExtensionEntry) => void;
isStatic?: boolean;
disableConfiguration?: boolean;
}

export default function ExtensionList({
extensions,
onToggle,
onConfigure,
isStatic,
disableConfiguration: _disableConfiguration,
}: ExtensionListProps) {
return (
<div className="grid grid-cols-2 gap-2 mb-2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function SessionSharingSection() {
// If env is set, force sharing enabled and set the baseUrl accordingly.
const [sessionSharingConfig, setSessionSharingConfig] = useState({
enabled: envBaseUrlShare ? true : false,
baseUrl: envBaseUrlShare || '',
baseUrl: typeof envBaseUrlShare === 'string' ? envBaseUrlShare : '',
});
const [urlError, setUrlError] = useState('');
// isUrlConfigured is true if the user has configured a baseUrl and it is valid.
Expand All @@ -23,7 +23,7 @@ export default function SessionSharingSection() {
// If env variable is set, save the forced configuration to localStorage
const forcedConfig = {
enabled: true,
baseUrl: envBaseUrlShare,
baseUrl: typeof envBaseUrlShare === 'string' ? envBaseUrlShare : '',
};
localStorage.setItem('session_sharing_config', JSON.stringify(forcedConfig));
} else {
Expand Down Expand Up @@ -139,7 +139,7 @@ export default function SessionSharingSection() {
placeholder="https://example.com/api"
value={sessionSharingConfig.baseUrl}
disabled={!!envBaseUrlShare}
onChange={envBaseUrlShare ? () => {} : handleBaseUrlChange}
{...(envBaseUrlShare ? {} : { onChange: handleBaseUrlChange })}
/>
</div>
{urlError && <p className="text-red-500 text-sm">{urlError}</p>}
Expand Down
2 changes: 1 addition & 1 deletion ui/desktop/src/goosed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const startGoosed = async (
app: App,
dir: string | null = null,
env: Partial<GooseProcessEnv> = {}
) => {
): Promise<[number, string, ChildProcess]> => {
// we default to running goosed in home dir - if not specified
const homeDir = os.homedir();
const isWindows = process.platform === 'win32';
Expand Down
14 changes: 8 additions & 6 deletions ui/desktop/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ const createChat = async (
// Initialize variables for process and configuration
let port = 0;
let working_dir = '';
let goosedProcess = null;
let goosedProcess: import('child_process').ChildProcess | null = null;

if (viewType === 'recipeEditor') {
// For recipeEditor, get the port from existing windows' config
Expand All @@ -404,7 +404,10 @@ const createChat = async (
// Apply current environment settings before creating chat
updateEnvironmentVariables(envToggles);
// Start new Goosed process for regular windows
[port, working_dir, goosedProcess] = await startGoosed(app, dir);
const [newPort, newWorkingDir, newGoosedProcess] = await startGoosed(app, dir);
port = newPort;
working_dir = newWorkingDir;
goosedProcess = newGoosedProcess;
}

const mainWindow = new BrowserWindow({
Expand Down Expand Up @@ -1073,7 +1076,7 @@ app.whenReady().then(async () => {
callback({
responseHeaders: {
...details.responseHeaders,
'Content-Security-Policy': [
'Content-Security-Policy':
"default-src 'self';" +
// Allow inline styles since we use them in our React components
"style-src 'self' 'unsafe-inline';" +
Expand Down Expand Up @@ -1101,7 +1104,6 @@ app.whenReady().then(async () => {
"worker-src 'self';" +
// Upgrade insecure requests
'upgrade-insecure-requests;',
],
},
});
});
Expand Down Expand Up @@ -1185,7 +1187,7 @@ app.whenReady().then(async () => {
},
{
label: 'Use Selection for Find',
accelerator: process.platform === 'darwin' ? 'Command+E' : null,
accelerator: process.platform === 'darwin' ? 'Command+E' : undefined,
click() {
const focusedWindow = BrowserWindow.getFocusedWindow();
if (focusedWindow) focusedWindow.webContents.send('use-selection-find');
Expand Down Expand Up @@ -1608,7 +1610,7 @@ app.on('will-quit', async () => {

// Quit when all windows are closed, except on macOS or if we have a tray icon.
// Add confirmation dialog when quitting with Cmd+Q (skip in dev mode)
app.on('before-quit', (event) => {
app.on('before-quit', async (event) => {
// Skip confirmation dialog in development mode
if (MAIN_WINDOW_VITE_DEV_SERVER_URL) {
return; // Allow normal quit behavior in dev mode
Expand Down
2 changes: 1 addition & 1 deletion ui/desktop/src/types/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export function getToolResponses(message: Message): ToolResponseMessageContent[]

export function getToolConfirmationContent(
message: Message
): ToolConfirmationRequestMessageContent {
): ToolConfirmationRequestMessageContent | undefined {
return message.content.find(
(content): content is ToolConfirmationRequestMessageContent =>
content.type === 'toolConfirmationRequest'
Expand Down