Skip to content

Commit d95ac13

Browse files
authored
fix: hide workplace suggest on Sources placeholder element (#180)
1 parent 68cfd0a commit d95ac13

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

front_end/panels/sources/SourcesView.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import * as Common from '../../core/common/common.js';
88
import * as Host from '../../core/host/host.js';
99
import * as i18n from '../../core/i18n/i18n.js';
1010
import * as Platform from '../../core/platform/platform.js';
11+
import * as Root from '../../core/root/root.js';
1112
import * as SDK from '../../core/sdk/sdk.js';
1213
import * as Bindings from '../../models/bindings/bindings.js';
1314
import * as Persistence from '../../models/persistence/persistence.js';
@@ -150,16 +151,18 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
150151
const placeholder = document.createElement('div');
151152
placeholder.classList.add('sources-placeholder');
152153

153-
const workspaceElement = placeholder.createChild('div', 'tabbed-pane-placeholder-row');
154-
workspaceElement.classList.add('workspace');
154+
if (Root.Runtime.Runtime.isDescriptorEnabled({experiment: undefined, condition: Root.Runtime.conditions.notSourcesHideAddFolder})) {
155+
const workspaceElement = placeholder.createChild('div', 'tabbed-pane-placeholder-row');
156+
workspaceElement.classList.add('workspace');
155157

156-
const icon = IconButton.Icon.create('sync', 'sync-icon');
157-
workspaceElement.createChild('span', 'icon-container').appendChild(icon);
158-
const text = workspaceElement.createChild('span');
159-
text.textContent = UIStrings.workspaceDropInAFolderToSyncSources;
160-
const browseButton = text.createChild('button');
161-
browseButton.textContent = i18nString(UIStrings.selectFolder);
162-
browseButton.addEventListener('click', this.addFileSystemClicked.bind(this));
158+
const icon = IconButton.Icon.create('sync', 'sync-icon');
159+
workspaceElement.createChild('span', 'icon-container').appendChild(icon);
160+
const text = workspaceElement.createChild('span');
161+
text.textContent = UIStrings.workspaceDropInAFolderToSyncSources;
162+
const browseButton = text.createChild('button');
163+
browseButton.textContent = i18nString(UIStrings.selectFolder);
164+
browseButton.addEventListener('click', this.addFileSystemClicked.bind(this));
165+
}
163166

164167
const shortcuts = [
165168
{actionId: 'quick-open.show', description: i18nString(UIStrings.openFile)},

0 commit comments

Comments
 (0)