RESOLVED FIXED 142779
Web Inspector: Debugger sidebar should have a filter button for breakpoints
https://bugs.webkit.org/show_bug.cgi?id=142779
Summary Web Inspector: Debugger sidebar should have a filter button for breakpoints
Jonathan Wells
Reported 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>
Attachments
[PATCH] Added filter button. (18.33 KB, patch)
2015-03-17 03:06 PDT, Jonathan Wells
no flags
[SCREENSHOT] Filter is off. (74.78 KB, image/png)
2015-03-17 03:09 PDT, Jonathan Wells
no flags
[SCREENSHOT] Filter is on. (63.16 KB, image/png)
2015-03-17 03:10 PDT, Jonathan Wells
no flags
[SCREENSHOT] Button and text filter applied. (27.42 KB, image/png)
2015-03-17 03:10 PDT, Jonathan Wells
no flags
[PATCH] with JoePeck feedback (18.83 KB, patch)
2015-03-18 16:51 PDT, Jonathan Wells
no flags
[PATCH] Corrected patch based on feedback. (18.90 KB, patch)
2015-03-18 21:13 PDT, Jonathan Wells
timothy: review+
Jonathan Wells
Comment 1 2015-03-17 03:06:46 PDT
Created attachment 248836 [details] [PATCH] Added filter button.
Jonathan Wells
Comment 2 2015-03-17 03:09:12 PDT
Created attachment 248837 [details] [SCREENSHOT] Filter is off.
Jonathan Wells
Comment 3 2015-03-17 03:10:00 PDT
Created attachment 248838 [details] [SCREENSHOT] Filter is on.
Jonathan Wells
Comment 4 2015-03-17 03:10:39 PDT
Created attachment 248839 [details] [SCREENSHOT] Button and text filter applied.
Jonathan Wells
Comment 5 2015-03-17 03:11:56 PDT
Look at the screenshots. We probably want another icon for the button.
Joseph Pecoraro
Comment 6 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.
Jonathan Wells
Comment 7 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.
Jonathan Wells
Comment 8 2015-03-18 16:51:03 PDT
Created attachment 248988 [details] [PATCH] with JoePeck feedback
Jonathan Wells
Comment 9 2015-03-18 21:13:10 PDT
Created attachment 249014 [details] [PATCH] Corrected patch based on feedback.
Timothy Hatcher
Comment 10 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.
Jonathan Wells
Comment 11 2015-03-23 15:01:03 PDT
Note You need to log in before you can comment on or make changes to this bug.