|
| 1 | +## Update 2024-10-28 |
| 2 | + |
| 3 | +The conclusion is that automatic custom sorting can be applied only in a subset of 'happy path' scenarios |
| 4 | +The main questions are: |
| 5 | +- can the 'happy' scenarios be recognized in order to apply custom sort? |
| 6 | +- how to handle the remaining scenarios gracefully, when the custom sort can't be applied? |
| 7 | + - on mobile a different approach can be taken |
| 8 | + - a popup telling the user about the condition? |
| 9 | + - probably the condition can't be recognized at all |
| 10 | +- the development cost seems to be getting higher and higher. Maybe stick with a simple reliable |
| 11 | + implementation and intentionally exclude all the complex, deferred, etc. scenarios. |
| 12 | + Tell it explicitly in the documentation. |
| 13 | + |
| 14 | +To automatically apply custom sorting on plugin start, the following prerequisites have to be met: |
| 15 | +- Obsidian's metadata cache populated |
| 16 | + - sorting specifications are read from there |
| 17 | +- File Explorer view available and populated |
| 18 | + - the ordering of Files and Folders happens in File Explorer view (its underlying data model) |
| 19 | + |
| 20 | +Conditions which prevents auto-applying of custom sort: |
| 21 | +- vault notes metadata cache not (yet) populated by Obsidian |
| 22 | + - plugin code can't easily check this condition and distinguish it from the scenario 'no custom sorting specs defined' |
| 23 | + - on mobile populating of the metadata cache by Obsidian can take a very long time (minutes) especially for vaults with large number of notes |
| 24 | +- the File Explorer view is not available because of the deferred views mechanism (introduced in Obsidian 1.7.2) |
| 25 | + - https://docs.obsidian.md/Plugins/Guides/Understanding+deferred+views |
| 26 | + - plugin can't be notified when the lazy view becomes populated and presented, to have a chance to apply custom sorting |
| 27 | + |
1 | 28 | ## Update 2024-10-23 |
2 | 29 |
|
3 | 30 | A major simplification of the auto-sort-on-start is required, a simple and generic approach. |
|
0 commit comments