fix: hide computer use menus

This commit is contained in:
Simos Mikelatos
2026-06-20 01:50:02 +00:00
parent 1c05fe0905
commit bb630ef739
6 changed files with 29 additions and 8 deletions

View File

@@ -3,6 +3,9 @@ import { BrowserWindow, Menu, Tray, nativeImage, nativeTheme, session } from 'el
import { ViewHost } from './viewHost.js'; import { ViewHost } from './viewHost.js';
const TITLEBAR_HEIGHT = 44; const TITLEBAR_HEIGHT = 44;
// TODO: Re-enable Computer Use menus after fixing the MCP server connection
// between the desktop app and the web UI.
const COMPUTER_USE_MENUS_ENABLED = false;
function isAllowedPermissionOrigin(sourceUrl, controlPlaneUrl) { function isAllowedPermissionOrigin(sourceUrl, controlPlaneUrl) {
try { try {
@@ -334,6 +337,7 @@ export class DesktopWindowManager {
{ type: 'separator' }, { type: 'separator' },
{ {
label: 'Services', label: 'Services',
visible: COMPUTER_USE_MENUS_ENABLED,
submenu: [ submenu: [
{ {
label: 'Computer Use', label: 'Computer Use',

View File

@@ -530,6 +530,10 @@ window.__MOCK_STATE__ = {
return 'idle'; return 'idle';
} }
// TODO: Re-enable Computer Use menus after fixing the MCP server connection
// between the desktop app and the web UI.
var COMPUTER_USE_MENUS_ENABLED = false;
function renderComputerPermissionRow(key, label, detail, status) { function renderComputerPermissionRow(key, label, detail, status) {
return '<div class="cc-permission-row">' + return '<div class="cc-permission-row">' +
'<div><div class="cc-permission-title">' + CC.esc(label) + '</div><div class="cc-permission-detail">' + CC.esc(detail) + '</div></div>' + '<div><div class="cc-permission-title">' + CC.esc(label) + '</div><div class="cc-permission-detail">' + CC.esc(detail) + '</div></div>' +
@@ -587,9 +591,11 @@ window.__MOCK_STATE__ = {
var state = CC.state || {}; var state = CC.state || {};
var sections = [ var sections = [
CC.buildThemeSection(state), CC.buildThemeSection(state),
CC.buildComputerUseSection(state),
]; ];
CC.renderSheet('Desktop Settings', 'Manage the desktop app appearance and Computer Use behavior.', sections); if (COMPUTER_USE_MENUS_ENABLED) {
sections.push(CC.buildComputerUseSection(state));
}
CC.renderSheet('Desktop Settings', 'Manage the desktop app appearance.', sections);
}; };
CC.render = function (state) { CC.render = function (state) {

View File

@@ -12,6 +12,7 @@ import { useTaskMaster } from '../../../contexts/TaskMasterContext';
import { usePaletteOpsRegister } from '../../../contexts/PaletteOpsContext'; import { usePaletteOpsRegister } from '../../../contexts/PaletteOpsContext';
import { useTasksSettings } from '../../../contexts/TasksSettingsContext'; import { useTasksSettings } from '../../../contexts/TasksSettingsContext';
import { useUiPreferences } from '../../../hooks/useUiPreferences'; import { useUiPreferences } from '../../../hooks/useUiPreferences';
import { COMPUTER_USE_MENUS_ENABLED } from '../../../constants/featureFlags';
import { authenticatedFetch } from '../../../utils/api'; import { authenticatedFetch } from '../../../utils/api';
import { useEditorSidebar } from '../../code-editor/hooks/useEditorSidebar'; import { useEditorSidebar } from '../../code-editor/hooks/useEditorSidebar';
import EditorSidebar from '../../code-editor/view/EditorSidebar'; import EditorSidebar from '../../code-editor/view/EditorSidebar';
@@ -63,7 +64,7 @@ function MainContent({
const shouldShowTasksTab = Boolean(tasksEnabled && isTaskMasterInstalled); const shouldShowTasksTab = Boolean(tasksEnabled && isTaskMasterInstalled);
const shouldShowBrowserTab = browserUseEnabled; const shouldShowBrowserTab = browserUseEnabled;
const shouldShowComputerTab = computerUseEnabled === true; const shouldShowComputerTab = COMPUTER_USE_MENUS_ENABLED && computerUseEnabled === true;
const { const {
editingFile, editingFile,
@@ -168,10 +169,10 @@ function MainContent({
}, [loadComputerUseSettings]); }, [loadComputerUseSettings]);
useEffect(() => { useEffect(() => {
if (computerUseEnabled === false && activeTab === 'computer') { if (!shouldShowComputerTab && activeTab === 'computer') {
setActiveTab('chat'); setActiveTab('chat');
} }
}, [computerUseEnabled, activeTab, setActiveTab]); }, [shouldShowComputerTab, activeTab, setActiveTab]);
usePaletteOpsRegister({ usePaletteOpsRegister({
openFile: (filePath: string) => { openFile: (filePath: string) => {

View File

@@ -1,6 +1,7 @@
import { useCallback, useEffect, useRef, useState } from 'react'; import { useCallback, useEffect, useRef, useState } from 'react';
import { useTheme } from '../../../contexts/ThemeContext'; import { useTheme } from '../../../contexts/ThemeContext';
import { COMPUTER_USE_MENUS_ENABLED } from '../../../constants/featureFlags';
import { authenticatedFetch } from '../../../utils/api'; import { authenticatedFetch } from '../../../utils/api';
import { setNotificationSoundEnabled } from '../../../utils/notificationSound'; import { setNotificationSoundEnabled } from '../../../utils/notificationSound';
import { useProviderAuthStatus } from '../../provider-auth/hooks/useProviderAuthStatus'; import { useProviderAuthStatus } from '../../provider-auth/hooks/useProviderAuthStatus';
@@ -58,7 +59,7 @@ const KNOWN_MAIN_TABS: SettingsMainTab[] = ['agents', 'appearance', 'git', 'api'
const normalizeMainTab = (tab: string): SettingsMainTab => { const normalizeMainTab = (tab: string): SettingsMainTab => {
// Keep backwards compatibility with older callers that still pass "tools". // Keep backwards compatibility with older callers that still pass "tools".
if (tab === 'tools') { if (tab === 'tools' || (tab === 'computer' && !COMPUTER_USE_MENUS_ENABLED)) {
return 'agents'; return 'agents';
} }

View File

@@ -1,5 +1,7 @@
import { Bell, Bot, GitBranch, Info, Key, ListChecks, MonitorCog, MonitorPlay, Palette, Puzzle } from 'lucide-react'; import { Bell, Bot, GitBranch, Info, Key, ListChecks, MonitorCog, MonitorPlay, Palette, Puzzle } from 'lucide-react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { COMPUTER_USE_MENUS_ENABLED } from '../../../constants/featureFlags';
import { cn } from '../../../lib/utils'; import { cn } from '../../../lib/utils';
import { PillBar, Pill } from '../../../shared/view/ui'; import { PillBar, Pill } from '../../../shared/view/ui';
import type { SettingsMainTab } from '../types/types'; import type { SettingsMainTab } from '../types/types';
@@ -28,6 +30,10 @@ const NAV_ITEMS: NavItem[] = [
{ id: 'about', labelKey: 'mainTabs.about', icon: Info }, { id: 'about', labelKey: 'mainTabs.about', icon: Info },
]; ];
const VISIBLE_NAV_ITEMS = NAV_ITEMS.filter((item) => (
COMPUTER_USE_MENUS_ENABLED || item.id !== 'computer'
));
export default function SettingsSidebar({ activeTab, onChange }: SettingsSidebarProps) { export default function SettingsSidebar({ activeTab, onChange }: SettingsSidebarProps) {
const { t } = useTranslation('settings'); const { t } = useTranslation('settings');
@@ -36,7 +42,7 @@ export default function SettingsSidebar({ activeTab, onChange }: SettingsSidebar
{/* Desktop sidebar */} {/* Desktop sidebar */}
<aside className="hidden w-56 flex-shrink-0 border-r border-border bg-muted/30 md:flex md:flex-col"> <aside className="hidden w-56 flex-shrink-0 border-r border-border bg-muted/30 md:flex md:flex-col">
<nav className="flex flex-col gap-1 p-3"> <nav className="flex flex-col gap-1 p-3">
{NAV_ITEMS.map((item) => { {VISIBLE_NAV_ITEMS.map((item) => {
const Icon = item.icon; const Icon = item.icon;
const isActive = activeTab === item.id; const isActive = activeTab === item.id;
@@ -62,7 +68,7 @@ export default function SettingsSidebar({ activeTab, onChange }: SettingsSidebar
{/* Mobile horizontal nav — pill bar */} {/* Mobile horizontal nav — pill bar */}
<div className="flex-shrink-0 border-b border-border px-3 py-2 md:hidden"> <div className="flex-shrink-0 border-b border-border px-3 py-2 md:hidden">
<PillBar className="scrollbar-hide w-full overflow-x-auto"> <PillBar className="scrollbar-hide w-full overflow-x-auto">
{NAV_ITEMS.map((item) => { {VISIBLE_NAV_ITEMS.map((item) => {
const Icon = item.icon; const Icon = item.icon;
return ( return (

View File

@@ -0,0 +1,3 @@
// TODO: Re-enable Computer Use menus after fixing the MCP server connection
// between the desktop app and the web UI.
export const COMPUTER_USE_MENUS_ENABLED = false;