From f634471053557791a7f5a48eb13858f84222da0a Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 5 Aug 2026 02:23:38 -0500 Subject: [PATCH] refac --- .../src/lib/components/chat/ChatInput.svelte | 34 ++++++++++++++++++- .../components/common/ModelSelector.svelte | 22 ++++++++---- cptr/frontend/src/lib/i18n/locales/en.json | 2 ++ 3 files changed, 50 insertions(+), 8 deletions(-) diff --git a/cptr/frontend/src/lib/components/chat/ChatInput.svelte b/cptr/frontend/src/lib/components/chat/ChatInput.svelte index 79a8e94..01420ae 100644 --- a/cptr/frontend/src/lib/components/chat/ChatInput.svelte +++ b/cptr/frontend/src/lib/components/chat/ChatInput.svelte @@ -142,6 +142,7 @@ let voiceCaptureChunks: Blob[] = []; let voiceCaptureMimeType = 'audio/webm'; let selectedSlashCommandIndex = $state(0); + let modelSelector: ModelSelector | undefined = $state(); const voiceModeAvailable = $derived( $ttsEnabled && $ttsConfigured && ($voiceModeSttMode === 'browser' || $sttConfigured) ); @@ -979,6 +980,7 @@ if (onplan && '/plan'.startsWith(slashCommandQuery)) ids.push('plan'); if (hasChatContent && onfork && '/fork'.startsWith(slashCommandQuery)) ids.push('fork'); if (hasChatContent && onstatus && '/status'.startsWith(slashCommandQuery)) ids.push('status'); + if ('/model'.startsWith(slashCommandQuery)) ids.push('model'); if ( hasChatContent && onskillslist && @@ -1093,6 +1095,11 @@ onstatus(); return; } + if (commandId === 'model') { + inputText = ''; + void modelSelector?.openSelector(); + return; + } if (commandId === 'skills:list' && onskillslist) { inputText = ''; onskillslist(); @@ -1331,6 +1338,31 @@ {/if} + {#if slashCommandIds.includes('model')} + + {/if} {#if slashCommandIds.includes('skills:list')}