ahonn / logseq-plugin-todo

A simple to-do list plugin for logseq
MIT License
157 stars 11 forks source link

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

Closed kwand closed 1 year ago

kwand commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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.

ahonn commented 1 year ago

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

kwand commented 1 year ago

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.