New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hide workspace tab on middle mouse click #4657
Conversation
Previous feedback on hiding tabs via the button we added to the tab was that it was too easy to accidentally hide a tab without realising. I fear this will have much the same effect. It could be applied to subflow tabs that do have the explicit 'close' icon added. Regardless, the proposed change is not appropriate as it applies to all users of the common tabs UI component. Many uses, such as the sidebar, the broker config node edit dialog etc, use this component but do not allow tabs to be hidden. If we support this, it needs to only apply to closable tabs. I'd personally also add it to the existing click handler rather than add another |
I will revise. I had spotted this was for all tabs, and I did try the middle click on other tabs - they did not close (so I figured, why complicate it) but on reflection, you are right it should be specific to workspace tabs. As for "accidentally hide a tab" i feel this is far more deliberate and intended 🤷 I'll fix it up over the weekend and let you decide 🤞 |
I re-did this to use the existing click handler on the workspace tabs only. Additionally, it calls the RED.action so that all the correct handlers are called (and things like the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - have proposed (and will self-merge) a couple inline comments about what the auxclick handlers are doing as it wasn't immediately obvious until I checked to see what happens if they weren't set 😉
Types of changes
Proposed changes
This was not discussed but rather I was tired of firing up new browser tabs when attempting to close a node-red tab with middle clicking (muscle memory issue tbf)
This PR aligns the behaviour of node-red tabs with how most tabbed environments behave.
I appreciate this was not discussed and it is such a small simple change - i would not be super upset if it was dismissed on those grounds (but hopeful it is accepted of course ;) )
Checklist
npm run test
to verify the unit tests pass