Skip to content
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

[Enhancement] mouse gesture to "Close this tree" #3230

Closed
joshgold22 opened this issue Oct 14, 2022 · 21 comments
Closed

[Enhancement] mouse gesture to "Close this tree" #3230

joshgold22 opened this issue Oct 14, 2022 · 21 comments

Comments

@joshgold22
Copy link

Could we add a one-step mouse gesture to "Close this Tree" without selecting/loading the tab or using the context menu?
For example: option-click on the "X" close button of the tab.

Environment

  • Platform (OS): OSX 12.6
  • Version of Firefox: 106.0.3
  • Version (or revision) of Tree Style Tab: 3.9.6
@irvinm
Copy link
Contributor

irvinm commented Oct 14, 2022

I think the better ask here is for an addon like Gesturefy (https://addons.mozilla.org/en-US/firefox/addon/gesturefy/) to add support for TST. Adding gestures to TST doesn't feel like part of the goals of this project. @piroor I am sure will weigh in on this.

@joshgold22
Copy link
Author

@irvinm hoo, I myself would find that to be too much and probably wouldn't install something like it. I see some users may want a lot of gestures to control access a lot of actions, but I was just noticing that Close this Tree is special in that it's hard to access (e.g., by shortcut) without loading the tab, and might benefit from a modifier click in the sidebar.

(I'll grant you, exploring just now, that there are others that could be similar, for instance I just tested it and saw that expand-all/collapse-all aren't supported with the typical option-click on the twistie, so perhaps this is more of a pandora's box than I'm understanding.)

Ok, and actually I apologize I didn't find it earlier: we 3 have had this conversation in the past, I'm sorry about that.
See: #2905

@joshgold22
Copy link
Author

And just to clarify @irvinm are you saying that gesturefly can do this now in conjunction wth TST or that something like it could be implemented. (And, would TST-more-tree-commands be a place to consider it? Is that project a place for ways to access commands, or just including more commands?)

@irvinm
Copy link
Contributor

irvinm commented Oct 14, 2022

And just to clarify @irvinm are you saying that gesturefly can do this now in conjunction wth TST or that something like it could be implemented. (And, would TST-more-tree-commands be a place to consider it? Is that project a place for ways to access commands, or just including more commands?)

I'm pretty sure that they would not work in conjunction at this point in time. The concept of "close this tree" is much more TST centric (or really any sidebar addon that supports trees of tabs).

The basic "need" is to track mouse movements and map them to TST actions (TST native, TST-more-tree-commands, or something the helper addon does manually). Given Gesturefy already tracks mouse movement and can map them to items, it would just need to integrate with one of the TST addons ... or TST would need to add mouse tracking which I don't believe is in-line with the goal of the project.

Either way, there is clearly some work to be done ...

@irvinm
Copy link
Contributor

irvinm commented Oct 14, 2022

... and just as I wrote that, I do see that Gesturefy DOES support sending messages to other addons as one of the options that can be tied to a mouse movement.

If you look over https://github.com/Robbendebiene/Gesturefy/wiki/Send-message-to-other-addon there are some examples of what can be done with TST already. (See https://github.com/piroor/treestyletab/wiki/API-for-other-addons for TST commands)

image

@joshgold22
Copy link
Author

joshgold22 commented Oct 14, 2022

The basic "need" is to track mouse movements and map them to TST actions

Is that definitely the case? Do we need to track mouse movements to get/use clicks with modifiers?
Having the whole apparatus for tracking movements seems like it could be very cpu-heavy as well.

@joshgold22
Copy link
Author

(Also not clear that gesturefly could detect clicks on twisties or close-x's. Could it even map an action to a specific tab in the sidebar where the mouse is hovering, or is it more global, i.e., draw a J to trigger a global command like close-current-tab, versus close-this-tab-here)

I'm still curious about the gesturefly integration, since it seems a nice addition to the global keyboard shortcuts given the two APIs are there and could talk, but I'm not sure it solves what I'm looking for (and it's not my style of interaction, personally)

@irvinm
Copy link
Contributor

irvinm commented Oct 14, 2022

I don't think Gesturefy can do anything directly in the sidebar. All of its actions (I believe) are on the main page itself. Therefore if you were on a tab in TST that had children and it was expanded, you would draw a gesture on the main page while holding down the right mouse button, Gesturefy would capture that action, map it to a "Send message to other addon" message and send it to TST to ... Ex: "collapse that tree".

Gesturefy would not have any knowledge if that was appropriate and\or possible, but let TST handle the request.

If you wanted to do gestures in the sidebar when TST was loaded, that would have to be implemented directly from TST and @piroor would have to add that functionality.

@joshgold22
Copy link
Author

Ok, I appreciate that — in that case I think Gesturefly is not on the mark for what I'm looking for, which is (for instance) to be able to scroll through the sidebar tab-list without changing the active tab and close the trees I'm no longer interested in.

@piroor
Copy link
Owner

piroor commented Oct 15, 2022

FYI: TSTのタブを閉じるボタンの挙動を変更 (tst-change-close-tab-button-be) allows you to close the parent and its all descendants with a middle click on the closebox of a parent tab, whether the tree is expanded or collapsed. I think it is very similar to the feature you initially described.

@piroor
Copy link
Owner

piroor commented Oct 15, 2022

Anyway I won't add this as a built-in option. Basically I'm negative to add rich options to TST.

@joshgold22
Copy link
Author

joshgold22 commented Oct 15, 2022

That extension sounds close to perfect, but unfortunately it doesn't seem to work for me. With or without the extension enabled, middle-clicking anywhere on the sidebar tab brings up the standard context menu, including on the close button.

That's information for others reading this, though (perhaps someone can confirm if they can get it to work. I would file an issue, but can't because of the language.)
I respect your decision!

@irvinm
Copy link
Contributor

irvinm commented Oct 15, 2022

@joshgold22, you have to middle-click on the close "x" to close the tree. It worked for me.

@joshgold22
Copy link
Author

Ah, sorry, I just realized middle click is different from "secondary click"/control-click. I'm on a mac, and it appears you need to run extra software to generate a middle click (e.g., bettertouchtool, or more specialized apps that just enable middle-clicking specifically.) Thanks for checking that it worked @irvinm

@piroor
Copy link
Owner

piroor commented Oct 17, 2022

I think that supporting Ctrl-click is good option for the helper addon, and requesting the feature to the addon author looks reasonable. Here is the issue tracker of the addon:
https://github.com/rinsuki/tst-change-close-tab-button-behavior/issues

@joshgold22
Copy link
Author

@piroor Do you think it would be fine for me to post the request in English?

@piroor
Copy link
Owner

piroor commented Oct 17, 2022

@joshgold22 I've looked at activities of the author and there are some conversations in English, so I think they will accept English comments.

@piroor
Copy link
Owner

piroor commented Oct 17, 2022

BTW the addon looks hard to find out for people who don't use Japanese language because it has only descriptions in Japanese, thus I've created a pull request to localize it.
rinsuki/tst-change-close-tab-button-behavior#1

@joshgold22
Copy link
Author

That's great (localization) thanks for doing that.

@github-actions
Copy link

This issue has been closed due to no response within 7 days after labeled as "wontfix", 7 days after last reopened, and 7 days after last commented.

@joshgold22
Copy link
Author

I noted a workaround here:
#2905 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants