RESOLVED FIXED166000
Web Inspector: Debugger sidebar panel should not have multiple tree selections
https://bugs.webkit.org/show_bug.cgi?id=166000
Summary Web Inspector: Debugger sidebar panel should not have multiple tree selections
Matt Baker
Reported 2016-12-17 14:41:12 PST
Created attachment 297414 [details] [Image] two selected elements Summary: Debugger sidebar panel should not have multiple tree selections. Steps to Reproduce: 1. Goto daringfireball.net 2. Open Debugger tab 3. Select any special breakpoint (e.g. All Exceptions) 4. Reload inspected page => Breakpoint and main resource tree elements are both selected (see screenshot) Notes: NavigationSidebarPanel tries to sync selection between content tree outlines, but relies on selection events which can be suppressed. Tree element selections made at startup (cookie restore, etc) don't trigger events.
Attachments
[Image] two selected elements (451.20 KB, image/png)
2016-12-17 14:41 PST, Matt Baker
no flags
Patch (18.26 KB, patch)
2016-12-17 15:50 PST, Matt Baker
no flags
Patch (23.40 KB, patch)
2016-12-22 13:37 PST, Matt Baker
no flags
Patch for landing (23.47 KB, patch)
2017-02-10 17:48 PST, Matt Baker
no flags
Matt Baker
Comment 1 2016-12-17 15:50:48 PST
Radar WebKit Bug Importer
Comment 2 2016-12-17 15:54:38 PST
Blaze Burg
Comment 3 2016-12-17 15:55:39 PST
Comment on attachment 297415 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=297415&action=review > Source/WebInspectorUI/ChangeLog:10 > + (logical) tree outline, with one selected element permitted at a time. We may want some subtrees or elements to be multiple selected in the future. For example, call frames.
Matt Baker
Comment 4 2016-12-17 15:58:24 PST
Comment on attachment 297415 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=297415&action=review >> Source/WebInspectorUI/ChangeLog:10 >> + (logical) tree outline, with one selected element permitted at a time. > > We may want some subtrees or elements to be multiple selected in the future. For example, call frames. When the day comes, it should be simple to add logic for TreeOutline.prototype.allowsMultipleSelection (or its ilk).
Blaze Burg
Comment 5 2016-12-20 12:03:29 PST
Comment on attachment 297415 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=297415&action=review > Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js:140 > + this._visibleContentTreeOutlines.add(contentTreeOutline); Should this be handled by the group as well, now that this class does not directly manage .hidden? > Source/WebInspectorUI/UserInterface/Views/TreeOutlineGroup.js:97 > + _wrapTreeOutline(treeOutline) This wrapping business makes me nervous and we don't really do stuff like this as far as I know.. Why can't we just make TreeOutline/TreeElement emit selection events, or keep an up-pointer to its containing group and send delegate messages?
Matt Baker
Comment 6 2016-12-20 13:00:43 PST
Comment on attachment 297415 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=297415&action=review >> Source/WebInspectorUI/UserInterface/Views/TreeOutlineGroup.js:97 >> + _wrapTreeOutline(treeOutline) > > This wrapping business makes me nervous and we don't really do stuff like this as far as I know.. Why can't we just make TreeOutline/TreeElement emit selection events, or keep an up-pointer to its containing group and send delegate messages? Initially I'd started with a delegate approach because of similar reservations about wrapping, but thought this was less intrusive. Will rework this.
Matt Baker
Comment 7 2016-12-20 13:09:50 PST
Comment on attachment 297415 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=297415&action=review >> Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js:140 >> + this._visibleContentTreeOutlines.add(contentTreeOutline); > > Should this be handled by the group as well, now that this class does not directly manage .hidden? Yep, _visibleContentTreeOutlines is no longer needed.
Matt Baker
Comment 8 2016-12-22 13:37:30 PST
Timothy Hatcher
Comment 9 2017-01-20 18:32:53 PST
Comment on attachment 297669 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=297669&action=review > Source/WebInspectorUI/ChangeLog:14 > + This adds a new class, TreeOutlineGroup, which restricts tree element selection > + inside a group of tree outlines by receiving messages directly from TreeElement. Nice design. > Source/WebInspectorUI/UserInterface/Views/TreeElement.js:516 > + let treeOutlineGroup = WebInspector.TreeOutlineGroup.groupForTreeOutline(treeOutline); > + if (!treeOutlineGroup) > + return; > + > + treeOutlineGroup.didSelectTreeElement(this); This might just be better with a getter / setter on TreeOutline. > Source/WebInspectorUI/UserInterface/Views/TreeOutlineGroup.js:66 > + delete treeOutline[WebInspector.TreeOutlineGroup.GroupForTreeOutlineSymbol]; Should be = null;
Blaze Burg
Comment 10 2017-02-10 17:32:25 PST
What's up with this patch? Can we rebase and land it?
Matt Baker
Comment 11 2017-02-10 17:48:19 PST
Created attachment 301227 [details] Patch for landing
WebKit Commit Bot
Comment 12 2017-02-10 18:26:39 PST
Comment on attachment 301227 [details] Patch for landing Clearing flags on attachment: 301227 Committed r212171: <http://trac.webkit.org/changeset/212171>
WebKit Commit Bot
Comment 13 2017-02-10 18:26:43 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.