22// Use of this source code is governed by a BSD-style license that can be
33// found in the LICENSE file.
44
5+ import * as Host from '../../../core/host/host.js' ;
56import * as UI from '../../../ui/legacy/legacy.js' ;
67import { createLogger } from '../core/Logger.js' ;
78import { LLMClient } from '../LLM/LLMClient.js' ;
@@ -10,7 +11,7 @@ import { CustomProviderManager } from '../core/CustomProviderManager.js';
1011
1112// Import settings utilities
1213import { i18nString , UIStrings } from './settings/i18n-strings.js' ;
13- import { PROVIDER_SELECTION_KEY , MINI_MODEL_STORAGE_KEY , NANO_MODEL_STORAGE_KEY , ADVANCED_SETTINGS_ENABLED_KEY } from './settings/constants.js' ;
14+ import { PROVIDER_SELECTION_KEY , MINI_MODEL_STORAGE_KEY , NANO_MODEL_STORAGE_KEY , ADVANCED_SETTINGS_ENABLED_KEY , PANEL_FILTER_ENABLED_KEY } from './settings/constants.js' ;
1415import { applySettingsStyles } from './settings/utils/styles.js' ;
1516import { isVectorDBEnabled } from './settings/utils/storage.js' ;
1617import type { ModelOption , ProviderType , FetchLiteLLMModelsFunction , UpdateModelOptionsFunction , GetModelOptionsFunction , AddCustomModelOptionFunction , RemoveCustomModelOptionFunction } from './settings/types.js' ;
@@ -490,6 +491,43 @@ export class SettingsDialog {
490491 evaluationSection . className = 'settings-section evaluation-section' ;
491492 contentDiv . appendChild ( evaluationSection ) ;
492493
494+ // Create panel filter section (inside advanced settings)
495+ const panelFilterSection = document . createElement ( 'div' ) ;
496+ panelFilterSection . className = 'settings-section panel-filter-section' ;
497+ contentDiv . appendChild ( panelFilterSection ) ;
498+
499+ const panelFilterTitle = document . createElement ( 'h3' ) ;
500+ panelFilterTitle . className = 'settings-subtitle' ;
501+ panelFilterTitle . textContent = 'Panel Visibility' ;
502+ panelFilterSection . appendChild ( panelFilterTitle ) ;
503+
504+ const panelFilterContainer = document . createElement ( 'div' ) ;
505+ panelFilterContainer . className = 'settings-checkbox-container' ;
506+ panelFilterContainer . style . cssText = 'display: flex; align-items: center; gap: 8px; margin-bottom: 8px;' ;
507+ panelFilterSection . appendChild ( panelFilterContainer ) ;
508+
509+ const panelFilterCheckbox = document . createElement ( 'input' ) ;
510+ panelFilterCheckbox . type = 'checkbox' ;
511+ panelFilterCheckbox . id = 'panel-filter-toggle' ;
512+ panelFilterCheckbox . checked = localStorage . getItem ( PANEL_FILTER_ENABLED_KEY ) !== 'false' ;
513+ panelFilterContainer . appendChild ( panelFilterCheckbox ) ;
514+
515+ const panelFilterLabel = document . createElement ( 'label' ) ;
516+ panelFilterLabel . htmlFor = 'panel-filter-toggle' ;
517+ panelFilterLabel . textContent = 'Show only AI Chat panel' ;
518+ panelFilterContainer . appendChild ( panelFilterLabel ) ;
519+
520+ const panelFilterHint = document . createElement ( 'div' ) ;
521+ panelFilterHint . className = 'settings-hint' ;
522+ panelFilterHint . textContent = 'When disabled, shows all standard DevTools panels (Elements, Console, etc.). Requires DevTools reload.' ;
523+ panelFilterSection . appendChild ( panelFilterHint ) ;
524+
525+ panelFilterCheckbox . addEventListener ( 'change' , ( ) => {
526+ localStorage . setItem ( PANEL_FILTER_ENABLED_KEY , panelFilterCheckbox . checked . toString ( ) ) ;
527+ // Reload DevTools to apply the panel filter change
528+ Host . InspectorFrontendHost . InspectorFrontendHostInstance . reattach ( ( ) => window . location . reload ( ) ) ;
529+ } ) ;
530+
493531 // Instantiate advanced feature settings classes
494532 const browsingHistorySettings = new BrowsingHistorySettings ( historySection ) ;
495533 const vectorDBSettings = new VectorDBSettings ( vectorDBSection ) ;
@@ -523,6 +561,7 @@ export class SettingsDialog {
523561 vectorDBSection . style . display = display ;
524562 tracingSection . style . display = display ;
525563 evaluationSection . style . display = display ;
564+ panelFilterSection . style . display = display ;
526565
527566 // Save state to localStorage
528567 localStorage . setItem ( ADVANCED_SETTINGS_ENABLED_KEY , show . toString ( ) ) ;
0 commit comments