Integrate macOS documents with NSDocument?
What is the problem or limitation you are having?
I don't see the native NSDocument class being used in Toga Cocoa. This native class (https://developer.apple.com/documentation/appkit/nsdocument?language=objc) has iCloud support for reading and writing documents and also renaming etc. supports.
I understand that Toga does not differentiate a document app anymore however the following dialog is expected by mac users in apps dealing with documents, and we should try to implement that.
Describe the solution you'd like
When an application is a document app, somehow cooperate with the native NSDocument to manage the documents.
Describe alternatives you've considered
Status quo, however as far as I understand that will make Toga document apps not integrateable with iCloud.
Additional context
I'm sorry for the vagueness but as this has to do with apps and windows and stuff I am not in a position to propose a concrete solution.
In the not-too-distant past, Cocoa Documents did subclass NSDocument; however, we found that it wasn't necessary to achieve the feature set of Document-based apps.
If there's a specific new feature that we could add that requires NSDocument support on the backend, then we're open to suggestions, but it needs to be grounded in a specific feature that can potentially be implemented on other platforms. That doesn't mean we need to add iCloud support everywhere, but some broader notion of "Cloud integration" would need to exist.
@freakboy3742 If nothing else, it doesn't look like a native document app, as shown by my screenshot on the original post from Pages.
Renaming a file in place IIRC is something Microsoft Office supports. Microsoft has OneDrive although I'm not sure if these two features are like tightly coupled with concrete APIs like on macOS.
Hello!
I also have a few expectations of what the title bar should do (from left to right). I am still running Ventura, but I hope this all still applies:
- if a document was modified, the window close button should indicate that with a small black dot
- a file type icon should be displayed on the left of the filename
- cmd+click on the filename should popup a list with the directory structure where the file is located
- cmd+click on "untitled filename" should show a popup offering to save the file (cloud or no cloud)
- a small down arrow should be displayed on the right of the filename; click that should open the "save file popup"