@@ -147,7 +147,7 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
147147 const shortcuts = [
148148 { actionId : 'quickOpen.show' , description : i18nString ( UIStrings . openFile ) } ,
149149 { actionId : 'commandMenu.show' , description : i18nString ( UIStrings . runCommand ) } ,
150- { actionId : 'sources.add-folder-to-workspace' , description : i18nString ( UIStrings . dropInAFolderToAddToWorkspace ) } ,
150+ { actionId : 'sources.add-folder-to-workspace' , description : i18nString ( UIStrings . dropInAFolderToAddToWorkspace ) , condition : Root . Runtime . ConditionName . NOT_SOURCES_HIDE_ADD_FOLDER } ,
151151 ] ;
152152
153153 const element = document . createElement ( 'div' ) ;
@@ -158,6 +158,10 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
158158
159159 for ( let i = 0 ; i < shortcuts . length ; i ++ ) {
160160 const shortcut = shortcuts [ i ] ;
161+ const { condition} = shortcut ;
162+ if ( condition !== undefined && ! Root . Runtime . Runtime . isDescriptorEnabled ( { experiment : undefined , condition} ) ) {
163+ continue ;
164+ }
161165 const shortcutKeyText = UI . ShortcutRegistry . ShortcutRegistry . instance ( ) . shortcutTitleForAction ( shortcut . actionId ) ;
162166 const listItemElement = list . createChild ( 'div' ) ;
163167 UI . ARIAUtils . markAsListitem ( listItemElement ) ;
@@ -181,9 +185,10 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
181185 }
182186 }
183187
184- element . appendChild (
185- UI . XLink . XLink . create ( 'https://developer.chrome.com/docs/devtools/workspaces/' , 'Learn more about Workspaces' ) ) ;
186-
188+ if ( Root . Runtime . Runtime . isDescriptorEnabled ( { experiment : undefined , condition : Root . Runtime . ConditionName . NOT_SOURCES_HIDE_ADD_FOLDER } ) ) {
189+ element . appendChild (
190+ UI . XLink . XLink . create ( 'https://developer.chrome.com/docs/devtools/workspaces/' , 'Learn more about Workspaces' ) ) ;
191+ }
187192 return element ;
188193 }
189194
0 commit comments