Skip to content

Commit 676ad34

Browse files
committed
Added tech doc with list of challenges and a solution idea
#163 #162 #161
1 parent b096e4c commit 676ad34

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## Challenges to address (as of 2.1.14):
2+
3+
- the initial notifications "Custom sorting ON" and "Parsing custom sorting specification SUCCEEDED!"
4+
don't reflect the actual state in some cases - the custom sorting is not applied
5+
- the notifications are shown more than once in some cases
6+
- when the File Explorer is not visible on start (1.7.2 and the lazy views) it is not possible to auto-apply custom sort
7+
and attempting to do so ends up with an error
8+
- there are more challenges when attempting to apply the custom sorting automatically on start
9+
10+
An idea of solution, not ideal, but acceptable at glance:
11+
- simplify the logic of notifications - only show when successful
12+
- introduce a new popup "Custom sorting was not applied automatically, apply now?"
13+
- only when it was enabled, only when the File Explorer view is visible
14+
- allow to disable this popup in settings (or via a checkbox "don't show it again")
15+
- introduce a new popup "File Explorer view is not visible, cannot apply custom sort"
16+
- only when the user explicitly attempts to apply custom sort
17+
18+
Additional remarks:
19+
- [Brian Ray](https://github.com/bray) mentions a Lazy Plugin loader in #163
20+
- check it out and make sure it works correctly (gracefully, not necessarily auto-apply custom sort)
21+
- in some rare cases the custom sorting can be applied successfully on start
22+
- keep this scenario handled correctly
23+
- see #161 for the sequence of events (a) -> (b) -> (c) -> (d)
24+
25+
## References:
26+
27+
#163: Obsidian 1.7.2 - automatic sorting fails when launching Obsidian
28+
[#163](https://github.com/SebastianMC/obsidian-custom-sort/issues/163)
29+
30+
#162: Obsidian 1.7.2 breaking changes - when File Explorer is not displayed an attempt to apply custom sort fails with error
31+
[#162](https://github.com/SebastianMC/obsidian-custom-sort/issues/162)
32+
33+
#161: Find out how to automatically apply custom sort on app start / vault (re)load etc.
34+
[#161](https://github.com/SebastianMC/obsidian-custom-sort/issues/161)

src/main.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ export default class CustomSortPlugin
9393
sortSpecCache?: SortSpecsCollection | null
9494
initialAutoOrManualSortingTriggered: boolean
9595

96+
// Indicator of correct hooking up the plugin-integration-point:
97+
// - on initialization, OR
98+
// - after explicit user actions like enabling the custom sort
9699
fileExplorerFolderPatched: boolean
97100

98101
showNotice(message: string, timeout?: number) {

0 commit comments

Comments
 (0)