Skip to content

Commit 0ed1348

Browse files
milomgmmalerba
authored andcommitted
refactor(devtools): stabilize signal graph (angular#64263)
remove experimental signal graph toggle, enable the signal graph by default if it is available PR Close angular#64263
1 parent 77a4011 commit 0ed1348

File tree

7 files changed

+6
-24
lines changed

7 files changed

+6
-24
lines changed

devtools/projects/ng-devtools/src/lib/application-services/settings.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@ export class Settings {
3333
initialValue: false,
3434
});
3535

36-
readonly signalGraphEnabled = this.settingsStore.create({
37-
key: 'signal_graph_enabled',
38-
category: 'general',
39-
initialValue: false,
40-
});
41-
4236
readonly transferStateEnabled = this.settingsStore.create({
4337
key: 'transfer_state_enabled',
4438
category: 'general',

devtools/projects/ng-devtools/src/lib/application-services/test-utils/settings_mock.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {ThemePreference} from '../theme_types';
1414
export class SettingsMock extends Settings {
1515
routerGraphEnabled = signal(false);
1616
showCommentNodes = signal(false);
17-
signalGraphEnabled = signal(false);
1817
timingAPIEnabled = signal(false);
1918
theme = signal<ThemePreference>('system');
2019
activeTab = signal('Components');

devtools/projects/ng-devtools/src/lib/devtools-tabs/devtools-tabs.component.html

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,6 @@
132132
<span class="ng-mat-menu-label-text">Enable Router Tree</span>
133133
</label>
134134
}
135-
@if (supportedApis().signals) {
136-
<label mat-menu-item disableRipple>
137-
<mat-slide-toggle
138-
[checked]="signalGraphEnabled()"
139-
(change)="setSignalGraph($event.checked)"
140-
/>
141-
<span class="ng-mat-menu-label-text">Enable Signal Graph (experimental)</span>
142-
</label>
143-
}
144135
@if (supportedApis().transferState) {
145136
<label mat-menu-item disableRipple>
146137
<mat-slide-toggle

devtools/projects/ng-devtools/src/lib/devtools-tabs/devtools-tabs.component.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export class DevToolsTabsComponent {
8484
protected readonly showCommentNodes = this.settings.showCommentNodes;
8585
protected readonly routerGraphEnabled = this.settings.routerGraphEnabled;
8686
protected readonly timingAPIEnabled = this.settings.timingAPIEnabled;
87-
protected readonly signalGraphEnabled = this.settings.signalGraphEnabled;
87+
protected readonly signalGraphEnabled = () => this.supportedApis().signals;
8888
protected readonly transferStateEnabled = this.settings.transferStateEnabled;
8989
protected readonly activeTab = this.settings.activeTab;
9090

@@ -202,10 +202,6 @@ export class DevToolsTabsComponent {
202202
}
203203
}
204204

205-
protected setSignalGraph(enabled: boolean): void {
206-
this.signalGraphEnabled.set(enabled);
207-
}
208-
209205
protected setTransferStateTab(enabled: boolean): void {
210206
this.transferStateEnabled.set(enabled);
211207
if (!enabled && this.activeTab() === 'Transfer State') {

devtools/projects/ng-devtools/src/lib/devtools-tabs/directive-explorer/property-tab/property-tab-header/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ ng_project(
2222
deps = [
2323
"//:node_modules/@angular/core",
2424
"//:node_modules/@angular/material",
25+
"//devtools/projects/ng-devtools/src/lib/application-providers:supported_apis",
2526
"//devtools/projects/ng-devtools/src/lib/application-services:settings",
2627
"//devtools/projects/ng-devtools/src/lib/devtools-tabs/directive-explorer/directive-forest/index-forest",
2728
"//devtools/projects/ng-devtools/src/lib/devtools-tabs/directive-explorer/property-tab/property-tab-header/component-metadata",

devtools/projects/ng-devtools/src/lib/devtools-tabs/directive-explorer/property-tab/property-tab-header/property-tab-header.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {IndexedNode} from '../../directive-forest/index-forest';
1414
import {ComponentMetadataComponent} from './component-metadata/component-metadata.component';
1515
import {ButtonComponent} from '../../../../shared/button/button.component';
1616
import {Settings} from '../../../../application-services/settings';
17+
import {SUPPORTED_APIS} from '../../../../application-providers/supported_apis';
1718

1819
@Component({
1920
templateUrl: './property-tab-header.component.html',
@@ -24,11 +25,12 @@ import {Settings} from '../../../../application-services/settings';
2425
})
2526
export class PropertyTabHeaderComponent {
2627
private readonly settings = inject(Settings);
28+
private readonly supportedApis = inject(SUPPORTED_APIS);
2729

2830
protected readonly currentSelectedElement = input.required<IndexedNode>();
2931
protected readonly showSignalGraph = output<void>();
3032

3133
protected readonly expanded = signal(false);
3234

33-
protected readonly signalGraphEnabled = this.settings.signalGraphEnabled;
35+
protected readonly signalGraphEnabled = () => this.supportedApis().signals;
3436
}

devtools/projects/ng-devtools/src/lib/devtools-tabs/directive-explorer/property-tab/property-view/property-view-body/property-view-tree/property-view-tree.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ import {Settings} from '../../../../../../application-services/settings';
4242
export class PropertyViewTreeComponent {
4343
protected readonly supportedApis = inject(SUPPORTED_APIS);
4444
private readonly signalGraph = inject(SignalGraphManager);
45-
private readonly settings = inject(Settings);
4645

4746
readonly dataSource = input.required<PropertyDataSource>();
4847
readonly treeControl = input.required<FlatTreeControl<FlatNode>>();
@@ -51,7 +50,7 @@ export class PropertyViewTreeComponent {
5150
readonly logValue = output<FlatNode>();
5251
readonly showSignalGraph = output<DebugSignalGraphNode>();
5352

54-
protected readonly signalGraphEnabled = this.settings.signalGraphEnabled;
53+
protected readonly signalGraphEnabled = () => this.supportedApis().signals;
5554

5655
hasChild = (_: number, node: FlatNode): boolean => node.expandable;
5756

0 commit comments

Comments
 (0)