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

Add reordering functionality for custom rules #237

Merged
merged 6 commits into from
Sep 17, 2023

Conversation

FlorianWoelki
Copy link
Owner

This is an adaption of #229 which implements #71 for the fix of #226

@Mara-Li
Copy link
Contributor

Mara-Li commented Sep 16, 2023

Some testing with theses rules:

"rules": [
      {
        "rule": "sandbox",
        "icon": "FarFolder",
        "for": "folders",
        "filepath": true,
        "useFilePath": true,
        "order": 0
      },
      {
        "rule": "subfolder",
        "icon": "BoBxsBolt",
        "for": "files",
        "order": 1,
        "useFilePath": true
      },
      {
        "rule": "\\.md$",
        "icon": "LiFile",
        "for": "files",
        "order": 2
      }
]

Tree:

sandbox/
├─ subfolder/
│  ├─ fix/
│  │  ├─ eroerj er/
│  │  │  ├─ test.md
│  │  │  ├─ truc.md

Renamed file :

Renaming a file add the default icon (.md), not the subfolder icon

Creating file

No issue found, but as renaming change the icon to the default one…

Note

Reloading Obsidian fix the icons problem, so each time:

  • We rename a file
  • We move a file
  • We edit the custom rules (order or type)

We need to reload Obsidian.

@FlorianWoelki
Copy link
Owner Author

FlorianWoelki commented Sep 17, 2023

Some testing with theses rules:

"rules": [
      {
        "rule": "sandbox",
        "icon": "FarFolder",
        "for": "folders",
        "filepath": true,
        "useFilePath": true,
        "order": 0
      },
      {
        "rule": "subfolder",
        "icon": "BoBxsBolt",
        "for": "files",
        "order": 1,
        "useFilePath": true
      },
      {
        "rule": "\\.md$",
        "icon": "LiFile",
        "for": "files",
        "order": 2
      }
]

Tree:

sandbox/
├─ subfolder/
│  ├─ fix/
│  │  ├─ eroerj er/
│  │  │  ├─ test.md
│  │  │  ├─ truc.md

Renamed file :

Renaming a file add the default icon (.md), not the subfolder icon

Creating file

No issue found, but as renaming change the icon to the default one…

Note Reloading Obsidian fix the icons problem, so each time:

  • We rename a file
  • We move a file
  • We edit the custom rules (order or type)

We need to reload Obsidian.

Thank you for the detailed explanation. These issues should be resolved now.

@Mara-Li
Copy link
Contributor

Mara-Li commented Sep 17, 2023

Fixed! Ty :>

@FlorianWoelki FlorianWoelki merged commit 3fabdc1 into main Sep 17, 2023
2 checks passed
@FlorianWoelki FlorianWoelki deleted the add-reordering-for-custom-rules branch September 17, 2023 15:14
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

Successfully merging this pull request may close these issues.

2 participants