feat(desktop): collapse thinking by default and add a setting for it (#12660)

Signed-off-by: Seydi Charyyev <seydi.charyev@gmail.com>
This commit is contained in:
Seydi Charyyev
2026-11-02 04:27:38 +00:00
committed by GitHub
parent b23d21cabd
commit 0909288ed4
30 changed files with 501 additions and 23 deletions
@@ -1740,7 +1740,7 @@ Some models expose their internal reasoning or "chain of thought" as part of the
<Tabs groupId="interface">
<TabItem value="ui" label="goose Desktop" default>
Reasoning output appears automatically in a collapsible **"Show reasoning"** toggle above the model's response. Click it to expand and view the model's thought process.
Reasoning output appears in a collapsible **Thinking** block above the model's response. Click it to expand and view the model's thought process. To change this, set `Show Thinking` in `Settings` > `Chat` to `Always` (open), `Collapsed` (default), or `Never` (hidden).
</TabItem>
<TabItem value="cli" label="goose CLI">
@@ -84,7 +84,7 @@ export CLAUDE_THINKING_TYPE=disabled
```
:::tip Viewing Thinking Output
To see Claude's thinking output in the **CLI**, you also need to set `GOOSE_CLI_SHOW_THINKING=1`. In **goose Desktop**, thinking output is shown automatically in a collapsible "Show reasoning" toggle.
To see Claude's thinking output in the **CLI**, you also need to set `GOOSE_CLI_SHOW_THINKING=1`. In **goose Desktop**, thinking output is shown in a collapsible **Thinking** block; you can change this with `Show Thinking` in `Settings` > `Chat`.
:::
### Provider Retries
@@ -5,7 +5,7 @@ import type { Message } from '../types/message';
import GooseMessage from './GooseMessage';
describe('GooseMessage', () => {
it('renders operation details for a thinking-only message', () => {
it('renders operation details for a thinking-only message', async () => {
const message: Message = {
content: [{ type: 'thinking', thinking: 'Working it out', signature: '' }],
created: 1,
@@ -31,7 +31,7 @@ describe('GooseMessage', () => {
{ wrapper: IntlTestWrapper }
);
expect(screen.getByText('Thinking')).toBeInTheDocument();
expect(await screen.findByText('Thinking')).toBeInTheDocument();
expect(screen.getByLabelText('ops_auto_effort: thinking high')).toBeInTheDocument();
});
});
@@ -0,0 +1,100 @@
import { act, render, screen, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { afterEach, describe, expect, it } from 'vitest';
import GooseMessage from './GooseMessage';
import { AppEvents } from '../constants/events';
import { IntlTestWrapper } from '../i18n/test-utils';
import type { Message, MessageContent } from '../types/message';
import type { ShowThinking } from '../utils/settings';
const thought = 'Comparing the two options';
const answer = 'Use the second option';
const thinking: MessageContent = { type: 'thinking', thinking: thought, signature: '' };
const text: MessageContent = { type: 'text', text: answer };
function messageElement(content: MessageContent[], isStreaming: boolean) {
const message: Message = {
id: 'msg-1',
role: 'assistant',
created: 1_790_000_000,
content,
metadata: { agentVisible: true, userVisible: true },
};
return (
<GooseMessage
sessionId="session-1"
message={message}
hideTimestamp={false}
toolStates={[]}
toolNotifications={[]}
toolConfirmationShownInline={false}
append={() => {}}
isStreaming={isStreaming}
/>
);
}
function renderMessage(content: MessageContent[], isStreaming: boolean) {
return render(messageElement(content, isStreaming), { wrapper: IntlTestWrapper });
}
function setShowThinking(value: ShowThinking) {
return window.electron.setSetting('showThinking', value);
}
const findThinking = () => screen.findByRole('button', { name: 'Thinking' });
const queryThinking = () => screen.queryByRole('button', { name: 'Thinking' });
describe('GooseMessage thinking block', () => {
afterEach(() => setShowThinking('collapsed'));
it('stays collapsed while the model is still thinking', async () => {
renderMessage([thinking], true);
expect(await findThinking()).toHaveAttribute('aria-expanded', 'false');
expect(screen.queryByText(thought)).not.toBeInTheDocument();
});
it('keeps a block the user opened open after the answer starts', async () => {
const user = userEvent.setup();
const { rerender } = renderMessage([thinking], true);
await user.click(await findThinking());
expect(await findThinking()).toHaveAttribute('aria-expanded', 'true');
rerender(messageElement([thinking, text], true));
expect(await screen.findByText(answer)).toBeInTheDocument();
expect(await findThinking()).toHaveAttribute('aria-expanded', 'true');
expect(screen.getByText(thought)).toBeInTheDocument();
});
it('stays open after the answer starts when set to always', async () => {
await setShowThinking('always');
renderMessage([thinking, text], true);
expect(await findThinking()).toHaveAttribute('aria-expanded', 'true');
expect(screen.getByText(thought)).toBeInTheDocument();
});
it('is not shown when set to never', async () => {
await setShowThinking('never');
renderMessage([thinking, text], false);
expect(queryThinking()).not.toBeInTheDocument();
await act(async () => {});
expect(await screen.findByText(answer)).toBeInTheDocument();
expect(queryThinking()).not.toBeInTheDocument();
});
it('follows a setting change in an open chat', async () => {
renderMessage([thinking, text], false);
expect(await findThinking()).toBeInTheDocument();
await setShowThinking('never');
window.dispatchEvent(new CustomEvent(AppEvents.SHOW_THINKING_CHANGED));
await waitFor(() => expect(queryThinking()).not.toBeInTheDocument());
});
});
+1 -9
View File
@@ -101,15 +101,7 @@ function GooseMessage({
<div className="flex flex-col w-full min-w-0">
{thinkingContent && (
<div className="group">
<ThinkingContent
content={thinkingContent}
isExpanded={
isStreaming &&
!displayText.trim() &&
imagePaths.length === 0 &&
toolRequests.length === 0
}
/>
<ThinkingContent content={thinkingContent} />
{!displayText.trim() && imagePaths.length === 0 && toolRequests.length === 0 && (
<div className="relative flex items-center justify-between">
<div
+22 -10
View File
@@ -1,25 +1,37 @@
import { useState, useEffect, useRef } from 'react';
import { useState, useEffect } from 'react';
import MarkdownContent from './MarkdownContent';
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from './ui/collapsible';
import Expand from './ui/Expand';
import { AppEvents } from '../constants/events';
import type { ShowThinking } from '../utils/settings';
interface ThinkingContentProps {
content: string;
isExpanded: boolean;
}
export default function ThinkingContent({ content, isExpanded }: ThinkingContentProps) {
export default function ThinkingContent({ content }: ThinkingContentProps) {
const [showThinking, setShowThinking] = useState<ShowThinking | null>(null);
const [manualToggle, setManualToggle] = useState<boolean | null>(null);
const prevIsExpanded = useRef(isExpanded);
useEffect(() => {
if (prevIsExpanded.current && !isExpanded) {
setManualToggle(null);
}
prevIsExpanded.current = isExpanded;
}, [isExpanded]);
const loadShowThinking = () => {
window.electron.getSetting('showThinking').then(setShowThinking);
};
const expanded = manualToggle !== null ? manualToggle : isExpanded;
loadShowThinking();
window.addEventListener(AppEvents.SHOW_THINKING_CHANGED, loadShowThinking);
return () => {
window.removeEventListener(AppEvents.SHOW_THINKING_CHANGED, loadShowThinking);
};
}, []);
// Wait for the setting so 'never' and 'always' do not flash a collapsed block.
if (showThinking === null || showThinking === 'never') {
return null;
}
const expanded = manualToggle !== null ? manualToggle : showThinking === 'always';
return (
<Collapsible open={expanded} onOpenChange={(open) => setManualToggle(open)} className="mb-2">
@@ -2,6 +2,7 @@ import { ModeSection } from '../mode/ModeSection';
import { DictationSettings } from '../dictation/DictationSettings';
import { SecurityToggle } from '../security/SecurityToggle';
import { ResponseStylesSection } from '../response_styles/ResponseStylesSection';
import { ShowThinkingSetting } from '../response_styles/ShowThinkingSetting';
import { GoosehintsSection } from './GoosehintsSection';
import { LiveVoiceSettings } from './LiveVoiceSettings';
import { SpellcheckToggle } from './SpellcheckToggle';
@@ -64,6 +65,7 @@ export default function ChatSettingsSection() {
</CardHeader>
<CardContent className="px-2">
<ResponseStylesSection />
<ShowThinkingSetting />
</CardContent>
</Card>
@@ -0,0 +1,41 @@
import { act, render, screen, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { afterEach, describe, expect, it, onTestFinished, vi } from 'vitest';
import { ShowThinkingSetting } from './ShowThinkingSetting';
import { AppEvents } from '../../../constants/events';
import { IntlTestWrapper } from '../../../i18n/test-utils';
describe('ShowThinkingSetting', () => {
afterEach(() => window.electron.setSetting('showThinking', 'collapsed'));
it('saves the chosen option and notifies open chats', async () => {
const user = userEvent.setup();
const onChange = vi.fn();
window.addEventListener(AppEvents.SHOW_THINKING_CHANGED, onChange);
onTestFinished(() => window.removeEventListener(AppEvents.SHOW_THINKING_CHANGED, onChange));
render(<ShowThinkingSetting />, { wrapper: IntlTestWrapper });
await user.click(await screen.findByRole('button', { name: 'Collapsed' }));
await user.click(await screen.findByRole('menuitemradio', { name: 'Never' }));
await waitFor(() => expect(onChange).toHaveBeenCalledTimes(1));
expect(window.electron.setSetting).toHaveBeenLastCalledWith('showThinking', 'never');
expect(screen.getByRole('button', { name: 'Never' })).toBeInTheDocument();
});
it('shows the saved option', async () => {
await window.electron.setSetting('showThinking', 'always');
render(<ShowThinkingSetting />, { wrapper: IntlTestWrapper });
expect(await screen.findByRole('button', { name: 'Always' })).toBeInTheDocument();
});
it('shows Collapsed for a value it does not know', async () => {
vi.mocked(window.electron.getSetting).mockResolvedValueOnce(false);
await act(async () => {
render(<ShowThinkingSetting />, { wrapper: IntlTestWrapper });
});
expect(screen.getByRole('button', { name: 'Collapsed' })).toBeInTheDocument();
});
});
@@ -0,0 +1,83 @@
import { useEffect, useState } from 'react';
import { ChevronDown } from 'lucide-react';
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuRadioGroup,
DropdownMenuRadioItem,
DropdownMenuTrigger,
} from '../../ui/dropdown-menu';
import { AppEvents } from '../../../constants/events';
import { defineMessages, useIntl } from '../../../i18n';
import type { ShowThinking } from '../../../utils/settings';
const i18n = defineMessages({
title: {
id: 'showThinkingSetting.title',
defaultMessage: 'Show Thinking',
},
description: {
id: 'showThinkingSetting.description',
defaultMessage:
'Show the model\'s thinking in chat. "Collapsed" keeps it closed until you open it.',
},
always: {
id: 'showThinkingSetting.always',
defaultMessage: 'Always',
},
collapsed: {
id: 'showThinkingSetting.collapsed',
defaultMessage: 'Collapsed',
},
never: {
id: 'showThinkingSetting.never',
defaultMessage: 'Never',
},
});
const options: ShowThinking[] = ['always', 'collapsed', 'never'];
export const ShowThinkingSetting = () => {
const intl = useIntl();
const [showThinking, setShowThinking] = useState<ShowThinking>('collapsed');
useEffect(() => {
// settings.json can be edited by hand; show unknown values as 'collapsed', like ThinkingContent does.
window.electron.getSetting('showThinking').then((value) => {
setShowThinking(options.includes(value) ? value : 'collapsed');
});
}, []);
const handleChange = async (value: string) => {
const newValue = value as ShowThinking;
setShowThinking(newValue);
await window.electron.setSetting('showThinking', newValue);
window.dispatchEvent(new CustomEvent(AppEvents.SHOW_THINKING_CHANGED));
};
return (
<div className="flex items-center justify-between py-2 px-2 hover:bg-background-secondary rounded-lg transition-all">
<div>
<h3 className="text-text-primary">{intl.formatMessage(i18n.title)}</h3>
<p className="text-xs text-text-secondary max-w-md mt-[2px]">
{intl.formatMessage(i18n.description)}
</p>
</div>
<DropdownMenu>
<DropdownMenuTrigger className="flex items-center gap-2 px-3 py-1.5 text-sm border border-border-primary rounded-md hover:border-border-primary transition-colors text-text-primary bg-background-primary">
{intl.formatMessage(i18n[showThinking])}
<ChevronDown className="w-4 h-4" />
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuRadioGroup value={showThinking} onValueChange={handleChange}>
{options.map((option) => (
<DropdownMenuRadioItem key={option} value={option}>
{intl.formatMessage(i18n[option])}
</DropdownMenuRadioItem>
))}
</DropdownMenuRadioGroup>
</DropdownMenuContent>
</DropdownMenu>
</div>
);
};
+1
View File
@@ -12,4 +12,5 @@ export enum AppEvents {
CLEAR_INITIAL_MESSAGE = 'clear-initial-message',
SCROLL_CHAT_TO_BOTTOM = 'scroll-chat-to-bottom',
RESPONSE_STYLE_CHANGED = 'responseStyleChanged',
SHOW_THINKING_CHANGED = 'showThinkingChanged',
}
+15
View File
@@ -4130,6 +4130,21 @@
"shortcutRecorder.save": {
"defaultMessage": "Speichern"
},
"showThinkingSetting.always": {
"defaultMessage": "Immer"
},
"showThinkingSetting.collapsed": {
"defaultMessage": "Eingeklappt"
},
"showThinkingSetting.description": {
"defaultMessage": "Das Nachdenken des Modells im Chat anzeigen. Bei „Eingeklappt“ bleibt es geschlossen, bis Sie es öffnen."
},
"showThinkingSetting.never": {
"defaultMessage": "Nie"
},
"showThinkingSetting.title": {
"defaultMessage": "Nachdenken anzeigen"
},
"skillsView.addSkill": {
"defaultMessage": "Skill hinzufügen"
},
+15
View File
@@ -4325,6 +4325,21 @@
"shortcutRecorder.save": {
"defaultMessage": "Save"
},
"showThinkingSetting.always": {
"defaultMessage": "Always"
},
"showThinkingSetting.collapsed": {
"defaultMessage": "Collapsed"
},
"showThinkingSetting.description": {
"defaultMessage": "Show the model's thinking in chat. \"Collapsed\" keeps it closed until you open it."
},
"showThinkingSetting.never": {
"defaultMessage": "Never"
},
"showThinkingSetting.title": {
"defaultMessage": "Show Thinking"
},
"skillsView.addSkill": {
"defaultMessage": "Add Skill"
},
+15
View File
@@ -4130,6 +4130,21 @@
"shortcutRecorder.save": {
"defaultMessage": "Guardar"
},
"showThinkingSetting.always": {
"defaultMessage": "Siempre"
},
"showThinkingSetting.collapsed": {
"defaultMessage": "Contraído"
},
"showThinkingSetting.description": {
"defaultMessage": "Muestra el pensamiento del modelo en el chat. Con \"Contraído\", se queda cerrado hasta que lo abras."
},
"showThinkingSetting.never": {
"defaultMessage": "Nunca"
},
"showThinkingSetting.title": {
"defaultMessage": "Mostrar pensamiento"
},
"skillsView.addSkill": {
"defaultMessage": "Agregar Skill"
},
+15
View File
@@ -4130,6 +4130,21 @@
"shortcutRecorder.save": {
"defaultMessage": "Enregistrer"
},
"showThinkingSetting.always": {
"defaultMessage": "Toujours"
},
"showThinkingSetting.collapsed": {
"defaultMessage": "Réduite"
},
"showThinkingSetting.description": {
"defaultMessage": "Afficher la réflexion du modèle dans la discussion. Avec « Réduite », elle reste fermée jusqu'à ce que vous l'ouvriez."
},
"showThinkingSetting.never": {
"defaultMessage": "Jamais"
},
"showThinkingSetting.title": {
"defaultMessage": "Afficher la réflexion"
},
"skillsView.addSkill": {
"defaultMessage": "Ajouter une compétence"
},
+15
View File
@@ -4130,6 +4130,21 @@
"shortcutRecorder.save": {
"defaultMessage": "सहेजें"
},
"showThinkingSetting.always": {
"defaultMessage": "हमेशा"
},
"showThinkingSetting.collapsed": {
"defaultMessage": "क्लिक करने पर"
},
"showThinkingSetting.description": {
"defaultMessage": "चैट में मॉडल की सोच दिखाएँ। \"क्लिक करने पर\" विकल्प में यह तब तक बंद रहती है जब तक आप इसे खोलते नहीं।"
},
"showThinkingSetting.never": {
"defaultMessage": "कभी नहीं"
},
"showThinkingSetting.title": {
"defaultMessage": "सोच दिखाएँ"
},
"skillsView.addSkill": {
"defaultMessage": "कौशल जोड़ें"
},
+15
View File
@@ -4130,6 +4130,21 @@
"shortcutRecorder.save": {
"defaultMessage": "Simpan"
},
"showThinkingSetting.always": {
"defaultMessage": "Selalu"
},
"showThinkingSetting.collapsed": {
"defaultMessage": "Diciutkan"
},
"showThinkingSetting.description": {
"defaultMessage": "Tampilkan pemikiran model di obrolan. Dengan opsi \"Diciutkan\", pemikiran tetap tertutup sampai Anda membukanya."
},
"showThinkingSetting.never": {
"defaultMessage": "Tidak pernah"
},
"showThinkingSetting.title": {
"defaultMessage": "Tampilkan Pemikiran"
},
"skillsView.addSkill": {
"defaultMessage": "Tambah Keterampilan"
},
+15
View File
@@ -4130,6 +4130,21 @@
"shortcutRecorder.save": {
"defaultMessage": "Salva"
},
"showThinkingSetting.always": {
"defaultMessage": "Sempre"
},
"showThinkingSetting.collapsed": {
"defaultMessage": "Compresso"
},
"showThinkingSetting.description": {
"defaultMessage": "Mostra il ragionamento del modello nella chat. Con \"Compresso\", resta chiuso finché non lo apri."
},
"showThinkingSetting.never": {
"defaultMessage": "Mai"
},
"showThinkingSetting.title": {
"defaultMessage": "Mostra ragionamento"
},
"skillsView.addSkill": {
"defaultMessage": "Aggiungi competenza"
},
+15
View File
@@ -4130,6 +4130,21 @@
"shortcutRecorder.save": {
"defaultMessage": "保存"
},
"showThinkingSetting.always": {
"defaultMessage": "常に展開"
},
"showThinkingSetting.collapsed": {
"defaultMessage": "折りたたむ"
},
"showThinkingSetting.description": {
"defaultMessage": "チャットにモデルの思考を表示します。「折りたたむ」を選択すると、開くまで閉じたままです。"
},
"showThinkingSetting.never": {
"defaultMessage": "表示しない"
},
"showThinkingSetting.title": {
"defaultMessage": "思考を表示"
},
"skillsView.addSkill": {
"defaultMessage": "スキルを追加"
},
+15
View File
@@ -4130,6 +4130,21 @@
"shortcutRecorder.save": {
"defaultMessage": "저장"
},
"showThinkingSetting.always": {
"defaultMessage": "항상 펼치기"
},
"showThinkingSetting.collapsed": {
"defaultMessage": "접기"
},
"showThinkingSetting.description": {
"defaultMessage": "채팅에 모델의 추론을 표시합니다. \"접기\"를 선택하면 직접 열기 전까지 닫혀 있습니다."
},
"showThinkingSetting.never": {
"defaultMessage": "표시 안 함"
},
"showThinkingSetting.title": {
"defaultMessage": "추론 표시"
},
"skillsView.addSkill": {
"defaultMessage": "스킬 추가"
},
+15
View File
@@ -4130,6 +4130,21 @@
"shortcutRecorder.save": {
"defaultMessage": "Simpan"
},
"showThinkingSetting.always": {
"defaultMessage": "Sentiasa"
},
"showThinkingSetting.collapsed": {
"defaultMessage": "Diruntuhkan"
},
"showThinkingSetting.description": {
"defaultMessage": "Tunjukkan pemikiran model dalam sembang. Dengan pilihan \"Diruntuhkan\", pemikiran kekal tertutup sehingga anda membukanya."
},
"showThinkingSetting.never": {
"defaultMessage": "Tidak pernah"
},
"showThinkingSetting.title": {
"defaultMessage": "Tunjukkan Pemikiran"
},
"skillsView.addSkill": {
"defaultMessage": "Tambah Kemahiran"
},
+15
View File
@@ -4130,6 +4130,21 @@
"shortcutRecorder.save": {
"defaultMessage": "Guardar"
},
"showThinkingSetting.always": {
"defaultMessage": "Sempre"
},
"showThinkingSetting.collapsed": {
"defaultMessage": "Recolhido"
},
"showThinkingSetting.description": {
"defaultMessage": "Mostrar o raciocínio do modelo na conversa. Com \"Recolhido\", fica fechado até ser aberto."
},
"showThinkingSetting.never": {
"defaultMessage": "Nunca"
},
"showThinkingSetting.title": {
"defaultMessage": "Mostrar Raciocínio"
},
"skillsView.addSkill": {
"defaultMessage": "Adicionar Competência"
},
+15
View File
@@ -4130,6 +4130,21 @@
"shortcutRecorder.save": {
"defaultMessage": "Сохранить"
},
"showThinkingSetting.always": {
"defaultMessage": "Всегда"
},
"showThinkingSetting.collapsed": {
"defaultMessage": "Свёрнуто"
},
"showThinkingSetting.description": {
"defaultMessage": "Показывать размышления модели в чате. В режиме «Свёрнуто» блок закрыт, пока вы его не откроете."
},
"showThinkingSetting.never": {
"defaultMessage": "Никогда"
},
"showThinkingSetting.title": {
"defaultMessage": "Показывать размышления"
},
"skillsView.addSkill": {
"defaultMessage": "Добавить навык"
},
+15
View File
@@ -4130,6 +4130,21 @@
"shortcutRecorder.save": {
"defaultMessage": "Kaydet"
},
"showThinkingSetting.always": {
"defaultMessage": "Her zaman"
},
"showThinkingSetting.collapsed": {
"defaultMessage": "Daraltılmış"
},
"showThinkingSetting.description": {
"defaultMessage": "Modelin düşünmesini sohbette gösterin. \"Daraltılmış\" seçeneğinde, siz açana kadar kapalı kalır."
},
"showThinkingSetting.never": {
"defaultMessage": "Asla"
},
"showThinkingSetting.title": {
"defaultMessage": "Düşünmeyi Göster"
},
"skillsView.addSkill": {
"defaultMessage": "Beceri Ekle"
},
+15
View File
@@ -4130,6 +4130,21 @@
"shortcutRecorder.save": {
"defaultMessage": "Lưu"
},
"showThinkingSetting.always": {
"defaultMessage": "Luôn luôn"
},
"showThinkingSetting.collapsed": {
"defaultMessage": "Thu gọn"
},
"showThinkingSetting.description": {
"defaultMessage": "Hiển thị suy nghĩ của mô hình trong cuộc trò chuyện. Với \"Thu gọn\", phần này sẽ đóng cho đến khi bạn mở ra."
},
"showThinkingSetting.never": {
"defaultMessage": "Không bao giờ"
},
"showThinkingSetting.title": {
"defaultMessage": "Hiển thị suy nghĩ"
},
"skillsView.addSkill": {
"defaultMessage": "Thêm kỹ năng"
},
+15
View File
@@ -4130,6 +4130,21 @@
"shortcutRecorder.save": {
"defaultMessage": "保存"
},
"showThinkingSetting.always": {
"defaultMessage": "始终展开"
},
"showThinkingSetting.collapsed": {
"defaultMessage": "折叠"
},
"showThinkingSetting.description": {
"defaultMessage": "在聊天中显示模型的思考过程。选择“折叠”时,它会保持收起,直到你展开。"
},
"showThinkingSetting.never": {
"defaultMessage": "不显示"
},
"showThinkingSetting.title": {
"defaultMessage": "显示思考过程"
},
"skillsView.addSkill": {
"defaultMessage": "添加技能"
},
+15
View File
@@ -4130,6 +4130,21 @@
"shortcutRecorder.save": {
"defaultMessage": "儲存"
},
"showThinkingSetting.always": {
"defaultMessage": "一律展開"
},
"showThinkingSetting.collapsed": {
"defaultMessage": "收合"
},
"showThinkingSetting.description": {
"defaultMessage": "在聊天中顯示模型的思考過程。選擇「收合」時,會保持收合,直到您展開為止。"
},
"showThinkingSetting.never": {
"defaultMessage": "不顯示"
},
"showThinkingSetting.title": {
"defaultMessage": "顯示思考過程"
},
"skillsView.addSkill": {
"defaultMessage": "新增技能"
},
+1
View File
@@ -1938,6 +1938,7 @@ const validSettingKeys: Set<string> = new Set([
'seenAnnouncementIds',
'disableAutoDownload',
'recentModels',
'showThinking',
]);
ipcMain.handle('set-setting', (_event, key: SettingKey, value: unknown) => {
+1
View File
@@ -71,6 +71,7 @@ const mockSettings: Record<string, unknown> = {
responseStyle: 'concise',
showPricing: true,
seenAnnouncementIds: [],
showThinking: 'collapsed',
};
// Mock window.electron for renderer process
+4
View File
@@ -34,6 +34,8 @@ export type LanguageSetting =
| 'system' | 'en' | 'es' | 'fr' | 'de' | 'it' | 'pt' | 'id' | 'ms' | 'vi'
| 'hi' | 'ja' | 'ko' | 'ru' | 'tr' | 'zh-CN' | 'zh-TW';
export type ShowThinking = 'always' | 'collapsed' | 'never';
export interface Settings {
// Desktop app settings
showMenuBarIcon: boolean;
@@ -55,6 +57,7 @@ export interface Settings {
showPricing: boolean;
seenAnnouncementIds: string[];
recentModels: RecentModel[];
showThinking: ShowThinking;
}
export type SettingKey = keyof Settings;
@@ -96,6 +99,7 @@ export const defaultSettings: Settings = {
showPricing: true,
seenAnnouncementIds: [],
recentModels: [],
showThinking: 'collapsed',
};
export function getKeyboardShortcuts(settings: Settings): KeyboardShortcuts {
+1
View File
@@ -59,6 +59,7 @@ declare global {
sessionId: string;
}>;
responseStyleChanged: CustomEvent;
showThinkingChanged: CustomEvent;
'session-created': CustomEvent<{ session?: import('./types/session').Session }>;
'session-deleted': CustomEvent<{ sessionId: string }>;
'session-renamed': CustomEvent<{