aidenlx / alx-folder-note

Add description, summary, and more info to folders with folder notes.
MIT License
244 stars 13 forks source link

Folder notes no longer open when clicking on the folder (Obsidian Desktop v1.5.4) #134

Open FitzFrobozz opened 6 months ago

FitzFrobozz commented 6 months ago

After applying the Obsidian 1.5.4 update this morning (Insider release), folder note notes no longer open when I click on the folder.

Workaround(s): (None found so far.)

Errors from Console:

app.js:1 Failed to open view TypeError: Cannot read properties of undefined (reading 'navFileContainerEl')
    at t.eval (plugin:alx-folder-note:4821:45)
    at t.wrapper [as load] (plugin:alx-folder-note:4107:20)
    at t.<anonymous> (app.js:1:1418947)
    at app.js:1:237518
    at Object.next (app.js:1:237623)
    at app.js:1:236539
    at new Promise (<anonymous>)
    at v (app.js:1:236284)
    at t.open (app.js:1:1418819)
    at t.<anonymous> (app.js:1:1841668)
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'fileBeingRenamed')
    at eval (plugin:alx-folder-note:4274:23)
    at t.eval (plugin:alx-folder-note:4883:20)
    at t.wrapper [as onSelfClick] (plugin:alx-folder-note:4107:20)
    at HTMLDivElement.<anonymous> (app.js:1:1466273)
lx0n2acl commented 6 months ago

looks like some of the properties were renamed. here is a quick fix / work around until the official one comes through:

go to file: .obsidian/plugins/alx-folder-note/main.js

find this line item.fileExplorer.fileBeingRenamed === item.file change to item.fileExplorer?.fileBeingRenamed === item.file

find this block

    if (item && item.collapsed) {
      item.setCollapsed(false);
      this.plugin.app.nextFrame(() => {
        this.fileExplorer.dom.infinityScroll.computeSync();
        this.fileExplorer.dom.infinityScroll.scrollIntoView(item);
      });
    }
    this.fileExplorer.dom.navFileContainerEl.toggleClass(focusModeCls, !!item);

change to

    if (item && item.collapsed) {
      item.setCollapsed(false);
      this.plugin.app.nextFrame(() => {
        this.fileExplorer.tree.infinityScroll.computeSync();
        this.fileExplorer.tree.infinityScroll.scrollIntoView(item);
      });
    }
    this.fileExplorer.navFileContainerEl.toggleClass(focusModeCls, !!item);

there are probably more fixes but this works for me to get the folder to be clickable again ymmv

FitzFrobozz commented 6 months ago

looks like some of the properties were renamed. here is a quick fix / work around until the official one comes through: ... there are probably more fixes but this works for me to get the folder to be clickable again ymmv

Thank you so much, lx0n2acl! Works perfectly. I also want to express my profound appreciation for your willingness to tackle this right away and despite the fact that the issue was introduced by an Insider build.

Steve-Klingele commented 6 months ago

this fixed it for me as well.

FitzFrobozz commented 6 months ago

Are you guys seeing this issue again today? I'm not clear on what might have changed, but it's back for me. (I just double-checked and main.js still shows the changes made yesterday.)

Steve-Klingele commented 6 months ago

Still working for me

schobernoise commented 6 months ago

Same here!

plugin:alx-folder-note:4274 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'fileBeingRenamed')
    at eval (plugin:alx-folder-note:4274:23)
    at t.eval (plugin:alx-folder-note:4883:20)
    at t.wrapper [as onSelfClick] (plugin:alx-folder-note:4107:20)
    at HTMLDivElement.<anonymous> (app.js:1:1466273)
jacovanderlaan commented 6 months ago

Works great for me as well. Thanks for the solution!

Afx31 commented 6 months ago

Workaround works for me, as said above thankyou for the swift temp resolution so we can continue on using it!

SpocWeb commented 6 months ago

Hi, I have a regular Obsidian Desktop v1.5.8 and have the same Phenomenon. This Workaround works for the v1.5.8 and seems to be necessary. Can someone please file a PR for this Plugin?

lodaket commented 6 months ago

Awesome. Thank you so much for this fix. Same as SpocWeb, v1.5.8 and working for me.

thatside commented 6 months ago

This issue seems to be related to https://github.com/aidenlx/alx-folder-note/issues/130 and probably will be fixed by https://github.com/aidenlx/alx-folder-note/pull/133.

brokeboiflex commented 6 months ago

@lx0n2acl Could you make a pull request with your fix?

lx0n2acl commented 6 months ago

@brokeboiflex I can but it looks like there are already 2 PRs with these fixes in them as well as some additional work. It's up to the ower of the repo to merge those when ready. @aidenlx any updates?

BatPanda commented 5 months ago

@lx0n2acl thank you for the quick fix! My 1.5.8 version was also not working. Lets hope @aidenlx sees this soon. 😄

CobaltMongoose commented 5 months ago

thanks for the work around. Yeah, I don't think I'll allow Obsidian to update ever again. Feels like russian roulette every time.

marcinsmialek commented 5 months ago

@CobaltMongoose this is an issue with extension, which was "working good enough" under the past conditions.

The fix was provided on January 7th, but the last extension update was over a year ago. Since that, no changes / fixes have been included. Let's hope that the PRs will be merged

claremacrae commented 5 months ago

I just want to say that I really, really feel for @aidenlx at this point, receiving repeated requests to deal with this repo.

If they had the capacity to do this currently, I imagine they would have done.

The thing about free software is that people make it in their spare time and offer it to others. And sometimes circumstances change and they can no longer maintain it.

And it can be easy for users to not understand the burden that repeated requests can place, in the situation. (Heck, they can be a burden even when one can maintain the project...)

An alternative to seemingly demanding that the software be updated - for free - is:

  1. be thankful that you could use it for as long as you could, for free...
  2. and then to search the Obsidian Community Store for newer plugins to see if there is one that meeds your needs.
marcinsmialek commented 5 months ago

Yeah, that's more demanding than one can expect. Heck, that's one of the reasons why there aren't more plug-ins, or open-source software in general.

SebastianMC commented 5 months ago

I'm the author of obsidian-custom-sort plugin which was also affected by the breaking changes in File Explorer introduced in Obsidian 1.5.4. To fix the problem in my plugin I invested some time in a reverse engineering of Obsidian code to track back the relevant changes and then apply the required fixes.

I'm also a user of this alx-folder-note plugin (absolutely love it!) and when I found this discussion thread today I did two things: 1) to simplify the life of not advanced users, I've created a fork of this alx-folder-note repository and applied the same fixes as for my plugin. Then created an official release in the fork, which means that you can install the patched alx-folder-note, compatible with Obsidian 1.5.4 (and newer), via the well known BRAT plugin. The plugin reference to use in BRAT is https://github.com/SebastianMC/alx-folder-note or - in shorter version - SebastianMC/alx-folder-note. 2) to expose the code changes (the actual fix) I've created yet another pull request (#138). It contains the full set of required code changes (the two preexisting PRs cover this partially), and it contains only these code changes, isolated, for clarity. It can be helpful if one wants to apply the patch locally

Hopefully the author will find time to take care of fixing the issue. Until then I'm switching to use the alx-folder-note plugin installed via BRAT from the mentioned forked-and-patched repository (https://github.com/SebastianMC/alx-folder-note)

quillmondo commented 5 months ago

This worked! Thanks very much.

TheOnlyWayUp commented 4 months ago

looks like some of the properties were renamed. here is a quick fix / work around until the official one comes through:

go to file: .obsidian/plugins/alx-folder-note/main.js

find this line item.fileExplorer.fileBeingRenamed === item.file change to item.fileExplorer?.fileBeingRenamed === item.file

find this block

    if (item && item.collapsed) {
      item.setCollapsed(false);
      this.plugin.app.nextFrame(() => {
        this.fileExplorer.dom.infinityScroll.computeSync();
        this.fileExplorer.dom.infinityScroll.scrollIntoView(item);
      });
    }
    this.fileExplorer.dom.navFileContainerEl.toggleClass(focusModeCls, !!item);

change to

    if (item && item.collapsed) {
      item.setCollapsed(false);
      this.plugin.app.nextFrame(() => {
        this.fileExplorer.tree.infinityScroll.computeSync();
        this.fileExplorer.tree.infinityScroll.scrollIntoView(item);
      });
    }
    this.fileExplorer.navFileContainerEl.toggleClass(focusModeCls, !!item);

there are probably more fixes but this works for me to get the folder to be clickable again ymmv

Can reproduce, this fixed it. Thank you!

HippyCraig commented 1 week ago

I’m on obsidian 1.6.7 and this change is not working for me. Any advice?

lethefrost commented 1 week ago

I'm the author of obsidian-custom-sort plugin which was also affected by the breaking changes in File Explorer introduced in Obsidian 1.5.4. To fix the problem in my plugin I invested some time in a reverse engineering of Obsidian code to track back the relevant changes and then apply the required fixes.

I'm also a user of this alx-folder-note plugin (absolutely love it!) and when I found this discussion thread today I did two things:

  1. to simplify the life of not advanced users, I've created a fork of this alx-folder-note repository and applied the same fixes as for my plugin. Then created an official release in the fork, which means that you can install the patched alx-folder-note, compatible with Obsidian 1.5.4 (and newer), via the well known BRAT plugin. The plugin reference to use in BRAT is https://github.com/SebastianMC/alx-folder-note or - in shorter version - SebastianMC/alx-folder-note.
  2. to expose the code changes (the actual fix) I've created yet another pull request (#134 - fix to breaking changes introduced in Obsidian 1.5.4 (they did an internal refactoring of File Explorer, the fix follows the refactoring accordingly) #138). It contains the full set of required code changes (the two preexisting PRs cover this partially), and it contains only these code changes, isolated, for clarity. It can be helpful if one wants to apply the patch locally

Hopefully the author will find time to take care of fixing the issue. Until then I'm switching to use the alx-folder-note plugin installed via BRAT from the mentioned forked-and-patched repository (https://github.com/SebastianMC/alx-folder-note)

Would it be possible to add an option to make clicking on all the folder titles (regardless of whether they have a folder note or not) don't fold/unfold the folder? For now, turning off the Expand folder on click option only takes effect on the folders containing folder notes. And with the inconsistent behavior, the long press to focus feature doesn't work well on those folders without folder notes. If you long press on their title, they will first expand and when you release the mouse button they will immediately collapse.

Thank you so much for the efforts making those fixes in your beta repository! It's awesome and still works in v1.7.

HippyCraig commented 6 days ago

This worked for me thanks

I'm the author of obsidian-custom-sort plugin which was also affected by the breaking changes in File Explorer introduced in Obsidian 1.5.4. To fix the problem in my plugin I invested some time in a reverse engineering of Obsidian code to track back the relevant changes and then apply the required fixes. I'm also a user of this alx-folder-note plugin (absolutely love it!) and when I found this discussion thread today I did two things:

  1. to simplify the life of not advanced users, I've created a fork of this alx-folder-note repository and applied the same fixes as for my plugin. Then created an official release in the fork, which means that you can install the patched alx-folder-note, compatible with Obsidian 1.5.4 (and newer), via the well known BRAT plugin. The plugin reference to use in BRAT is https://github.com/SebastianMC/alx-folder-note or - in shorter version - SebastianMC/alx-folder-note.
  2. to expose the code changes (the actual fix) I've created yet another pull request (#134 - fix to breaking changes introduced in Obsidian 1.5.4 (they did an internal refactoring of File Explorer, the fix follows the refactoring accordingly) #138). It contains the full set of required code changes (the two preexisting PRs cover this partially), and it contains only these code changes, isolated, for clarity. It can be helpful if one wants to apply the patch locally

Hopefully the author will find time to take care of fixing the issue. Until then I'm switching to use the alx-folder-note plugin installed via BRAT from the mentioned forked-and-patched repository (https://github.com/SebastianMC/alx-folder-note)

Would it be possible to add an option to make clicking on all the folder titles (regardless of whether they have a folder note or not) don't fold/unfold the folder? For now, turning off the Expand folder on click option only takes effect on the folders containing folder notes. And with the inconsistent behavior, the long press to focus feature doesn't work well on those folders without folder notes. If you long press on their title, they will first expand and when you release the mouse button they will immediately collapse.

Thank you so much for the efforts making those fixes in your beta repository! It's awesome and still works in v1.7.

Thanks this worked great for me hopefully the owner will incorporate your changes.