I'm happy that I made the switch to AppKit for the window management. Even though it's not as fun to work with, it's just so much more reliable than SwiftUI if you want to do something more complex.
View quoted note β
I tried using `UserDefaults` to save the IDs of open windows, so that when terminating the app and then re-launching, the app would open the same windows again.
But apparently, this is not as easy as I thought - at least not when using #SwiftUI.
I'm moving to an #AppKit approach instead to handle my window management... #dev
LLMs like Claude are cheap. Especially considering the value they bring me and many other developers.
But I do wonder how long the prices are going to stay like thatβ¦ π¬
By window management I mean supporting multiple independent windows to be open at the same time.
I want to enable a different Space to be open in each window, or the same Spaceβ¦
Currently, all windows are linked, so if you switch Space in one window, the same change will happen in all the others.
Itβs not intentional though, I think it must be some default behavior in AppKit. #dev
View quoted note β
Attempted to implement advanced window management for my notes app this afternoon, but gotta admit, Iβm just too tired to think clearly.
Iβve done a lot of work to get the functionality working to create and switch Spaces.
Made a little menu to view all Spaces and switch between them.
Seems to work really well.
Tomorrow will be about implementing window management. #dev
GN Nostr π€
I hope to get the `app_state.db` completely up and running today, but itβs going to require a bit of work.
I need to implement the following:
- Create and update Spaces
- Switch between current Space
- Pull recently opened Spaces in chronological order to make a list in UI
- Reopen the latest Space when launching app
Most of the tasks also require building the UI.
Maybe I can even start working on `cache.db` today as well, but itβs more important to get a really solid solution implemented for `app_state.db`.
I did the database queries yesterday using the Swift package called `GRDB`:
After having used a bunch of LLM models, this is my conclusion:
- Gemini 3 Thinking for brainstorming
- Claude Sonnet 4.5 for programming
View quoted note β
I think perhaps having two databases would be preferable:
- `app_state.db`: It stores data such as which Spaces are currently added to the app and where they are located on the disk. Will also include a table of recently opened Spaces - this will be used to show a list in the UI.
- `cache.db`: This database is disposable and is just used for mirroring. The app will scan the Space folder to rebuild the database.
The local files are always the source of truth, but having the `cache.db` database allows for very efficient indexing. #dev
View quoted note β