Closed Bug 1716837 Opened 3 years ago Closed 3 years ago

[new profiler] Active Tab view isn't triggers from the Web Developer preset when using the Devtools panel

Categories

(DevTools :: Performance Tools (Profiler/Timeline), defect, P2)

defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1704546

People

(Reporter: julienw, Unassigned)

Details

STR1:

  1. Open the devtools performance panel. (make sure the new tool is selected in the devtools settings).
  2. Select the "Web Developer" preset.
  3. Start and capture a profile.

=> The profiler UI should be in active tab mode (it should have one track, with a button at the top right reading "Full View")

STR2:
Setup:

  1. run firefox with --start-debugger-server
  2. connect to this firefox from about:debugging, with the endpoint localhost:6000.

Then same thing than STR1

When using the toolbar button, we use this path:
https://searchfox.org/mozilla-central/rev/294f10eff7398d6b05beac6aa256d86ac3cb7113/devtools/client/performance-new/popup/background.jsm.js#260-264

This properly gets the value for profilerViewMode.

On the other hand, when using the devtools interface, we use this path:
https://searchfox.org/mozilla-central/rev/294f10eff7398d6b05beac6aa256d86ac3cb7113/devtools/client/performance-new/store/actions.js#214-216

The problem is that selectors.getProfilerViewMode returns undefined, because it simply returns the state profilerViewMode but there's no reducer for this state! So it's undefined.

I think that instead of implementing a reducer, we could remove this selector, and use getProfilerViewModeForCurrentPreset directly from https://searchfox.org/mozilla-central/rev/294f10eff7398d6b05beac6aa256d86ac3cb7113/devtools/client/performance-new/popup/background.jsm.js#215. But I'm not sure that we can access it from actions.js (?). (we do have the page context available from a selector though).
Or we can implement this selector to use getProfilerViewModeForCurrentPreset but the same question is present: we need to access background.jsm.js from selectors.js.
Or we can reimplement getProfilerViewModeForCurrentPreset using the states presets and presetName (as a selector). (probably the easiest if we can't access the functions in background.jsm.js).

As a last resort we can implement this reducer by mimicing the reducer for the presetName (action.preset.profilerViewMode should have the value).

As a side note, I think that currently pageContext is always aboutprofiling when calling getProfilerViewModeForCurrentPreset so we could possibly simplify all this if we don't use it in this case.

This might be a duplicate of Bug 1704546 ?

Flags: needinfo?(felash)

I believe so, thanks!

Status: NEW → RESOLVED
Closed: 3 years ago
Flags: needinfo?(felash)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.