Bug 230600 - Web Inspector: add a pinned [+] button to the tab bar to make it easier to re-open closed tabs
Summary: Web Inspector: add a pinned [+] button to the tab bar to make it easier to re...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-09-22 00:51 PDT by Devin Rousso
Modified: 2021-09-22 21:09 PDT (History)
8 users (show)

See Also:


Attachments
Patch (15.43 KB, patch)
2021-09-22 00:52 PDT, Devin Rousso
bburg: review+
Details | Formatted Diff | Diff
Patch (15.42 KB, patch)
2021-09-22 20:38 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Rousso 2021-09-22 00:51:54 PDT
.
Comment 1 Devin Rousso 2021-09-22 00:52:20 PDT
Created attachment 438930 [details]
Patch
Comment 2 Patrick Angle 2021-09-22 08:40:01 PDT
Comment on attachment 438930 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=438930&action=review

Nice! Much more discoverable. Provision r+ from me.

> Source/WebInspectorUI/UserInterface/Views/TabBar.js:770
> +        contextMenu.show();

Aside: It's unfortunate I still haven't let us provide a coordinate at which to show the menu so it can be more neatly aligned below the tab bar item.
Comment 3 BJ Burg 2021-09-22 08:52:57 PDT
Comment on attachment 438930 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=438930&action=review

r=me

> Source/WebInspectorUI/ChangeLog:23
> +        Drive-by: Remove `_handleTabContainerClick` as tabs can only be removed from the contextmenu.

s/from/by using/

So in other words, this is dead code. Right? I wasn't able to trigger the previous behavior of "option-click to delete" in a build without this change.
Comment 4 Devin Rousso 2021-09-22 20:37:41 PDT
Comment on attachment 438930 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=438930&action=review

>> Source/WebInspectorUI/ChangeLog:23
>> +        Drive-by: Remove `_handleTabContainerClick` as tabs can only be removed from the contextmenu.
> 
> s/from/by using/
> 
> So in other words, this is dead code. Right? I wasn't able to trigger the previous behavior of "option-click to delete" in a build without this change.

Correct.  I wasn't even able to get this event listener to fire.  I think some other things may be `stopPropagation`.

>> Source/WebInspectorUI/UserInterface/Views/TabBar.js:770
>> +        contextMenu.show();
> 
> Aside: It's unfortunate I still haven't let us provide a coordinate at which to show the menu so it can be more neatly aligned below the tab bar item.

Heh yeah that would be nice to have.  I could imagine using that in a bunch of places to simulate the behavior of a `<select>` where the text in the page lines up with the text inside the contextmenu.  Would love to see it =D

We probably just need another method along the lines of `InspectorFrontendHost::dispatchEventAsContextMenuEvent` that takes an `EventTarget` (or even just `float x, float y`) and does all the logic from there .  Frankly the fact that we require a `MouseEvent` is quite arbitrary (other than having a mouse location).
Comment 5 Devin Rousso 2021-09-22 20:38:43 PDT
Created attachment 439008 [details]
Patch
Comment 6 EWS 2021-09-22 21:08:35 PDT
Committed r282905 (242033@main): <https://commits.webkit.org/242033@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 439008 [details].
Comment 7 Radar WebKit Bug Importer 2021-09-22 21:09:19 PDT
<rdar://problem/83430573>