Skip to content

Commit 104da48

Browse files
bmeurerDevtools-frontend LUCI CQ
authored andcommitted
[workspace_diff] Remove DevToolsImprovedWorkspaces flag.
The `DevToolsImprovedWorkspaces` flag was guarding the change in behavior that not only all Network resources are being tracked for changes (and therefore show up in the Changes panel), but also all FileSystem resources that don't have a Network resource binding. This new behavior generally makes sense, and feature-gating complicates further development and reduces changes that bugs / problems are flushed out early. Bug: 393244410, 393064551 Change-Id: Ib5a39b20207faa0da46810be687d13e187fa1e8e Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6342612 Auto-Submit: Benedikt Meurer <[email protected]> Reviewed-by: Alex Rudenko <[email protected]> Commit-Queue: Alex Rudenko <[email protected]> Commit-Queue: Benedikt Meurer <[email protected]>
1 parent 955a962 commit 104da48

File tree

4 files changed

+11
-22
lines changed

4 files changed

+11
-22
lines changed

front_end/core/root/Runtime.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -391,10 +391,6 @@ export interface HostConfigAutomaticFileSystems {
391391
enabled: boolean;
392392
}
393393

394-
export interface HostConfigImprovedWorkspaces {
395-
enabled: boolean;
396-
}
397-
398394
export interface HostConfigVeLogging {
399395
enabled: boolean;
400396
testing: boolean;
@@ -452,7 +448,6 @@ export type HostConfig = Platform.TypeScriptUtilities.RecursivePartial<{
452448
devToolsAiAssistanceFileAgent: HostConfigAiAssistanceFileAgent,
453449
devToolsAiAssistancePerformanceAgent: HostConfigAiAssistancePerformanceAgent,
454450
devToolsAutomaticFileSystems: HostConfigAutomaticFileSystems,
455-
devToolsImprovedWorkspaces: HostConfigImprovedWorkspaces,
456451
devToolsVeLogging: HostConfigVeLogging,
457452
devToolsWellKnown: HostConfigWellKnown,
458453
devToolsPrivacyUI: HostConfigPrivacyUI,

front_end/models/workspace_diff/BUILD.gn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ devtools_module("workspace_diff") {
1313
deps = [
1414
"../../core/common:bundle",
1515
"../../core/host:bundle",
16-
"../../core/root:bundle",
1716
"../../models/formatter:bundle",
1817
"../../models/persistence:bundle",
1918
"../../models/text_utils:bundle",

front_end/models/workspace_diff/WorkspaceDiff.ts

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import * as Common from '../../core/common/common.js';
66
import * as Host from '../../core/host/host.js';
7-
import * as Root from '../../core/root/root.js';
87
import * as Diff from '../../third_party/diff/diff.js';
98
import * as FormatterModule from '../formatter/formatter.js';
109
import * as Persistence from '../persistence/persistence.js';
@@ -112,20 +111,18 @@ export class WorkspaceDiffImpl extends Common.ObjectWrapper.ObjectWrapper<EventT
112111
}
113112

114113
#shouldTrack(uiSourceCode: Workspace.UISourceCode.UISourceCode): boolean {
115-
// We track differences for all Network resources.
116-
if (uiSourceCode.project().type() === Workspace.Workspace.projectTypes.Network) {
117-
return true;
118-
}
114+
switch (uiSourceCode.project().type()) {
115+
case Workspace.Workspace.projectTypes.Network:
116+
// We track differences for all Network resources.
117+
return true;
119118

120-
// Additionally we also track differences for FileSystem resources that don't have
121-
// a binding (as part of the kDevToolsImprovedWorkspaces feature).
122-
if (uiSourceCode.project().type() === Workspace.Workspace.projectTypes.FileSystem &&
123-
this.#persistence.binding(uiSourceCode) === null &&
124-
Root.Runtime.hostConfig.devToolsImprovedWorkspaces?.enabled) {
125-
return true;
126-
}
119+
case Workspace.Workspace.projectTypes.FileSystem:
120+
// We track differences for FileSystem resources without bindings.
121+
return this.#persistence.binding(uiSourceCode) === null;
127122

128-
return false;
123+
default:
124+
return false;
125+
}
129126
}
130127

131128
private async updateModifiedState(uiSourceCode: Workspace.UISourceCode.UISourceCode): Promise<void> {

front_end/panels/changes/CombinedDiffView.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import * as Breakpoints from '../../models/breakpoints/breakpoints.js';
99
import * as Persistence from '../../models/persistence/persistence.js';
1010
import * as Workspace from '../../models/workspace/workspace.js';
1111
import * as WorkspaceDiff from '../../models/workspace_diff/workspace_diff.js';
12-
import {describeWithEnvironment, updateHostConfig} from '../../testing/EnvironmentHelpers.js';
12+
import {describeWithEnvironment} from '../../testing/EnvironmentHelpers.js';
1313
import {createFileSystemUISourceCode} from '../../testing/UISourceCodeHelpers.js';
1414
import {createViewFunctionStub} from '../../testing/ViewFunctionHelpers.js';
1515

@@ -58,8 +58,6 @@ describeWithEnvironment('CombinedDiffView', () => {
5858
let workspaceDiff: WorkspaceDiff.WorkspaceDiff.WorkspaceDiffImpl;
5959
let uiSourceCode: Workspace.UISourceCode.UISourceCode;
6060
beforeEach(() => {
61-
// This is needed for tracking file system UI source codes.
62-
updateHostConfig({devToolsImprovedWorkspaces: {enabled: true}});
6361
const workspace = createWorkspace();
6462
workspaceDiff = createWorkspaceDiff({workspace});
6563
({uiSourceCode} =

0 commit comments

Comments
 (0)