Repository navigation
Add right-click context menu to document tabs - #8375
Conversation
- Fixes #1664 - Required change to GWT per rstudio/gwt#8
…oc-tab-context-menu
melissa-barca
left a comment
There was a problem hiding this comment.
Overall looks good, but excludeDocId seems like a more generic excludeActive. What do you think about removing the excludeActive parameter and having onCloseOtherSourceDocs retrieve the doc id of the active editor and pass that in excludeDocId? I believe this is the only place we pass excludeActive as true to closeAllSourceDocs.
Ah, excellent idea. It felt wrong to have these two similar arguments that would never be used at the same time. I'll do that! |
|
Set to draft while I make suggested refactoring. |
melissa-barca
left a comment
There was a problem hiding this comment.
LGTM! Can you update the QA notes to include testing the Close All Except command? The original code for this was tricky with multiple columns.
…oc-tab-context-menu
Intent
Most IDEs have a right-click menu on document tabs, enabling handy shortcuts to common document-level operations.
Fixes #1664
Approach
Add a context menu to RStudio document tabs containing "Close", "Close All", "Close All Others". No doubt many others will be requested (such as in #7289 and #8374), but for now getting these in as a start to wet people's appetites.
This required a small tweak to GWT, covered here: rstudio/gwt#8
The Close and Close All commands reuse existing functionality, but "Close All Others" is new and the reason for most of the changes; can't use the "Close All Except Current" since context menu lets you trigger the action on an unselected editor tab.
I also added a context menu to feature tabs that are closable (e.g. Terminal, Jobs), since people are likely going to start right-clicking on other tabs to see what happens. For feature tabs that can't be closed, right-clicking is now a no-op (instead of bringing up the browser context menu).
QA Notes
Test various combinations of tab types (dirty and clean source editors, viewers such as
View(mtcars), and so forth, in the main source region, source columns, and/or satellite windows.Also retest the File / Close All Except Current menu command, especially with multiple source columns.