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

Feat: Support Shift+Click to open in right sidebar (with global openInRightSidebar false) #47

Closed
kwand opened this issue Mar 22, 2023 · 4 comments

Comments

@kwand
Copy link
Contributor

kwand commented Mar 22, 2023

As titled. I understand there's a global flag openInRightSidebar to do this all the time, but I find that I would prefer a workflow where the default is this flag is set to false, and I manually choose whether I want to open it in the sidebar with Shift+Click.

Is there any chance this could be implemented?

(Perhaps Shift+Click should be implemented as the inverse of what openInRightSidebar setting is i.e. if someone wanted to use that flag, but also occasionally wanted to open a few tasks in the main window, they could Shift+Click to do it)

@kwand kwand changed the title Support Shift+Click to open in right sidebar (with global openInRightSidebar false) Feat: Support Shift+Click to open in right sidebar (with global openInRightSidebar false) Mar 22, 2023
@kwand
Copy link
Contributor Author

kwand commented Mar 24, 2023

I tried taking a crack at this by changing Line 118 in TaskSection.tsx to onClick={(e) => { openTaskPage(page, {and doing something with e.shiftKey to change the logic.

Unfortunately, it doesn't seem like it's actually picking up when the shift key is pressed for whatever reason (though I could be wrong that this is the right way to do it. I don't know much web development)

@ahonn
Copy link
Owner

ahonn commented Mar 28, 2023

This suggestion sounds good, I plan to support this feature: when holding down the shift key and clicking, it triggers the opposite behavior of the current openInRightSidebar setting.

github-actions bot pushed a commit that referenced this issue Mar 28, 2023
# [1.17.0](v1.16.5...v1.17.0) (2023-03-28)

### Features

* add shift click hotkey to open task in right sidebar, [#47](#47) ([1b5fcd7](1b5fcd7))
* support trigger the opposite behavior of openInRightSidebar, [#47](#47) ([196d5e1](196d5e1))
@ahonn
Copy link
Owner

ahonn commented Mar 28, 2023

The 1.17.0 version has supported this feature, please update the plugin.

@kwand
Copy link
Contributor Author

kwand commented Apr 2, 2023

Updated. And it works great! (Also, I see what went wrong with my implementation, didn't know about e.nativeEvent).

I'll close this now.

@kwand kwand closed this as completed Apr 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants