Bug 233572

Summary: Web Inspector: Computed Panel: Properties section should be hidden when the filter doesn't match
Product: WebKit Reporter: Razvan Caliman <rcaliman>
Component: Web InspectorAssignee: Razvan Caliman <rcaliman>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: ews-watchlist, hi, inspector-bugzilla-changes, pangle, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Properties section header should be hidden
none
Patch 1.0
rcaliman: review?
Computed panel with patch applied none

Description Razvan Caliman 2021-11-29 10:14:45 PST
Created attachment 445292 [details]
Properties section header should be hidden

When using the filter input field in the Computed panel, the Properties section header remains visible if there are no matches for the filter query. 
Variables section header is hidden as expected. 
See attached screenshot.
Comment 1 Radar WebKit Bug Importer 2021-11-29 10:15:20 PST
<rdar://problem/85822886>
Comment 2 Razvan Caliman 2021-11-29 10:25:09 PST
Created attachment 445295 [details]
Patch 1.0

Fix bug by bringing `WI.ComputedStyleSection.applyFilter()` to parity with
        `WI.SpreadsheetCSSStyleDeclarationEditor.applyFilter()`
Comment 3 Razvan Caliman 2021-11-29 10:28:05 PST
Created attachment 445297 [details]
Computed panel with patch applied

Properties and Variables section headers are hidden when there are no matches for the given filter input.
Comment 4 Patrick Angle 2021-11-29 11:37:53 PST
Comment on attachment 445295 [details]
Patch 1.0

View in context: https://bugs.webkit.org/attachment.cgi?id=445295&action=review

> Source/WebInspectorUI/UserInterface/Views/ComputedStyleSection.js:247
> +                if (this._hideFilterNonMatchingProperties)
> +                    this.element.append(propertyView.element);

This doesn't seem correct to me... Couldn't this cause property views to be out of order if they were previously filtered out but now aren't? The `this.needsLayout()` will undo this work anyways since `layout()` removes all the elements and re-adds them in the correct order.

> Source/WebInspectorUI/UserInterface/Views/ComputedStyleSection.js:255
> +        this.dispatchEventToListeners(WI.ComputedStyleSection.Event.FilterApplied, {matches});

Could we instead just fire this event inside `layout()`with a `matches` determined during `layout()` instead and leave this function as-is?
Comment 5 Razvan Caliman 2022-08-19 08:21:28 PDT
Fixed as part of Bug 242704

*** This bug has been marked as a duplicate of bug 242704 ***