jensmtg / influx

An alternative backlinks plugin, which displays relevant and formatted excerpts from notes with linked mentions, based on the position of mentions in the notes' hierarchical structure (bullet level indentation).
MIT License
310 stars 14 forks source link

[bug] Newly typed text in long paragraphs sometimes is displayed below influx section for a few seconds for large notes (Uncaught range error?) #40

Closed danieltomasz closed 1 year ago

danieltomasz commented 1 year ago

It happens with live text and and live text turned off in the Influx, Obsidian is in Live Preview mode.

When I have a note with large number of linked mentions (lets say 20, the are not visible without scrolling) I sometimes observe the following behaviour:

I will try to make a gif to make it better to see what is happening. I also try to turn off other plugins, to see if this persist MacOS 13, Obisidian, 1.02, Influx 2.0.7

danieltomasz commented 1 year ago

I recorded the screen, with recoding the behaviour is even worse (so maybe this is about computational resources - BTW I am on M1 macbook pro, so this shouldnt be a problem) https://www.loom.com/share/6c5189fbc5424592b1a829e7d48f042a

danieltomasz commented 1 year ago

The one thing that come to my mind that this beta plugin I started using could mess up with the Influx function calls and internal states https://github.com/TfTHacker/obsidian42-strange-new-worlds (But probably not)

jensmtg commented 1 year ago

Thanks for an extensive bug report! This is #8 and #29 I suspect, but will check it out when I get a chance.

danieltomasz commented 1 year ago

Reading the issues I think I found the cause, it might be Minimal with wide dataview view enabled

(BTW I just found in the video another bug related to text in bullet points but this is not influx related :P )
https://www.loom.com/share/b792bf10c6cc42c4b85355ab02dccab9

danieltomasz commented 1 year ago

Maybe a way to investigate the issue (MVE);

mediapathic commented 1 year ago

Just to add a couple of data points here:

I am also seeing this behavior, but it does not require a large number of linked notes for me; I see it on notes that have only one or two. I'm using the default theme. I don't get the "text appears under links" consistently, but even when that doesn't happen I still have the list of links disappearing and reappearing while I type (and, with typewriter scroll turned on, this causes the entire document to leap up and down, which is extra annoying).

danieltomasz commented 1 year ago

The other way to make this visible is to enable the vanilla backlinks to actually see disappearing and appearing of the plugin (obsidian backlinks go up and down in the moment the influx is not rendered); as I think, the error happens in small number of notes, but it might be harder to catch by eye as the only a few of backlinks are rendered much faster (it will also depends from how fast the computer is)

jensmtg commented 1 year ago

It's a bug related to how codemirror handles widget extensions. As such, I can't fix this directly, but I have an idea for a work-around that I think will essentially solve the problem. I'll probably get a chance to explore it sometime in the coming month.

emory commented 1 year ago

i wish i would have checked in here first because i'm seeing the same behavior and it sometimes stomps on in-line edits while i'm writing a note! i thought it was related to tag autocomplete or something but it drives me bonkers because it even re-arranges words while i'm writing sometimes.

a brief demonstration from my workstation (12-core i7 MBP touchbar with 32GB of memory) https://www.dropbox.com/s/059vzx7fpa2pr2o/CleanShot%202022-11-03%20at%2016.44.16.mp4?dl=0

this happens in every note i type in; daily or meeting notes, content maps — the vault from the example above has 2700 markdown documents and 9200 files total, most of my vaults are also git repositories though and the .git directory on this particular vault has 3000 files in it. i have configured Influx to operate (include) in my daily notes tree, my zettelkasten tree, my PARA Projects/Areas/Resources/Archive directories.

RedactedVault % find . -type f -name "*md" | wc -l
    2752
RedactedVault% find . -type f | wc -l
    9286

this workstation doesn't run very smoothly but i have IO and cpu time to spare. only thing that may be unusual is that i routinely have a lot of open files. my obsidian vaults are also indexed by DEVONthink. Open and Save dialog boxes can hang for up to minute for some reason that i've never been able to remediate.

zcysxy commented 1 year ago

I am also experiencing this problem. Another issue is that when I delete letters, the window jumps occasionally.

https://www.loom.com/share/babe4f480831460eaf0f8175f7ee7d45

cathywu commented 1 year ago

I'm also experiencing this issue, as well as what's mentioned by @zcysxy.

dummylabs commented 1 year ago

Have the same issue on my macbook pro.

farid56x commented 1 year ago

I have the exact same issue.

pawel-ilnicki commented 1 year ago

@jensmtg any success on the workaround you mentioned by any chance?

pawel-ilnicki commented 1 year ago

I encourage people irritated by this bug to include an additional line at the end of all your most-used templates:

<% tp.file.cursor(1) %>

%% This line stops influx from misbehaving %%

What this achieves is prevents the bug from occurring by having another line below where you type. file.cursor() moves your cursor up after pasting the template, so you don't have to do it manually.

jensmtg commented 1 year ago

@pawel-ilnicki Interesting work-around! No, I've not had the chance to develop this plugin further for a long time, unfortunately. (Life eats you up!) Hopefully I'll get a chance to do so before summer.

farid56x commented 1 year ago

I encourage people irritated by this bug to include an additional line at the end of all your most-used templates:

<% tp.file.cursor(1) %>

%% This line stops influx from misbehaving %%

What this achieves is prevents the bug from occurring by having another line below where you type. file.cursor() moves your cursor up after pasting the template, so you don't have to do it manually.

it works, big thanks! I still have some performance issues with big files, but I can handle that for now.

alranel commented 1 year ago

I'm experiening this as well and sadly it's a showstopper which is a pity because I love this plugin :) @jensmtg, any chance you can elaborate on the workaround you have in mind as mentioned above? That way someone might try to implement it.

jensmtg commented 1 year ago

The workaround that hides influx while typing is in place with the latest version, as an optional but default setting, so this issue should be solved now - to the extent that it can be without access to obsidian internals.

zcysxy commented 1 year ago

The workaround works great! However, when influx disappears, the editor view also moves.

https://user-images.githubusercontent.com/48207708/219582180-4ab097f6-a136-408e-9e58-7b58f85d3f20.mov