Filtering JSON properties in the Response panel collapse any expanded node
Categories
(DevTools :: Netmonitor, defect, P3)
Tracking
(firefox96 fixed)
Tracking | Status | |
---|---|---|
firefox96 | --- | fixed |
People
(Reporter: nchevobbe, Assigned: claubatista)
References
(Blocks 1 open bug)
Details
(Whiteboard: dt-outreachy-2021)
Attachments
(1 file)
Steps to reproduce
- Go to https://jsonplaceholder.typicode.com/
- Open the netmonitor
- Hit <kbd>Esc</kbd> to show the split console
- In the console, evaluate
fetch('https://jsonplaceholder.typicode.com/todos')
- Select the matching request in the netmonitor, and select the Response panel
- Expand the first item in the JSON object
- In the
Filter properties
search input, typetitle
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
Updated•4 years ago
|
Comment 1•4 years ago
|
||
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)
https://searchfox.org/mozilla-central/rev/50c3cf7a3c931409b54efa009795b69c19383541/devtools/client/netmonitor/src/components/request-details/PropertiesView.js#212-217
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.
Comment 2•4 years ago
|
||
Check if this can be good first bug or outreachy
Updated•4 years ago
|
Assignee | ||
Comment 3•4 years ago
|
||
Updated•4 years ago
|
Comment 5•3 years ago
|
||
Backed out for dt failure on browser_net_details_copy.js
Backout link: https://hg.mozilla.org/integration/autoland/rev/3c67fc0ae4592276c9203c25b05c7dcc1d3486d5
Log link: https://treeherder.mozilla.org/logviewer?job_id=357347100&repo=autoland&lineNumber=4168
Assignee | ||
Updated•3 years ago
|
Comment 6•3 years ago
|
||
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.
Assignee | ||
Updated•3 years ago
|
Comment 8•3 years ago
|
||
bugherder |
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Description
•