From c7dd200b3749f98ecd01c6766cf7b24688326e1d Mon Sep 17 00:00:00 2001 From: Aleksander Grygier Date: Wed, 26 Aug 2026 20:34:23 +0200 Subject: [PATCH] ui: align preferences section headers with their methods The Reasoning Effort and Working Directory headers sat above tool policy methods; move them above setCwd and setReasoningEffort. Also clarify the disabled tools JSDoc: existing rows with an unset field have an empty policy, defaults apply only when there is no active conversation. Assisted-by: pi --- .../conversations/preferences.svelte.ts | 44 +++++++++++-------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/tools/ui/src/lib/stores/conversations/preferences.svelte.ts b/tools/ui/src/lib/stores/conversations/preferences.svelte.ts index 8106a0d85a..5e75f1d7c6 100644 --- a/tools/ui/src/lib/stores/conversations/preferences.svelte.ts +++ b/tools/ui/src/lib/stores/conversations/preferences.svelte.ts @@ -49,12 +49,20 @@ export interface ConversationsPreferencesHost { applyConversationUpdate(id: string, updates: Partial): void; } -/** Effective disabled tool keys: conversation row, falling back to defaults. */ +/** + * Effective disabled tool keys: the active conversation row, or the global + * defaults when there is no conversation. An existing row with an unset + * field has an empty policy, not a fallback to defaults. + */ function buildDisabledTools(conv: DatabaseConversation | null): Set { return new Set(conv ? (conv.disabledTools ?? []) : [...toolsStore.disabledTools]); } -/** Effective disabled tool categories: conversation row, falling back to defaults. */ +/** + * Effective disabled tool categories: the active conversation row, or the + * global defaults when there is no conversation. An existing row with an + * unset field has an empty policy, not a fallback to defaults. + */ function buildDisabledToolCategories(conv: DatabaseConversation | null): Set { return new Set( conv ? (conv.disabledToolCategories ?? []) : [...toolsStore.disabledToolCategories] @@ -184,6 +192,14 @@ export class ConversationPreferences { this.pendingCwd = null; } + /** + * + * + * Working Directory + * + * + */ + /** * Sets the working directory for the active conversation. Pass `null` or * an empty string to clear it, which restores the picker's empty state. @@ -217,6 +233,14 @@ export class ConversationPreferences { this.pendingCwd = null; } + /** + * + * + * Reasoning Effort + * + * + */ + /** * Sets the reasoning effort for the active conversation. * If no conversation exists, stores the global default. @@ -268,14 +292,6 @@ export class ConversationPreferences { await this.toggleTool(toolsStore.getMcpServerToolsKey(serverId)); } - /** - * - * - * Reasoning Effort - * - * - */ - async toggleTool(key: string): Promise { const conv: DatabaseConversation | null = this.host.activeConversation; @@ -305,14 +321,6 @@ export class ConversationPreferences { await DatabaseService.updateConversation(conv.id, { disabledToolCategories }); } - /** - * - * - * Working Directory - * - * - */ - private async persistDisabledTools(disabled: Set): Promise { const conv = this.host.activeConversation;