fix(devtools): hide profiler node details when the frame is changed

Hide the details panel when the user selects a new frame.

(cherry picked from commit 2eaa4d54ad)
This commit is contained in:
Georgi Serev 2025-12-02 13:05:54 +02:00 committed by Pawel Kozlowski
parent 53e0aaba4e
commit c0e0010bb9

View file

@ -42,8 +42,18 @@ export class RecordingVisualizerComponent {
readonly changeDetection = input.required<boolean>();
readonly cmpVisualizationModes = VisualizationMode;
private readonly selectedNode = linkedSignal<VisualizationMode, SelectedEntry | null>({
source: this.visualizationMode,
private readonly selectedNodeCleanUpDeps = computed(
// We don't care about the output format as long as
// the value is different when a dependency changes
// (i.e. it acts as a hash).
// NOTE: It's safe to stringify the frames since they
// are valid JSON objects that are also exported as part
// of the profiler results report.
() => JSON.stringify(this.frame()) + this.visualizationMode(),
);
private readonly selectedNode = linkedSignal<string, SelectedEntry | null>({
source: this.selectedNodeCleanUpDeps,
computation: () => null,
});