diff --git a/webview-ui/src/App.tsx b/webview-ui/src/App.tsx index 59a4047251..b6ddc1883e 100644 --- a/webview-ui/src/App.tsx +++ b/webview-ui/src/App.tsx @@ -46,6 +46,8 @@ const App = () => { const settingsRef = useRef(null) const switchTab = useCallback((newTab: Tab) => { + setCurrentSection(undefined) + if (settingsRef.current?.checkUnsaveChanges) { settingsRef.current.checkUnsaveChanges(() => setTab(newTab)) } else { @@ -53,15 +55,19 @@ const App = () => { } }, []) + const [currentSection, setCurrentSection] = useState(undefined) + const onMessage = useCallback( (e: MessageEvent) => { const message: ExtensionMessage = e.data if (message.type === "action" && message.action) { const newTab = tabsByMessageAction[message.action] + const section = message.values?.section as string | undefined if (newTab) { switchTab(newTab) + setCurrentSection(section) } } @@ -104,7 +110,9 @@ const App = () => { {tab === "prompts" && switchTab("chat")} />} {tab === "mcp" && switchTab("chat")} />} {tab === "history" && switchTab("chat")} />} - {tab === "settings" && setTab("chat")} />} + {tab === "settings" && ( + switchTab("chat")} targetSection={currentSection} /> + )} { }, [alwaysApproveResubmit, setAlwaysApproveResubmit]) const handleOpenSettings = useCallback(() => { - window.postMessage({ type: "action", action: "settingsButtonClicked" }) + window.postMessage({ + type: "action", + action: "settingsButtonClicked", + values: { section: "autoApprove" }, + }) }, []) // Map action IDs to their specific handlers diff --git a/webview-ui/src/components/chat/ChatTextArea.tsx b/webview-ui/src/components/chat/ChatTextArea.tsx index 6f82da00d7..2c9c2fbc83 100644 --- a/webview-ui/src/components/chat/ChatTextArea.tsx +++ b/webview-ui/src/components/chat/ChatTextArea.tsx @@ -1028,7 +1028,11 @@ const ChatTextArea = forwardRef( ]} onChange={(value) => { if (value === "settingsButtonClicked") { - vscode.postMessage({ type: "loadApiConfiguration", text: value }) + vscode.postMessage({ + type: "loadApiConfiguration", + text: value, + values: { section: "providers" }, + }) } else { vscode.postMessage({ type: "loadApiConfigurationById", text: value }) } diff --git a/webview-ui/src/components/chat/ChatView.tsx b/webview-ui/src/components/chat/ChatView.tsx index 85ce7cd1cb..1b33c2003f 100644 --- a/webview-ui/src/components/chat/ChatView.tsx +++ b/webview-ui/src/components/chat/ChatView.tsx @@ -32,7 +32,7 @@ import { getAllModes } from "../../../../src/shared/modes" import TelemetryBanner from "../common/TelemetryBanner" import { useAppTranslation } from "@/i18n/TranslationContext" import removeMd from "remove-markdown" - +import { Trans } from "react-i18next" interface ChatViewProps { isHidden: boolean showAnnouncement: boolean @@ -1006,17 +1006,28 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
- Still initializing checkpoint... If this takes too long, you can{" "} - { - e.preventDefault() - window.postMessage({ type: "action", action: "settingsButtonClicked" }, "*") + { + e.preventDefault() + window.postMessage( + { + type: "action", + action: "settingsButtonClicked", + values: { section: "checkpoints" }, + }, + "*", + ) + }} + className="inline px-0.5" + /> + ), }} - className="inline px-0.5"> - disable checkpoints in settings - {" "} - and restart your task. + />
), diff --git a/webview-ui/src/components/common/TelemetryBanner.tsx b/webview-ui/src/components/common/TelemetryBanner.tsx index 8d96359aca..b27c6a1efb 100644 --- a/webview-ui/src/components/common/TelemetryBanner.tsx +++ b/webview-ui/src/components/common/TelemetryBanner.tsx @@ -40,7 +40,11 @@ const TelemetryBanner = () => { } const handleOpenSettings = () => { - window.postMessage({ type: "action", action: "settingsButtonClicked" }) + window.postMessage({ + type: "action", + action: "settingsButtonClicked", + values: { section: "advanced" }, // Link directly to advanced settings with telemetry controls + }) } return ( diff --git a/webview-ui/src/components/settings/SettingsView.tsx b/webview-ui/src/components/settings/SettingsView.tsx index 0171537b9e..ca5b3e3828 100644 --- a/webview-ui/src/components/settings/SettingsView.tsx +++ b/webview-ui/src/components/settings/SettingsView.tsx @@ -78,9 +78,10 @@ type SectionName = (typeof sectionNames)[number] type SettingsViewProps = { onDone: () => void + targetSection?: string } -const SettingsView = forwardRef(({ onDone }, ref) => { +const SettingsView = forwardRef(({ onDone, targetSection }, ref) => { const { t } = useAppTranslation() const extensionState = useExtensionState() @@ -316,6 +317,17 @@ const SettingsView = forwardRef(({ onDone }, const scrollToSection = (ref: React.RefObject) => ref.current?.scrollIntoView() + // Scroll to target section when specified + useEffect(() => { + if (targetSection) { + const sectionObj = sections.find((section) => section.id === targetSection) + if (sectionObj && sectionObj.ref.current) { + // Use setTimeout to ensure the scroll happens after render + setTimeout(() => scrollToSection(sectionObj.ref), 500) + } + } + }, [targetSection, sections]) + return ( diff --git a/webview-ui/src/i18n/locales/ca/chat.json b/webview-ui/src/i18n/locales/ca/chat.json index 12dc8ec263..4dbe009547 100644 --- a/webview-ui/src/i18n/locales/ca/chat.json +++ b/webview-ui/src/i18n/locales/ca/chat.json @@ -94,6 +94,7 @@ "checkpoint": { "initial": "Punt de control inicial", "regular": "Punt de control", + "initializingWarning": "Encara s'està inicialitzant el punt de control... Si això triga massa, pots desactivar els punts de control a la configuració i reiniciar la teva tasca.", "menu": { "viewDiff": "Veure diferències", "restore": "Restaurar punt de control", diff --git a/webview-ui/src/i18n/locales/de/chat.json b/webview-ui/src/i18n/locales/de/chat.json index fdfcd433c6..5b19c8cca9 100644 --- a/webview-ui/src/i18n/locales/de/chat.json +++ b/webview-ui/src/i18n/locales/de/chat.json @@ -94,6 +94,7 @@ "checkpoint": { "initial": "Initialer Checkpoint", "regular": "Checkpoint", + "initializingWarning": "Checkpoint wird noch initialisiert... Falls dies zu lange dauert, kannst du Checkpoints in den Einstellungen deaktivieren und deine Aufgabe neu starten.", "menu": { "viewDiff": "Unterschiede anzeigen", "restore": "Checkpoint wiederherstellen", diff --git a/webview-ui/src/i18n/locales/en/chat.json b/webview-ui/src/i18n/locales/en/chat.json index 77c887d8ba..73f7afd51c 100644 --- a/webview-ui/src/i18n/locales/en/chat.json +++ b/webview-ui/src/i18n/locales/en/chat.json @@ -92,6 +92,7 @@ "checkpoint": { "initial": "Initial Checkpoint", "regular": "Checkpoint", + "initializingWarning": "Still initializing checkpoint... If this takes too long, you can disable checkpoints in settings and restart your task.", "menu": { "viewDiff": "View Diff", "restore": "Restore Checkpoint", diff --git a/webview-ui/src/i18n/locales/es/chat.json b/webview-ui/src/i18n/locales/es/chat.json index 028cf52766..2181c94d7b 100644 --- a/webview-ui/src/i18n/locales/es/chat.json +++ b/webview-ui/src/i18n/locales/es/chat.json @@ -94,6 +94,7 @@ "checkpoint": { "initial": "Punto de control inicial", "regular": "Punto de control", + "initializingWarning": "Todavía inicializando el punto de control... Si esto tarda demasiado, puedes desactivar los puntos de control en la configuración y reiniciar tu tarea.", "menu": { "viewDiff": "Ver diferencias", "restore": "Restaurar punto de control", diff --git a/webview-ui/src/i18n/locales/fr/chat.json b/webview-ui/src/i18n/locales/fr/chat.json index 281bee9ae1..dc42265a3b 100644 --- a/webview-ui/src/i18n/locales/fr/chat.json +++ b/webview-ui/src/i18n/locales/fr/chat.json @@ -94,6 +94,7 @@ "checkpoint": { "initial": "Point de contrôle initial", "regular": "Point de contrôle", + "initializingWarning": "Initialisation du point de contrôle en cours... Si cela prend trop de temps, tu peux désactiver les points de contrôle dans les paramètres et redémarrer ta tâche.", "menu": { "viewDiff": "Voir les différences", "restore": "Restaurer le point de contrôle", diff --git a/webview-ui/src/i18n/locales/hi/chat.json b/webview-ui/src/i18n/locales/hi/chat.json index bc34296d96..e4cadd005e 100644 --- a/webview-ui/src/i18n/locales/hi/chat.json +++ b/webview-ui/src/i18n/locales/hi/chat.json @@ -94,6 +94,7 @@ "checkpoint": { "initial": "प्रारंभिक चेकपॉइंट", "regular": "चेकपॉइंट", + "initializingWarning": "चेकपॉइंट अभी भी आरंभ हो रहा है... अगर यह बहुत समय ले रहा है, तो आप सेटिंग्स में चेकपॉइंट को अक्षम कर सकते हैं और अपने कार्य को पुनः आरंभ कर सकते हैं।", "menu": { "viewDiff": "अंतर देखें", "restore": "चेकपॉइंट पुनर्स्थापित करें", diff --git a/webview-ui/src/i18n/locales/it/chat.json b/webview-ui/src/i18n/locales/it/chat.json index 84e86dc714..cd7b7c268c 100644 --- a/webview-ui/src/i18n/locales/it/chat.json +++ b/webview-ui/src/i18n/locales/it/chat.json @@ -97,6 +97,7 @@ "checkpoint": { "initial": "Checkpoint iniziale", "regular": "Checkpoint", + "initializingWarning": "Inizializzazione del checkpoint in corso... Se questa operazione richiede troppo tempo, puoi disattivare i checkpoint nelle impostazioni e riavviare l'attività.", "menu": { "viewDiff": "Visualizza differenze", "restore": "Ripristina checkpoint", diff --git a/webview-ui/src/i18n/locales/ja/chat.json b/webview-ui/src/i18n/locales/ja/chat.json index 15e4741812..e4be11617c 100644 --- a/webview-ui/src/i18n/locales/ja/chat.json +++ b/webview-ui/src/i18n/locales/ja/chat.json @@ -94,6 +94,7 @@ "checkpoint": { "initial": "初期チェックポイント", "regular": "チェックポイント", + "initializingWarning": "チェックポイントの初期化中... 時間がかかりすぎる場合は、設定でチェックポイントを無効にしてタスクを再開できます。", "menu": { "viewDiff": "差分を表示", "restore": "チェックポイントを復元", diff --git a/webview-ui/src/i18n/locales/ko/chat.json b/webview-ui/src/i18n/locales/ko/chat.json index 0ab7b4e8ce..b92c1b6de2 100644 --- a/webview-ui/src/i18n/locales/ko/chat.json +++ b/webview-ui/src/i18n/locales/ko/chat.json @@ -94,6 +94,7 @@ "checkpoint": { "initial": "초기 체크포인트", "regular": "체크포인트", + "initializingWarning": "체크포인트 초기화 중... 시간이 너무 오래 걸리면 설정에서 체크포인트를 비활성화하고 작업을 다시 시작할 수 있습니다.", "menu": { "viewDiff": "차이점 보기", "restore": "체크포인트 복원", diff --git a/webview-ui/src/i18n/locales/pl/chat.json b/webview-ui/src/i18n/locales/pl/chat.json index 3ab92c4e57..1fc9fc8148 100644 --- a/webview-ui/src/i18n/locales/pl/chat.json +++ b/webview-ui/src/i18n/locales/pl/chat.json @@ -94,6 +94,7 @@ "checkpoint": { "initial": "Początkowy punkt kontrolny", "regular": "Punkt kontrolny", + "initializingWarning": "Trwa inicjalizacja punktu kontrolnego... Jeśli to trwa zbyt długo, możesz wyłączyć punkty kontrolne w ustawieniach i uruchomić zadanie ponownie.", "menu": { "viewDiff": "Zobacz różnice", "restore": "Przywróć punkt kontrolny", diff --git a/webview-ui/src/i18n/locales/pt-BR/chat.json b/webview-ui/src/i18n/locales/pt-BR/chat.json index ef1c9f701b..ec444d3b98 100644 --- a/webview-ui/src/i18n/locales/pt-BR/chat.json +++ b/webview-ui/src/i18n/locales/pt-BR/chat.json @@ -94,6 +94,7 @@ "checkpoint": { "initial": "Ponto de verificação inicial", "regular": "Ponto de verificação", + "initializingWarning": "Ainda inicializando ponto de verificação... Se isso demorar muito, você pode desativar os pontos de verificação nas configurações e reiniciar sua tarefa.", "menu": { "viewDiff": "Ver diferenças", "restore": "Restaurar ponto de verificação", diff --git a/webview-ui/src/i18n/locales/tr/chat.json b/webview-ui/src/i18n/locales/tr/chat.json index 43cf456af0..6cd7de384d 100644 --- a/webview-ui/src/i18n/locales/tr/chat.json +++ b/webview-ui/src/i18n/locales/tr/chat.json @@ -94,6 +94,7 @@ "checkpoint": { "initial": "İlk Kontrol Noktası", "regular": "Kontrol Noktası", + "initializingWarning": "Kontrol noktası hala başlatılıyor... Bu çok uzun sürerse, ayarlar bölümünden kontrol noktalarını devre dışı bırakabilir ve görevinizi yeniden başlatabilirsiniz.", "menu": { "viewDiff": "Farkları Görüntüle", "restore": "Kontrol Noktasını Geri Yükle", diff --git a/webview-ui/src/i18n/locales/vi/chat.json b/webview-ui/src/i18n/locales/vi/chat.json index 0d893db8f1..0cb305133a 100644 --- a/webview-ui/src/i18n/locales/vi/chat.json +++ b/webview-ui/src/i18n/locales/vi/chat.json @@ -94,6 +94,7 @@ "checkpoint": { "initial": "Điểm kiểm tra ban đầu", "regular": "Điểm kiểm tra", + "initializingWarning": "Đang khởi tạo điểm kiểm tra... Nếu quá trình này mất quá nhiều thời gian, bạn có thể vô hiệu hóa điểm kiểm tra trong cài đặt và khởi động lại tác vụ của bạn.", "menu": { "viewDiff": "Xem khác biệt", "restore": "Khôi phục điểm kiểm tra", diff --git a/webview-ui/src/i18n/locales/zh-CN/chat.json b/webview-ui/src/i18n/locales/zh-CN/chat.json index 78c1e20781..7e7ace29ee 100644 --- a/webview-ui/src/i18n/locales/zh-CN/chat.json +++ b/webview-ui/src/i18n/locales/zh-CN/chat.json @@ -94,6 +94,7 @@ "checkpoint": { "initial": "初始检查点", "regular": "检查点", + "initializingWarning": "正在初始化检查点...如果耗时过长,你可以在设置中禁用检查点并重新启动任务。", "menu": { "viewDiff": "查看差异", "restore": "恢复检查点", diff --git a/webview-ui/src/i18n/locales/zh-TW/chat.json b/webview-ui/src/i18n/locales/zh-TW/chat.json index 5d8d4aef23..b86ea259c4 100644 --- a/webview-ui/src/i18n/locales/zh-TW/chat.json +++ b/webview-ui/src/i18n/locales/zh-TW/chat.json @@ -94,6 +94,7 @@ "checkpoint": { "initial": "初始檢查點", "regular": "檢查點", + "initializingWarning": "正在初始化檢查點...如果耗時過長,你可以在設定中停用檢查點並重新啟動任務。", "menu": { "viewDiff": "檢視差異", "restore": "還原檢查點",