Closed Bug 1731770 Opened 2 years ago Closed 2 years ago

Filtering JSON properties in the Response panel collapse any expanded node


(DevTools :: Netmonitor, defect, P3)



(firefox96 fixed)

96 Branch
Tracking Status
firefox96 --- fixed


(Reporter: nchevobbe, Assigned: claubatista)


(Blocks 1 open bug)


(Whiteboard: dt-outreachy-2021)


(1 file)

Steps to reproduce

  1. Go to
  2. Open the netmonitor
  3. Hit <kbd>Esc</kbd> to show the split console
  4. In the console, evaluate fetch('')
  5. Select the matching request in the netmonitor, and select the Response panel
  6. Expand the first item in the JSON object
  7. In the Filter properties search input, type title

Expected results

The node that was expanded is still expanded, and we're only displaying the title property

Actual results

The node was collapsed, so I need to expand it again

Thank you for the report, Nicolas.

A few comments.

The TreeView (used to render parsed JSON response preview) doesn't persist its state across re-renderings. I.e. the current expanded/collapsed state is lost when the tree is re-rendered. You can also see it when switching to another side panel and back to the Response panel.

The good news is that the TreeView has internal support for storing the list of expanded nodes.

  • Use TreeViewClass.getExpandedNodes to get list of expanded nodes in a tree object
  • Set property expandedNodes when rendering a tree

See this code in PropertiesView (which is also used to render the JSON response preview)

if the expandedNodes prop was specified the tree would initialize its state properly.

It looks like the Properties view should store the list of expanded nodes at the beginning, update the list every time a node is expanded or collapsed and use the list every time it's rendered. Or something along these lines.
Could be good second bug, perhaps.

Check if this can be good first bug or outreachy

Severity: -- → S3
Flags: needinfo?(hmanilla)
Priority: -- → P3
Assignee: nobody → contatodaclau
Flags: needinfo?(hmanilla)
Whiteboard: dt-outreachy-2021
Pushed by
[devtools] Persit expanded nodes state in the Response Panel. r=bomsy
Flags: needinfo?(contatodaclau)

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:claubatista, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(hmanilla)
Flags: needinfo?(contatodaclau)
Pushed by
[devtools] Persit expanded nodes state in the Response Panel. r=bomsy
Flags: needinfo?(contatodaclau)
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch
Flags: qe-verify+
Flags: qe-verify+
QA Whiteboard: [qa-96b-p2]
Flags: needinfo?(hmanilla)
You need to log in before you can comment on or make changes to this bug.