Title: [249038] trunk/Source/WebInspectorUI
Revision
249038
Author
[email protected]
Date
2019-08-22 18:43:43 -0700 (Thu, 22 Aug 2019)

Log Message

Web Inspector: Console: automatically select the "Evaluations" filter whenever running commands
https://bugs.webkit.org/show_bug.cgi?id=201060

Reviewed by Timothy Hatcher.

If the Console is actively being filtered (e.g. not "All"), it can be confusing to run a
command, only to not see any results. We should automatically enable the "Evaluations"
filter in addition to any other existing filters in these cases.

* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype.didAppendConsoleMessageView):
* UserInterface/Views/ScopeBarItem.js:
(WI.ScopeBarItem.prototype.set selected):
(WI.ScopeBarItem.prototype.toggle): Added.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (249037 => 249038)


--- trunk/Source/WebInspectorUI/ChangeLog	2019-08-23 01:07:43 UTC (rev 249037)
+++ trunk/Source/WebInspectorUI/ChangeLog	2019-08-23 01:43:43 UTC (rev 249038)
@@ -1,5 +1,22 @@
 2019-08-22  Devin Rousso  <[email protected]>
 
+        Web Inspector: Console: automatically select the "Evaluations" filter whenever running commands
+        https://bugs.webkit.org/show_bug.cgi?id=201060
+
+        Reviewed by Timothy Hatcher.
+
+        If the Console is actively being filtered (e.g. not "All"), it can be confusing to run a
+        command, only to not see any results. We should automatically enable the "Evaluations"
+        filter in addition to any other existing filters in these cases.
+
+        * UserInterface/Views/LogContentView.js:
+        (WI.LogContentView.prototype.didAppendConsoleMessageView):
+        * UserInterface/Views/ScopeBarItem.js:
+        (WI.ScopeBarItem.prototype.set selected):
+        (WI.ScopeBarItem.prototype.toggle): Added.
+
+2019-08-22  Devin Rousso  <[email protected]>
+
         Web Inspector: REGRESSION(r248485): stack overflow when viewing a source map generated from inline content
         https://bugs.webkit.org/show_bug.cgi?id=201042
         <rdar://problem/54509750>

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.js (249037 => 249038)


--- trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.js	2019-08-23 01:07:43 UTC (rev 249037)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.js	2019-08-23 01:43:43 UTC (rev 249038)
@@ -234,10 +234,12 @@
         let target = messageView.message ? messageView.message.target : WI.runtimeManager.activeExecutionContext.target;
         target.connection.runAfterPendingDispatches(this._clearFocusableChildren.bind(this));
 
-        if (messageView instanceof WI.ConsoleCommandView || messageView.message instanceof WI.ConsoleCommandResultMessage)
-            this._markScopeBarItemUnread(WI.LogContentView.Scopes.Evaluations);
-        else
-            this._markScopeBarItemForMessageLevelUnread(messageView.message.level);
+        if (!this._scopeBar.item(WI.LogContentView.Scopes.All).selected) {
+            if (messageView instanceof WI.ConsoleCommandView || messageView.message instanceof WI.ConsoleCommandResultMessage)
+                this._scopeBar.item(WI.LogContentView.Scopes.Evaluations).toggle(true, {extendSelection: true});
+            else
+                this._markScopeBarItemForMessageLevelUnread(messageView.message.level);
+        }
 
         console.assert(messageView.element instanceof Element);
         this._filterMessageElements([messageView.element]);

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ScopeBarItem.js (249037 => 249038)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ScopeBarItem.js	2019-08-23 01:07:43 UTC (rev 249037)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScopeBarItem.js	2019-08-23 01:43:43 UTC (rev 249038)
@@ -77,13 +77,7 @@
 
     set selected(selected)
     {
-        if (this._selectedSetting.value === selected)
-            return;
-
-        this._element.classList.toggle("selected", selected);
-        this._selectedSetting.value = selected;
-
-        this.dispatchEventToListeners(WI.ScopeBarItem.Event.SelectionChanged, {
+        this.toggle(selected, {
             extendSelection: this._independent || (WI.modifierKeys.metaKey && !WI.modifierKeys.ctrlKey && !WI.modifierKeys.altKey && !WI.modifierKeys.shiftKey),
         });
     }
@@ -105,6 +99,17 @@
         this.dispatchEventToListeners(WI.ScopeBarItem.Event.HiddenChanged);
     }
 
+    toggle(selected, {extendSelection} = {})
+    {
+        if (this._selectedSetting.value === selected)
+            return;
+
+        this._element.classList.toggle("selected", selected);
+        this._selectedSetting.value = selected;
+
+        this.dispatchEventToListeners(WI.ScopeBarItem.Event.SelectionChanged, {extendSelection});
+    }
+
     // Private
 
     _handleMouseDown(event)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to