Bug 142779 - Web Inspector: Debugger sidebar should have a filter button for breakpoints
Summary: Web Inspector: Debugger sidebar should have a filter button for breakpoints
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Jonathan Wells
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-03-17 02:43 PDT by Jonathan Wells
Modified: 2015-03-23 15:01 PDT (History)
7 users (show)

See Also:


Attachments
[PATCH] Added filter button. (18.33 KB, patch)
2015-03-17 03:06 PDT, Jonathan Wells
no flags Details | Formatted Diff | Diff
[SCREENSHOT] Filter is off. (74.78 KB, image/png)
2015-03-17 03:09 PDT, Jonathan Wells
no flags Details
[SCREENSHOT] Filter is on. (63.16 KB, image/png)
2015-03-17 03:10 PDT, Jonathan Wells
no flags Details
[SCREENSHOT] Button and text filter applied. (27.42 KB, image/png)
2015-03-17 03:10 PDT, Jonathan Wells
no flags Details
[PATCH] with JoePeck feedback (18.83 KB, patch)
2015-03-18 16:51 PDT, Jonathan Wells
no flags Details | Formatted Diff | Diff
[PATCH] Corrected patch based on feedback. (18.90 KB, patch)
2015-03-18 21:13 PDT, Jonathan Wells
timothy: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Wells 2015-03-17 02:43:20 PDT
Currently the debugger sidebar always shows any and all debuggable resources. This should be optional and set by a button on the filter bar similar to the Xcode style.

<rdar://problem/19524415>
Comment 1 Jonathan Wells 2015-03-17 03:06:46 PDT
Created attachment 248836 [details]
[PATCH] Added filter button.
Comment 2 Jonathan Wells 2015-03-17 03:09:12 PDT
Created attachment 248837 [details]
[SCREENSHOT] Filter is off.
Comment 3 Jonathan Wells 2015-03-17 03:10:00 PDT
Created attachment 248838 [details]
[SCREENSHOT] Filter is on.
Comment 4 Jonathan Wells 2015-03-17 03:10:39 PDT
Created attachment 248839 [details]
[SCREENSHOT] Button and text filter applied.
Comment 5 Jonathan Wells 2015-03-17 03:11:56 PDT
Look at the screenshots. We probably want another icon for the button.
Comment 6 Joseph Pecoraro 2015-03-17 12:19:31 PDT
Comment on attachment 248836 [details]
[PATCH] Added filter button.

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

> Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js:57
>      var breakpointsImage, pauseImage, resumeImage, stepOverImage, stepIntoImage, stepOutImage;

Style: You can now move these var's inline (60-65).

> Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js:108
> +        return treeElement instanceof WebInspector.ResourceTreeElement && !treeElement.hasChildren;

This condition seems the opposite of what I would want it to be.

I'd want the filter to be a predicate that says "true = show, false = hide". Because it is much easier to say "this is what I want to show" then "this is everything that should be hidden".

However, when reading the condition, "ResourceTreeElement && !children" = true => show, is not the case.

> Source/WebInspectorUI/UserInterface/Views/FilterBarButton.js:2
> + * Copyright (C) 2013 Apple Inc. All rights reserved.

2015.

> Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js:320
> +            // If the filter function returns true for a treeElement, that element should be hidden.
> +            if (filterFunction(treeElement))
> +                return false;

This is what I think should be flipped.
Comment 7 Jonathan Wells 2015-03-17 15:51:50 PDT
Comment on attachment 248836 [details]
[PATCH] Added filter button.

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

>> Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js:108
>> +        return treeElement instanceof WebInspector.ResourceTreeElement && !treeElement.hasChildren;
> 
> This condition seems the opposite of what I would want it to be.
> 
> I'd want the filter to be a predicate that says "true = show, false = hide". Because it is much easier to say "this is what I want to show" then "this is everything that should be hidden".
> 
> However, when reading the condition, "ResourceTreeElement && !children" = true => show, is not the case.

Yeah I struggled with this too. I'll change it.

>> Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js:320
>> +                return false;
> 
> This is what I think should be flipped.

Right, that works as long as the filters functions return true of things you want to keep, as you suggested. Will change.
Comment 8 Jonathan Wells 2015-03-18 16:51:03 PDT
Created attachment 248988 [details]
[PATCH] with JoePeck feedback
Comment 9 Jonathan Wells 2015-03-18 21:13:10 PDT
Created attachment 249014 [details]
[PATCH] Corrected patch based on feedback.
Comment 10 Timothy Hatcher 2015-03-23 13:49:39 PDT
Comment on attachment 249014 [details]
[PATCH] Corrected patch based on feedback.

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

> Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js:119
> +    };
> +    this.filterBar.addFilterBarButton("debugger-show-resources-with-children-only", showResourcesWithBreakpointsOnlyFilterFunction, false, WebInspector.UIString("Show only resources with breakpoints."), WebInspector.UIString("Show resources with and without breakpoints."), platformImagePath("Breakpoints.svg"), 15, 15);

Newline between these lines? Pass true to enable this by default.
Comment 11 Jonathan Wells 2015-03-23 15:01:03 PDT
Committed r181872: <http://trac.webkit.org/changeset/181872>