Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 08a1f3998383fe5de26c9910bff87e89cb1739f3
      
https://github.com/WebKit/WebKit/commit/08a1f3998383fe5de26c9910bff87e89cb1739f3
  Author: Qianlang Chen <qianlangc...@apple.com>
  Date:   2024-02-21 (Wed, 21 Feb 2024)

  Changed paths:
    M Source/WebInspectorUI/UserInterface/Base/Main.js
    M Source/WebInspectorUI/UserInterface/Protocol/InspectorFrontendAPI.js
    M Source/WebInspectorUI/UserInterface/Views/LogContentView.js

  Log Message:
  -----------
  Fix Web Inspector: Remember the message type selection in the Console tab
rdar://122924275
https://bugs.webkit.org/show_bug.cgi?id=268882

Reviewed by Devin Rousso.

When showing the the inspector's console using `WI.showConsole()`, the
caller can optionally pass in a `requestedScope` to control which levels
(AKA message types) to be filtered automatically when the Console tab
shows up. However, when `requestedScope` is falsy or left empty, it
always applies `WI.LogContentView.Scopes.All` instead, which
overrides the levels selected by default, which are read from local
settings when the scope bar is created at the inspector's startup.

This commit removes the forced application of `Scopes.All`, so when
`requestedScope` is left empty, the Console tab is shown with levels
unchanged, which is the expected behavior when launching the Console tab
through Develop -> Show JavaScript Console (or Option-Command-C).

This fix has one known side-effect: when an inspector tab does not
support split console view, pressing Esc will switch to the actual
Console tab instead. (The Settings tab is one example of such tab.)
This commit will make that also "remember" the previously selected
levels instead of deselecting back to just `Scopes.All`, which is
arguably the correct behavior anyway.

This commit also cleans up on how `requestedScope` gets passed in;
passing in as part of the `options` parameter allows callers of
`showConsole()` to self-document the usage `requestedScope`.

* Source/WebInspectorUI/UserInterface/Base/Main.js:
  - Fix the bug.
  - Adapt to the clean up for the `options` parameter.
* Source/WebInspectorUI/UserInterface/Protocol/InspectorFrontendAPI.js:
(InspectorFrontendAPI.showConsole):
  - Adapt to the clean up for the `options` parameter.
* Source/WebInspectorUI/UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype._showConsoleTab):
  - Adapt to the clean up for the `options` parameter.

Canonical link: https://commits.webkit.org/275143@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to