⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 249038 in webkit


Ignore:
Timestamp:
Aug 22, 2019, 6:43:43 PM (7 years ago)
Author:
Devin Rousso
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.

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r249037 r249038  
     12019-08-22  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Console: automatically select the "Evaluations" filter whenever running commands
     4        https://bugs.webkit.org/show_bug.cgi?id=201060
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        If the Console is actively being filtered (e.g. not "All"), it can be confusing to run a
     9        command, only to not see any results. We should automatically enable the "Evaluations"
     10        filter in addition to any other existing filters in these cases.
     11
     12        * UserInterface/Views/LogContentView.js:
     13        (WI.LogContentView.prototype.didAppendConsoleMessageView):
     14        * UserInterface/Views/ScopeBarItem.js:
     15        (WI.ScopeBarItem.prototype.set selected):
     16        (WI.ScopeBarItem.prototype.toggle): Added.
     17
    1182019-08-22  Devin Rousso  <drousso@apple.com>
    219
  • trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.js

    r248766 r249038  
    235235        target.connection.runAfterPendingDispatches(this._clearFocusableChildren.bind(this));
    236236
    237         if (messageView instanceof WI.ConsoleCommandView || messageView.message instanceof WI.ConsoleCommandResultMessage)
    238             this._markScopeBarItemUnread(WI.LogContentView.Scopes.Evaluations);
    239         else
    240             this._markScopeBarItemForMessageLevelUnread(messageView.message.level);
     237        if (!this._scopeBar.item(WI.LogContentView.Scopes.All).selected) {
     238            if (messageView instanceof WI.ConsoleCommandView || messageView.message instanceof WI.ConsoleCommandResultMessage)
     239                this._scopeBar.item(WI.LogContentView.Scopes.Evaluations).toggle(true, {extendSelection: true});
     240            else
     241                this._markScopeBarItemForMessageLevelUnread(messageView.message.level);
     242        }
    241243
    242244        console.assert(messageView.element instanceof Element);
  • trunk/Source/WebInspectorUI/UserInterface/Views/ScopeBarItem.js

    r242829 r249038  
    7878    set selected(selected)
    7979    {
    80         if (this._selectedSetting.value === selected)
    81             return;
    82 
    83         this._element.classList.toggle("selected", selected);
    84         this._selectedSetting.value = selected;
    85 
    86         this.dispatchEventToListeners(WI.ScopeBarItem.Event.SelectionChanged, {
     80        this.toggle(selected, {
    8781            extendSelection: this._independent || (WI.modifierKeys.metaKey && !WI.modifierKeys.ctrlKey && !WI.modifierKeys.altKey && !WI.modifierKeys.shiftKey),
    8882        });
     
    106100    }
    107101
     102    toggle(selected, {extendSelection} = {})
     103    {
     104        if (this._selectedSetting.value === selected)
     105            return;
     106
     107        this._element.classList.toggle("selected", selected);
     108        this._selectedSetting.value = selected;
     109
     110        this.dispatchEventToListeners(WI.ScopeBarItem.Event.SelectionChanged, {extendSelection});
     111    }
     112
    108113    // Private
    109114
Note: See TracChangeset for help on using the changeset viewer.