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
1 change: 1 addition & 0 deletions ui/desktop/src/components/settings/SettingsView.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ describe('SettingsView', () => {

expect(screen.queryByTestId('settings-local-inference-tab')).not.toBeInTheDocument();
expect(screen.queryByTestId('settings-mesh-tab')).not.toBeInTheDocument();
expect(screen.queryByTestId('settings-sharing-tab')).not.toBeInTheDocument();
expect(screen.getByText('Models section')).toBeInTheDocument();
});
});
55 changes: 1 addition & 54 deletions ui/desktop/src/components/settings/SettingsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,13 @@ import { ScrollArea } from '../ui/scroll-area';
import { Tabs, TabsContent, TabsList, TabsTrigger } from '../ui/tabs';
import { View, ViewOptions } from '../../utils/navigationUtils';
import ModelsSection from './models/ModelsSection';
import SessionSharingSection from './sessions/SessionSharingSection';
import ExternalBackendSection from './app/ExternalBackendSection';
import AppSettingsSection from './app/AppSettingsSection';
import ConfigSettings from './config/ConfigSettings';
import PromptsSettingsSection from './PromptsSettingsSection';
import { ExtensionConfig } from '../../api';
import { MainPanelLayout } from '../Layout/MainPanelLayout';
import {
Bot,
Share2,
Monitor,
MessageSquare,
FileText,
Keyboard,
} from 'lucide-react';
import { Bot, Monitor, MessageSquare, FileText, Keyboard } from 'lucide-react';
import { useState, useEffect, useRef } from 'react';
import TunnelSection from './tunnel/TunnelSection';
import GatewaySettingsSection from './gateways/GatewaySettingsSection';
import { getTunnelStatus } from '../../api/sdk.gen';
import ChatSettingsSection from './chat/ChatSettingsSection';
import KeyboardShortcutsSection from './keyboard/KeyboardShortcutsSection';
import { CONFIGURATION_ENABLED } from '../../updates';
Expand All @@ -40,10 +28,6 @@ const i18n = defineMessages({
id: 'settingsView.tabChat',
defaultMessage: 'Chat',
},
tabSession: {
id: 'settingsView.tabSession',
defaultMessage: 'Session',
},
tabPrompts: {
id: 'settingsView.tabPrompts',
defaultMessage: 'Prompts',
Expand Down Expand Up @@ -75,7 +59,6 @@ export default function SettingsView({
viewOptions: SettingsViewOptions;
}) {
const [activeTab, setActiveTab] = useState('models');
const [tunnelDisabled, setTunnelDisabled] = useState(false);
const hasTrackedInitialTab = useRef(false);
const intl = useIntl();

Expand All @@ -92,14 +75,12 @@ export default function SettingsView({
update: 'app',
models: 'models',
modes: 'chat',
sharing: 'sharing',
styles: 'chat',
tools: 'chat',
app: 'app',
chat: 'chat',
prompts: 'prompts',
keyboard: 'keyboard',
gateway: 'sharing',
};

const targetTab = sectionToTab[viewOptions.section];
Expand All @@ -116,16 +97,6 @@ export default function SettingsView({
}
}, [activeTab]);

useEffect(() => {
getTunnelStatus()
.then(({ data }) => {
setTunnelDisabled(data?.state === 'disabled');
})
.catch(() => {
setTunnelDisabled(false);
});
}, []);

useEffect(() => {
const handleKeyDown = (event: KeyboardEvent) => {
if (event.key === 'Escape' && !event.defaultPrevented) {
Expand Down Expand Up @@ -172,14 +143,6 @@ export default function SettingsView({
<MessageSquare className="h-4 w-4" />
{intl.formatMessage(i18n.tabChat)}
</TabsTrigger>
<TabsTrigger
value="sharing"
className="flex gap-2"
data-testid="settings-sharing-tab"
>
<Share2 className="h-4 w-4" />
{intl.formatMessage(i18n.tabSession)}
</TabsTrigger>
<TabsTrigger
value="prompts"
className="flex gap-2"
Expand Down Expand Up @@ -218,22 +181,6 @@ export default function SettingsView({
<ChatSettingsSection sessionId={viewOptions.sessionId} />
</TabsContent>

<TabsContent
value="sharing"
className="mt-0 focus-visible:outline-none focus-visible:ring-0"
>
<div className="space-y-8 pb-8">
<SessionSharingSection />
<ExternalBackendSection />
{!tunnelDisabled && (
<div className="space-y-4">
<TunnelSection />
<GatewaySettingsSection />
</div>
)}
</div>
</TabsContent>

<TabsContent
value="prompts"
className="mt-0 focus-visible:outline-none focus-visible:ring-0"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* @vitest-environment jsdom
*/
import { render, screen } from '@testing-library/react';
import { describe, expect, it, vi } from 'vitest';
import ChatSettingsSection from './ChatSettingsSection';
import { IntlTestWrapper } from '../../../i18n/test-utils';

vi.mock('../mode/ModeSection', () => ({
ModeSection: () => <div>Mode section</div>,
}));

vi.mock('../dictation/DictationSettings', () => ({
DictationSettings: () => <div>Dictation settings</div>,
}));

vi.mock('./SpellcheckToggle', () => ({
SpellcheckToggle: () => <div>Spellcheck toggle</div>,
}));

vi.mock('../response_styles/ResponseStylesSection', () => ({
ResponseStylesSection: () => <div>Response styles section</div>,
}));

describe('ChatSettingsSection', () => {
it('hides project hints and prompt injection settings from ApeCloud builds', () => {
render(<ChatSettingsSection />, { wrapper: IntlTestWrapper });

expect(screen.getByText('Mode section')).toBeInTheDocument();
expect(screen.queryByText('Project Hints (.goosehints)')).not.toBeInTheDocument();
expect(screen.queryByText('Enable Prompt Injection Detection')).not.toBeInTheDocument();
});
});
13 changes: 0 additions & 13 deletions ui/desktop/src/components/settings/chat/ChatSettingsSection.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { ModeSection } from '../mode/ModeSection';
import { DictationSettings } from '../dictation/DictationSettings';
import { SecurityToggle } from '../security/SecurityToggle';
import { ResponseStylesSection } from '../response_styles/ResponseStylesSection';
import { GoosehintsSection } from './GoosehintsSection';
import { SpellcheckToggle } from './SpellcheckToggle';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '../../ui/card';
import { defineMessages, useIntl } from '../../../i18n';
Expand Down Expand Up @@ -41,12 +39,6 @@ export default function ChatSettingsSection({ sessionId }: { sessionId?: string
</CardContent>
</Card>

<Card className="pb-2 rounded-lg">
<CardContent className="px-2">
<GoosehintsSection />
</CardContent>
</Card>

<Card className="pb-2 rounded-lg">
<CardContent className="px-2">
<DictationSettings />
Expand All @@ -64,11 +56,6 @@ export default function ChatSettingsSection({ sessionId }: { sessionId?: string
</CardContent>
</Card>

<Card className="pb-2 rounded-lg">
<CardContent className="px-2">
<SecurityToggle />
</CardContent>
</Card>
</div>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const i18n = defineMessages({
helpText1: {
id: 'goosehintsModal.helpText1',
defaultMessage:
'.goosehints is a text file used to provide additional context about your project and improve the communication with Goose.',
'.goosehints is a text file used to provide additional context about your project and improve the communication with ApeMind.',
},
helpText2: {
id: 'goosehintsModal.helpText2',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const i18n = defineMessages({
description: {
id: 'goosehintsSection.description',
defaultMessage:
"Configure your project's .goosehints file to provide additional context to Goose",
"Configure your project's .goosehints file to provide additional context to ApeMind",
},
configure: {
id: 'goosehintsSection.configure',
Expand Down
7 changes: 2 additions & 5 deletions ui/desktop/src/i18n/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1353,7 +1353,7 @@
"defaultMessage": ".goosehints file found at: {filePath}"
},
"goosehintsModal.helpText1": {
"defaultMessage": ".goosehints is a text file used to provide additional context about your project and improve the communication with Goose."
"defaultMessage": ".goosehints is a text file used to provide additional context about your project and improve the communication with ApeMind."
},
"goosehintsModal.helpText2": {
"defaultMessage": "Please make sure {bold} extension is enabled in the extensions page. This extension is required to use .goosehints. You'll need to restart your session for .goosehints updates to take effect."
Expand All @@ -1380,7 +1380,7 @@
"defaultMessage": "Configure"
},
"goosehintsSection.description": {
"defaultMessage": "Configure your project's .goosehints file to provide additional context to Goose"
"defaultMessage": "Configure your project's .goosehints file to provide additional context to ApeMind"
},
"goosehintsSection.title": {
"defaultMessage": "Project Hints (.goosehints)"
Expand Down Expand Up @@ -4184,9 +4184,6 @@
"settingsView.tabPrompts": {
"defaultMessage": "Prompts"
},
"settingsView.tabSession": {
"defaultMessage": "Session"
},
"settingsView.title": {
"defaultMessage": "Settings"
},
Expand Down
7 changes: 2 additions & 5 deletions ui/desktop/src/i18n/messages/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@
"defaultMessage": "已找到 .goosehints 文件:{filePath}"
},
"goosehintsModal.helpText1": {
"defaultMessage": ".goosehints 是一个文本文件,用于为你的项目提供额外上下文,改善与 Goose 的沟通。"
"defaultMessage": ".goosehints 是一个文本文件,用于为你的项目提供额外上下文,改善与 ApeMind 的沟通。"
},
"goosehintsModal.helpText2": {
"defaultMessage": "请确认已在扩展页面启用 {bold} 扩展。此扩展是使用 .goosehints 所必需的。你需要重启会话,.goosehints 的更新才会生效。"
Expand All @@ -1329,7 +1329,7 @@
"defaultMessage": "配置"
},
"goosehintsSection.description": {
"defaultMessage": "配置项目的 .goosehints 文件,为 Goose 提供额外上下文"
"defaultMessage": "配置项目的 .goosehints 文件,为 ApeMind 提供额外上下文"
},
"goosehintsSection.title": {
"defaultMessage": "项目提示(.goosehints)"
Expand Down Expand Up @@ -4097,9 +4097,6 @@
"settingsView.tabPrompts": {
"defaultMessage": "提示词"
},
"settingsView.tabSession": {
"defaultMessage": "会话"
},
"settingsView.title": {
"defaultMessage": "设置"
},
Expand Down
Loading