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

Scrolling neither working by trackpad nor scrollbar #102

Open
porg opened this issue Mar 21, 2022 · 16 comments
Open

Scrolling neither working by trackpad nor scrollbar #102

porg opened this issue Mar 21, 2022 · 16 comments

Comments

@porg
Copy link

porg commented Mar 21, 2022

Environment

sbarex-qlmarkdown: 1.0.3
macOS 11.6.5 (20G527)

Reproduction 1

  • Open long Markdown document in Finder into QuickLook
  • Use the scroll gesture (two finger scroll on MacBook Pro trackpad)
  • Expected: Document scrolls.
  • Actual: Nothing happens.

Reproduction 2

  • Resize the QuickLook window of a long Markdown document
  • Scroll bar shows temporarily
  • Drag the scroll bar
  • Expected: Scroll bar moves and document scrolls accordingly.
  • Actual: Nothing happens.

Screen Recording

Note: In the recording I had a folder incorrectly named "No scrolling in Macdown QuickLook plugin"

  • This was a wrong memory, which I corrected during my reporting process.
  • I'm definetily using: sbarex-qlmarkdown via /Applications/QLMarkdown.app which got there via brew as a cask.
Scrolling.neither.working.by.trackpad.nor.scrollbar.mp4
@porg
Copy link
Author

porg commented Mar 21, 2022

Interestingly when triggering QuickLook via Terminal the scrolling works

qlmanage -p /Users/myUser/path/to/Scrolling\ Demo.md
Testing Quick Look preview with files:
	/Users/myUser/path/to/Scrolling Demo.md
2022-03-21 12:35:46.902 qlmanage[39935:1023163] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x8c13, name = 'com.apple.coredrag'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2022-03-21 12:35:46.974 qlmanage[39935:1023163] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0xc01b, name = 'com.apple.tsm.portname'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2022-03-21 12:36:02.005 qlmanage[39935:1023176] Persistent UI failed to open file file:///Users/myUser/Library/Saved%20Application%20State/com.apple.quicklook.qlmanage.savedState/window_1.data: No such file or directory (2)

QuickLook window differences whether triggered via Finder or Terminal

QuickLook triggered via Finder

QuickLook triggered via Terminal

@sbarex
Copy link
Owner

sbarex commented Mar 21, 2022

The bug is only for long documents? Can you share a .md file?

There are no API to control the buttons in the Quick Look title window (also the title is not customizable before macOS 12). The buttons (and the "debug" title prefix) are automatically inserted by qlmanage.

@sbarex
Copy link
Owner

sbarex commented Mar 21, 2022

I suggest you try to convert the markdown file to html with the utility:

/Applications/QLMarkdown.app/Contents/Resources/qlmarkdown_cli /Users/myUser/path/to/Scrolling\ Demo.md -o /Users/myUser/path/to/Scrolling\ Demo.html

The try to view the generated html with the Quick Look. If the bug still occurs it means that it is not due to my application but to what problem of your system (the preview of html files is always managed by the operating system).

@porg
Copy link
Author

porg commented Mar 21, 2022

Closing this for now as a false alarm

Just experienced something really mysterious. Probably we will never know how to explain this.

I used your qlmarkdown_cli but unintentionally used the same file for input and output, hence overwrote the MD with the HTML. Then used TimeMachine to restore the MD from backup.

From then on all my .MD files everywhere on disk suddenly scroll correctly again in QuickLook! 🙂

I suspect some caching or config that was wrong and that was reset by the procedure as an unintended but welcome side effect.

Whatever has happened behind the scenes. Now scrolling works again. Both on MD and the manually converted HTML version, which I wrote to a correct html-suffixed file after I restored the backup.

@porg porg closed this as completed Mar 21, 2022
@porg
Copy link
Author

porg commented Mar 21, 2022

Sorry I oversaw one more question of you, which I want to answer, nevertheless of having closed this issue myself:

The bug is only for long documents? Can you share a .md file?

  • "Longer document" as in "more than what fits into the default viewport" as in "everything that requires scrolling".
  • Every .MD document which fulfilled that criteria, triggered the bug. Experienced this the last 1-3 weeks as I recall it.
    Now it's gone, luckily.

Sample: This 5 paragraph lorem ipsum: Scrolling Demo.md.txt

@porg
Copy link
Author

porg commented Mar 23, 2022

Reopening

  • Re-experienced the bug
  • Now could better reproduce what leads to getting out of the situation:
    • qlmanage -r -> Bug persists.
    • Restart Finder -> Scrolling works again. So what could be the cause?
  • FYI mdls myfile.md on my system gives this Uniform Type Identifier:
…
kMDItemKind                            = "Markdown Document"
…
kMDItemContentTypeTree                 = (
    "net.daringfireball.markdown",
    "public.plain-text",
    "public.text",
    "public.data",
    "public.item",
    "public.content"
)
…

@sbarex
Copy link
Owner

sbarex commented Mar 23, 2022

have you tried as I told you to generate the html file with the command line utility and then try to see if the preview of the html file has problems?

@porg
Copy link
Author

porg commented Mar 23, 2022

As I wrote yesterday:

I used your qlmarkdown_cli but unintentionally used the same file for input and output, hence overwrote the MD with the HTML. Then used TimeMachine to restore the MD from backup. From then on all my .MD files everywhere on disk suddenly scroll correctly again in QuickLook! 🙂

And now the Finder restart has also resolved the situation again.

As of now both a .MD and its .HTML counterpart gained from a qlmarkdown_cli conversion scroll correctly.

When I get into the bug situation again, I will try a HTML conversion with qlmarkdown_cli and see whether it differs in scrolling behavior. And only then restart Finder.

@porg
Copy link
Author

porg commented Mar 23, 2022

I hereby re-open the issue until we have more clarity on it.

@porg porg reopened this Mar 23, 2022
@porg
Copy link
Author

porg commented Mar 23, 2022

Encountered it again:

  1. file.md in QuickLook in Finder had no scrolling.
  2. qlmarkdown_cli file.md -o file.html
  3. Now when using QuickLook in Finder the situation is: ✅file.html scrolls, ❌ file.md does not scroll!
  4. qlmanage -r --> ❌ Situation unchanged to step 3.
  5. Closing Finder window. Navigating there again --> ❌ Situation unchanged to step 3.
  6. Relaunching Finder. Navigating there again --> ✅ file.html scrolls, ✅ file.md scrolls!

@porg
Copy link
Author

porg commented Mar 25, 2022

Encountered it again. Restarted macOS (instead of just Finder) --> Markdown in QuickLook scrolls normal again.

Question is, what leads to scrolling being stuck? And where/who is the proper addressee of this bug report?

@sbarex
Copy link
Owner

sbarex commented Mar 25, 2022

Unfortunately I don't have a macOS 11 to test. In macos 12 a different API is used which seems to work much better. Before Monterey there are a lot of bugs in the webkit view inside a quicklook.

Try to replace the qlmarkdown app with this debug version that use the deprecated webview. Thre preview shows a "LEGACY VIEW" warning at the first line. This version cannot shows remote images.

QLMarkdown.zip

@porg
Copy link
Author

porg commented Mar 25, 2022

Thanks for the offer.

  • Though no remote image support is worse than having to relaunch Finder every here & then to get scrolling working again. So I will not use it. Unless you want me to test it actively to gain more knowhow on the bug.
  • Offtopic: Sadly with my Retina MacBook Pro 15'' (Mid 2014) I'm not qualified for macOS Monterrey. Although cynically I get a notification that it's available for me, but as soon as clicked it leads me to System Preferences where it tells me I have the newest Big Sur upgrade available. Sadly again a QA screwup, which did happen very rarely in the Steve Jobs era.

@sbarex
Copy link
Owner

sbarex commented Mar 25, 2022

The remote image restriction is only temporary. if the bug gets fixed I could try to implement remote image support. It seems that with the old api it is not possible to load images due to the sandbox limitations.

@porg
Copy link
Author

porg commented Mar 25, 2022

Then my pro/con balance is clear and I stick with this bug on macOS Big Sur as-is and use a Finder relaunch whenever necessary.

@porg
Copy link
Author

porg commented Jan 11, 2023

Scrolling in QLManage in Finder fails at a certain point but continues working in qlmanage

New observation

  • When the Finder reaches that broken state where scrolling does not work anymore.
  • Then invoking via qlmanage -p <file> still produces a QuickLook window with correct scrolling.
    • So I assume the bug cause seems to be in Finder rather than QuickLook.
  • 👇 Btw meanwhile I made myself a cool QuickLook productivity feature, that I share with you 👇

Open selected text as filepath in QuickLook

  • I build myself a Automator Quick Action (aka service)
  • and via System Preferences → Keyboard → Services assigned it the hotkey ⌃⌥ ⌘ - SPACE.
  • The currently selected text gets passed as a filepath to qlmanage.
  • Whenever I read a relative filepath to a config file on a support web page, in an email, diary entry, etc, I just select the filepath text and press ⌃⌥ ⌘ - SPACE and have my QuickLook of it instantly. Great!

Open selected text as filepath in QuickLook

  • This also continued to work when the Finder was in the broken state.
  • Dragged the Markdown file onto TextEdit to get its filepath, then selected the filepath, and ⌃⌥ ⌘ - SPACE instantly gave me a scrolling QuickLook window.

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