Repository navigation
feat: add options to close multiple visible tabs in context menu - #6515
Conversation
example.mp4 |
Since this feature is pretty small, it isn't that much of an issue. Browsers have these options when closing tabs, so in my opinion, it's worth having this in Chatterino too.
Speaking of browsers: in Firefox, these options are in a submenu. To close multiple tabs using the mouse, you'd right-click the tab and select "Close Multiple Tabs > Close Other Tabs". However, in Chrome, they're in the main context menu.
As long as it reopens some split closed by the operation, that should be fine. Which split is reopened should be considered implementation-defined until someone has a strong opinion about it and opens an issue. |
|
I added the options to close all tabs to the left or to the right. I also took the Firefox approach and grouped everything into a submenu (which I think removed the need for confirmation prompts). Lastly, I made it so this submenu is disabled if there's only one tab and the same thing for "close left" or "close right" depending if the tab is in a corner and which one. Regarding tab visibility, right now it closes everything, even if it's hidden, I think it makes more sense to close only what's visible. My next steps will be related to this, but I wanted to ask first if that's also the behavior you would expect. |
There was a problem hiding this comment.
I think using Firefox's naming and order for the tab options would be good. If we only want it to apply to visible tabs (which I think is feasible), I don't mind making the naming of the options even more verbose:
- "Close Visible Tabs to Left"
- "Close Visible Tabs to Right"
- "Close Other Visible Tabs"
I'm missing a confirmation option when closing tabs this way.
CTRL+G currently does nothing since it only operates on splits. If you close a tab, either by normal means or with your new functionality, CTRL+G does nothing since the tab it would try to re-open the split in doesn't exist.
I don't know the correct approach here, but I don't think it's up to you in this PR to solve this.
…d-close-other-tabs
…d-close-other-tabs
pajlada
left a comment
There was a problem hiding this comment.
Just these two nits, otherwise looks good
|
Alternatively, you could use Notebook's |
|
It seems Notebook already had the functions I needed! I also changed |
…tterino#6515) Reviewed-by: nerix <nero.9@hotmail.de> Reviewed-by: pajlada <rasmus.karlsson@pajlada.com>
This is a draft PR for the "close all tabs" and "close other tabs" features, as commonly seen in web browsers.
I recently had to close all my Chatterino tabs and my first instinct was to look for it in the context menu, there wasn't an option so I closed them manually, having to tediously click yes on the confirmation prompts every time. I now know I could have spammed "ctrl + shift + W" to do it quicker, but I still think the dedicated buttons are more user friendly.
A few of my concerns:
Feedback is appreciated, thanks!