Open Bug 1579137 Opened 5 years ago Updated 2 years ago

Fix inconsistencies in Inspector Sidebar panel APIs: isSidebarActive / isPanelVisible

Categories

(DevTools :: Inspector, task, P3)

task

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.

I prefer to see us sticking with isPanelVisible. Happy to provide a patch.

Severity: normal → S3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.