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

Require Ctrl to trigger page preview on hover #80

Open
g-adel opened this issue Jun 13, 2023 · 12 comments
Open

Require Ctrl to trigger page preview on hover #80

g-adel opened this issue Jun 13, 2023 · 12 comments

Comments

@g-adel
Copy link

g-adel commented Jun 13, 2023

Hello, I'm struggling a bit with the page preview feature of Quick-Explorer. It can be quite distracting when looking for a file, and with some files like pdfs, the preview is actually large enough that it covers the link to the pdf, making it inaccessible.

I see there's a setting for toggling on the requirement of holding Ctrl to trigger Page Preview. However, I'm finding that whether I'm holding the Ctrl button or not (with the setting on or off), the preview shows up anyhow. I tried this on a fresh vault and found the exact same behavior. Let me know if you'd like any further details. Thanks!

@pjeby
Copy link
Owner

pjeby commented Jun 14, 2023

The Tab key toggles auto-preview on and off, and it's turned on by default whenever Obsidian starts or the plugin loads. Once you turn it off it will stay off until the next restart of Obsidian or the plugin.

@g-adel
Copy link
Author

g-adel commented Jun 14, 2023

Ah... thanks for that! Is there no way to make the default off? It's a bit weird that there's a redundancy with the setting and that it can't be turned off permanently. Also, it might be a good idea to add this tooltip to the settings page :D
Thanks again!

@pjeby
Copy link
Owner

pjeby commented Jun 14, 2023

No, there is not a way to change the default. Also, I don't control the settings page -- that's created by Obsidian.

@g-adel
Copy link
Author

g-adel commented Nov 22, 2023

Sorry to come back to this. I'm starting to become painfully aware that this default preview setting makes using the extension on a Windows tablet quite difficult (no tab key in touch keyboard). Do you know if there's a way to switch off this behavior from the user side at least? I can't find anything about this tab toggle from Obsidian's side.

BTW Thanks for the amazing plugin, it's become a staple in my workflow :D

@pjeby
Copy link
Owner

pjeby commented Nov 23, 2023

The settings I was referring to was the "Page Preview" core plugin settings, which is how you set whether Ctrl is required for a popup to appear in various places. If you turn off QE's auto-hover (using Tab), then whether Ctrl is required is determined by that setting. By turning on the toggle labeled "Quick Explorer" in that settings page, then QE will require Ctrl to hover preview (as long as you've initially turned the function off with Tab).

What keys are available on your tablet?

@g-adel
Copy link
Author

g-adel commented Nov 23, 2023

Thanks for the clarification. The problem I'm facing is that I can't turn off the function with Tab. I, myself, don't even need hover for QE. It gets particularly bad on a windows tablet (Surface Go) because the hover actually covers over the QE menu itself; making half of the menu inaccessible under the preview window.
The touchscreen keyboard has a Shift, Ctrl, and Enter for modifiers. I suppose I can try to find another touchscreen keyboard app. It's just that turning off (or just inverting) this feature would be a lot easier for my workflow.

If the problem is unsolvable on your side then it's of course no problem, thanks again.

@pjeby
Copy link
Owner

pjeby commented Nov 23, 2023

Well, I could add another hotkey for it. You also could make a patched version of the plugin. I could even add a setting of some kind. It's just not something that I've needed myself or taken any time to do at present.

@g-adel
Copy link
Author

g-adel commented Nov 24, 2023

If you could inform me how I can patch the extension or provide a setting for it, I'd be very grateful :D

@pjeby
Copy link
Owner

pjeby commented Nov 25, 2023

If you're able to build the plugin yourself, you can change this line:

let autoPreview = true
to say false instead of true. Otherwise, you'd need to edit the local main.js, looking for code like this:

var x=!0,P=class extends F{constructor(e,t,o,n){super(e);this.parent=e;this.folder=t;this.selectedFile=o;this.crumb=n;this.parentFolder=this.parent instanceof P?this.parent.folder:null;this.fileCount=e=>e instanceof c.TFolder?e.children.map(...

And change the !0 to !1. This is a harder change to make because 1) you mustn't change anything else, and 2) the x= bit might be another letter -- you have to search for the first occurrence of this.parentFolder and look backwards to just before the class to find the !0.

A future version of the plugin will include an option to set the default, along with probably some other options.

@g-adel
Copy link
Author

g-adel commented Nov 25, 2023

That worked! Thanks a bunch!!

@Ai-Jani
Copy link

Ai-Jani commented Jul 30, 2024

I was searching for this information, thank you so much for this great plugin too!

@greetclammy
Copy link

greetclammy commented Oct 22, 2024

Piling on to request a permanent auto-preview disable option 🙏 The current tab-press solution resets on restart and direct code modifications are bound to break when the plugin updates. @pjeby

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

4 participants