Bug 230600

Summary: Web Inspector: add a pinned [+] button to the tab bar to make it easier to re-open closed tabs
Product: WebKit Reporter: Devin Rousso <drousso>
Component: Web InspectorAssignee: Devin Rousso <drousso>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, drousso, ews-watchlist, inspector-bugzilla-changes, joepeck, pangle, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
bburg: review+
Patch none

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>