Fix inconsistencies in Inspector Sidebar panel APIs: isSidebarActive / isPanelVisible
Categories
(DevTools :: Inspector, task, P3)
Tracking
(Not tracked)
People
(Reporter: jdescottes, Unassigned)
References
Details
The newer Inspector sidebar panels (grid, flexbox, boxmodel etc....) all implement a isPanelVisible
method which checks both that inspector is selected -and- the appropriate sidebar panel is visible. This method is typically used if the panel should be refreshed when a certain event occurs. New panels will typically refresh when the sidebar panel is selected or when the inspector is selected.
For older inspector sidebar panels (ruleview, computedview), they implement another API, isSidebarActive
, which is similar, but doesn't check if the inspector is selected.
First of all we should align the naming, and decide if we call those "Sidebar" or "Panel". I think Sidebar refers more to the container widget than to the content so I'd suggest "Panel". Maybe "SidebarPanel" to avoid confusion with regular DevTools panels.
And then we should try to make all panels use the same logic. I would suggest updating the ruleview and computedview to also check that the inspector is the selected tool and make sure to call the appropriate "refresh" method also when the inspector gets selected.
This will avoid refreshing those panels needlessly when they are in the background.
Updated•2 years ago
|
Updated•2 years ago
|
Description
•