oficina / sheets Public

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

Plain git — no account needed to clone.

Download

Download this file

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