I’ve found a better dependency management strategy, inspired by GRDB’s EnvironmentStateObject [github.com] but using Observation (aka iOS 17) in place of Combine. Now I can manage dependencies using ViewModifiers #prosedev
1235650
I’ve also rewritten drafts and accounts as Observable objects with dependencies instead of just plain value types. This means each draft can load from disk and manage its own mutable editing state and queue, saving to disk when appropriate.
1235654
Debouncing is very tricky with mutable state, even more complicated when using value types. In hindsight, that type of code was misplaced in View logic. Now it’s all hidden and automatic.
1235656
Hidden from who? That’s a very good question. #prosedev
1235657
Oh, drafts sorting is back and simpler. Works similar to how Files.app does sorting, a selection of values (with an up/down arrow next to the current selection). Re-selecting a value flips the order.
1235658