SebastianMC / obsidian-custom-sort

Take full control over the order and sorting of folders and notes in File Explorer in Obsidian
GNU General Public License v3.0
252 stars 19 forks source link

Plugin does not work on my system #94

Closed meisterleise closed 9 months ago

meisterleise commented 9 months ago

macOS X.14.6 · Obsidian 1.4.13

Installed the plugin restarted app created a note called "sortspec" inside a folder with subfolders and notes filled with content:

---
sorting-spec: |
  order-desc: a-z
---

restarted app nothing happened can't see a "ribbon button" anywhere (and didn't understand where it should be seen)

SebastianMC commented 9 months ago

Hi @meisterleise

at a glance, assuming that your report is precise, the plugin has not been enabled after installation. At the same time, restarting Obsidian is not needed after new plugin installation.

Please confirm that after installing the plugin, you enabled it. Each Obsidian plugin has to be enabled after installing it.

For the custom-sort plugin, the ribbon button appears after enabling, and it changes its appearance depending on the state of custom sort, initially being inactive (after enabling the plugin).

Ok, if I misunderstood your report and you correctly installed and then enabled the plugin, I will do other checks. First, please confirm the above.

Related remarks:

Please let me know about the step of enabling the plugin

meisterleise commented 9 months ago

Hey thanks, Sebastian! Yes, I know that I have to enable plugins and I did. Sorry for the confusion. Misunderstanding: I don't have macOS 14, I have X.14 = macOS X 10.14.6 ;) Problem: I don't know WHERE I should see the "ribbon button" (you didn't explain that). But I would probably recognise the buttons if they were there...?

SebastianMC commented 9 months ago

Hey @meisterleise

thanks for clarifications!

The ribbon button, in its initial state looks like below:

When clicked, if sorting spec is correct, it gets applied and the ribbon button changes to:

Regardind the macOS version - yes, this can be confusing. I believe I have the macOS 10.14 Mojave on another mac here, I should be able to test. [update: my other mac has macOS 10.12 Sierra, which is too old to handle Obsidian]

Anyways, if you don't see the ribbon button, it could be because of some plugin or another mechanism controlling the ribbon (if any)

To do a test, please invoke the command 'sort on' from Obsidian command palette. This is an equivalent of clicking the ribbon icon/button. Does it work this way?

meisterleise commented 9 months ago

Thank you for your effort! After executing from the command palette it works and after that the ribbon button suddenly appears at the end of the button bar. Yeah!

I mostly got a red button if I pasted one of your config examples. But meanwhile it seems to work. However: In my lists always appears the sortspec file as a part of the lists. In your example not. Is there a way to hide it?

image

SebastianMC commented 9 months ago

Hi @meisterleise

it is a great news that the custom sorting eventually started working for you!

Copy & paste of the examples can be tricky indeed for various reasons. On the long-term roadmap there is a UI-based editor idea, at the same time there are many more items with higher priority, including a refined quality documentation materials and also introducing the drag & drop based items reordering (via integration of Bookmarks core functionality)

Files and folders can be hidden using a special syntax in the plugin, see an example in this discussion

Depending on how many sortspec notes you have, e.g. a single sortspec per entire vault or a sortspec note per each relevant folder or a mixed approach, you will need to explicitly list the path(s) of sortspec note(s) as indicated in the discussion mentioned above.

meisterleise commented 9 months ago

Okay, I tried it. But the file is still visible. What am I doing wrong? image

SebastianMC commented 9 months ago

The sortspec looks correct, so probably the only step missing is to tell the plugin to re-read it. You can force re-reading of sorting specifications by issuing the 'sort on' command. Or by clicking the ribbon button twice. The ribbon button acts as a toggle between the 'active' and 'inactive' states of the custom sort. And switching from 'inactive' to 'active' always involves re-reading the sorting specifications.

meisterleise commented 9 months ago

Sorry I didn't tell. But of course I clicked the ribbon button, restarted the app, doesn't help.

SebastianMC commented 9 months ago

A good catch! I reproduces your scenario from scratch, step by step and encountered the same effect - sortspec note still visible. And then bingo! Being the author of the plugin, I forgot how the /--hide: feature works 8-O It was originally a hidden undocumented feature, that's why no documentation.

The state of things is as follows:

The parameter of /--hide: accepts file names only (not paths) and has effect in the target-folder: (or the parent folder of sortspec note, if not specified explicitly)

In your case, the sortspec note should look like:

---
sorting-spec: |
  test 2
  /--hide: sortspec.md
---

or, if you want to place your sortspec note at the root level of the vault or in any other location (and remove it from the OrdnerTest folder):

---
sorting-spec: |
  target-folder: OrdnerTest
  test 2
  /--hide: sortspec.md
---
meisterleise commented 9 months ago

Ah, now it finally works! Thank you very much for your awesome support!!

SebastianMC commented 9 months ago

Because this exchange contains a series of hints and clarifications potentially useful for others, I'm closing the issue and converting it to a discussion (link will appear in subsequent comment automatically)