| 1 | # Mac document windows — 2026-09-20 |
| 2 | |
| 3 | Paul requests a separate Home launcher and document windows for Docs and Sheets. |
| 4 | This extends the native Apple specs; editors remain native and server-backed. |
| 5 | |
| 6 | Home is a singleton with a Recent sidebar and searchable thumbnail grid. Templates |
| 7 | are deferred until template creation exists. Each open document has an independent |
| 8 | model, live stream, selection and save queue. Window identity includes the account |
| 9 | and document; opening an existing document focuses it. Document/session state remains in memory; credentials retain the existing |
| 10 | Keychain handling and are never encoded in scene restoration values. Missing restored sessions return |
| 11 | the user to Home. File > Recent and Window > Home remain available with no editor. |
| 12 | Recent entries are held in memory for this iteration, scoped to the account session. |
| 13 | |
| 14 | Mac document windows have no app navigation sidebar. Existing editing and file |
| 15 | actions move into menu-bar commands targeted at the focused scene. Standard native |
| 16 | text responder actions remain available in text fields. Docs adds a document-only |
| 17 | inspector and zoom starting at 100%; zoom changes display scale, never text wrapping. |
| 18 | No server page-settings API exists: inspector exposes existing personal layout |
| 19 | settings and document information, without pretending to persist new paper settings. |
| 20 | |
| 21 | Sheets edits in the selected cell, preserving drafts on failed save and respecting |
| 22 | existing write serialization. Header buttons select whole rows/columns. Double-click |
| 23 | on column boundaries autosizes using displayed text/font measurements and existing |
| 24 | size endpoint; menu alternative provided. Remove only the grid's outer focus effect, |
| 25 | retain cell selection and keyboard focus. Enter/Tab commit; Escape discards. |
| 26 | |
| 27 | Docs rendering investigation compares web CSS/font and page geometry against TextKit. |
| 28 | Use identical bundled fonts, logical width, sizes, paragraph spacing and line height. |
| 29 | Native optimistic edits must not be overwritten by stale projection generations or |
| 30 | IME composition. Avoid unnecessary complete attributed storage replacement and |
| 31 | selection resets; preserve model render acknowledgement. Exact cross-engine layout |
| 32 | parity requires measured fixture verification, not a compilation claim. |
| 33 | |
| 34 | Validate Mac builds, existing native tests and focused regression cases; exercise |
| 35 | window/menu targeting and editing where UI automation is available. Build iOS to |
| 36 | check shared code. No merge, deployment or app publication is part of this change. |
| 37 | |
| 38 | Review: GPT-6 Astra (high), 2026-09-20. Required invariants incorporated: |
| 39 | window keys combine canonical origin, account identity and document identity; |
| 40 | clients are immutable per window. Sign out is unavailable until that account's |
| 41 | windows close; switching the launcher account leaves those windows intact. |
| 42 | Close/quit guards cover in-flight, queued, failed and composing edits. Window |
| 43 | registry lifecycle ends only after the actual guarded close. Edit commands obey |
| 44 | the first responder, not merely the focused scene. Render reconciliation compares |
| 45 | actual optimistic text storage, updates CRDT metadata and acknowledges visually |
| 46 | equal generations. Zoom keeps logical layout independent of magnified viewport. |
| 47 | |
| 48 | ## Verification and remaining coverage |
| 49 | |
| 50 | Implementation reviewed by GPT-6 Astra (high), including a final account-isolation |
| 51 | and localization review. Both native Mac test suites and iOS simulator builds pass. |
| 52 | A synthetic AppKit interaction fixture exercises Sheets typing successive characters, |
| 53 | failed-save draft retention, Escape, and whole-row/column selection. A live SwiftUI |
| 54 | scene probe verified File actions and Window > Home after closing Home. |
| 55 | |
| 56 | Docs regression tests cover minimal text-storage reconciliation, metadata-only |
| 57 | updates and fixed logical page width. Deliberately restoring full storage replacement |
| 58 | and viewport-dependent width made the corresponding tests fail. A synthetic WebKit |
| 59 | fixture matches native heading, bold and body line breaks and body line spacing. |
| 60 | |
| 61 | The follow-up comparison suite loads the production web CSS, bundled fonts and |
| 62 | pages.mjs pagination functions directly into WebKit. It covers nested lists and |
| 63 | quotes, heading margins, serif/monospace fonts, inline code including a code span |
| 64 | starting on a wrapped line, mixed 72pt text, whole-block pagination and an oversized |
| 65 | first paragraph. Native Mac pagination now uses the same 648pt top-level-block |
| 66 | budget, an 18pt separator and collapsed surrounding margins. It does not insert |
| 67 | characters or change CRDT data. Font struts and per-run half-leading determine |
| 68 | line height; nested margins are collapsed before TextKit layout. |
| 69 | |
| 70 | Storage edits invalidate separator offsets immediately, including optimistic edits |
| 71 | and marked-text composition. A regression test inserts, composes and deletes before |
| 72 | an existing separator. Unchanged view layouts reuse the measured pagination plan. |
| 73 | Deliberately removing code-start padding and storage invalidation made their tests |
| 74 | fail for the intended reasons; the restored implementations pass. |
| 75 | |
| 76 | Follow-up review: GPT-6 Astra (high), 2026-09-20; no remaining blocker in the bounded |
| 77 | source review. Docs validation: 39 XCTest cases plus 15 Swift Testing cases pass, |
| 78 | as does the iOS simulator build. The web comparison allows one CSS pixel for |
| 79 | per-line metric rounding and 1.5pt accumulated position error across a long fixture. |
| 80 | These are measured layout results, not a claim of pixel-identical rasterization or |
| 81 | proof for every possible document. iOS retains its existing responsive paginator; |
| 82 | the document-window pagination change targets Mac as requested. |
| 83 | |
| 84 | Builds are local ad-hoc Mac applications, not signed distribution or TestFlight |
| 85 | releases. No server deployment, merge or publication was performed. |
| 86 | |