oficina / docs Public

Clone
git clone https://amadan.net/oficina/docs

Plain git — no account needed to clone.

Download

Download this file

1# Document window smoke test
2
3Run `python3 native/scripts/test-document-window.py` from a logged-in macOS
4session. It opens a temporary app window and needs permission to become active.
5No account, production service, or user document is used: a loopback HTTP server
6serves the repository's synthetic letter seed.
7
8The test exercises the public DocsWorkspace in a SwiftUI document scene. It waits
9for the editor to load, opens/closes the inspector eight times through the native
10menu, checks the editor gains/loses panel space, resizes the window, and verifies
11that the same text view retains its content and selection.
12
13Regression: Docs 0.1.1 (3) could crash opening its first document on macOS 27.
14Restoring the `.inspector` container reproduces SIGTRAP with AppKit's “more Update
15Constraints in Window passes than there are views” exception. The docked settings
16panel avoids that container. The negative and fixed scene runs were verified on
17macOS 27 build 26A5388g; the user report was build 26A428.
18
19The typing regression now sends native key events and checks the actual
20NSTextInsertionIndicator against glyph geometry and document bounds, including
21repeated Enter presses. To exercise multiple pages (the short seeds do not):
22
23```sh
24cargo run --manifest-path native/crdt/Cargo.toml --example caret_fixture -- /tmp/docs-caret.bin
25DOCS_SMOKE_UPDATE=/tmp/docs-caret.bin python3 native/scripts/test-document-window.py
26```
27
28The generated fixture has 60 independent paragraphs. Optional
29`DOCS_SMOKE_SCREENSHOT=/tmp/docs-caret.png` captures the window after typing.
30The same executable imports the real window command source through symlinks and
31verifies Accounts/Sign out are in the app menu and Accounts reopens closed Home.
32
33To exercise immediate untitled creation, use `DOCS_SMOKE_DRAFT=1 python3 native/scripts/test-document-window.py`.
34The server deliberately waits two seconds. The test types before acknowledgement,
35asserts the same text view and content survive attachment, and saves an actively
36edited header title without pressing Return. Both modes then test Enter/caret
37geometry, inspector resizing, and native account menus.
38
39`python3 native/scripts/test-document-drafts.py` covers lost creation replies,
40retry identity, pending edits and deletes across different document GUIDs,
41rename during reconnect, oversized title retention, close-save, and discard.
42