oficina / sheets Public

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

Plain git — no account needed to clone.

Download

Download this file

1# Oficina Sheets for Mac, iPhone and iPad
2
3Entirely native SwiftUI editors use the same authenticated Go calculation,
4formatting, sealed storage and permission paths as the web application.
5No embedded browser editor or second formula engine is used.
6
7Build with Xcode 26.6, Swift 6.2+, and XcodeGen:
8
9```sh
10native/scripts/build-mac.sh
11native/scripts/build-iphone.sh simulator
12```
13
14The macOS bundle is `native/build/Oficina Sheets.app`. Simulator products
15are under `native/build/ios`. Device builds use `build-iphone.sh device`
16and require `OFICINA_DEVELOPMENT_TEAM` and the team's normal signing setup.
17Simulator and device builds use separate DerivedData directories.
18`OFICINA_SKIP_PROJECT_GENERATION=1` allows the suite runner to generate the
19project once before starting parallel builds.
20
21The shared native transport and Mac packaging tools are pinned to revision
22`1e36aac95ed252848722926efc8ba8f9dc803216` of
23`https://amadan.net/rastrillo/native`, on its main branch (the merge of `native/oficina-id-straight-in`: Oficina ID
24straight in, Paul's ruling of 2026-11-19). The pin is written in
25`apple/Package.swift`, `apple/Package.resolved`, `macos/project.yml`,
26`macos/SheetsMacStore.xcodeproj/project.pbxproj`, `ios/project.yml` and here.
27Both SwiftPM and Xcode resolve that revision; no sibling development checkout
28is required.
29
30Sign-in is Oficina ID first (Home `docs/superpowers/specs/2026-11-14-oficina-id-native.md`,
31slice A, with Paul's straight-in ruling of 2026-11-19), through rastrillo/native's
32`RastrilloApple/OficinaID` kit: one Oficina ID on the device opens its team with no
33screen; several ask which; "Use another Oficina ID" is in the account menu. "Other ways
34to sign in…" keeps the server address and browser approval for self-hosted servers and
35local accounts; someone already signed in that way keeps those accounts, and nothing goes
36straight in while that is the route. The server half is `POST /native/oficina-id`
37(`internal/sheets/home_routes.go`).
38
39The kit needs these grants on every build: `macos/DeveloperID.entitlements` (Sparkle,
40named by `mac-updates.json`), `macos/AppStore.entitlements`, and `ios/SheetsPhone.entitlements`.
41Each has `keychain-access-groups` = `9U4A84C4WK.works.oficina.sheets` **first**, then
42`9U4A84C4WK.works.oficina.id`, the App Group (`9U4A84C4WK.works.oficina` on Mac,
43`group.works.oficina` on iOS) and `webcredentials:id.oficina.works`. A Developer ID build
44claiming them without its embedded profile is killed at launch; `mac-updates.json` names
45the profile by local path (never committed). A signed build, then the launch gate (spec
46§13), which must pass on the final notarised artifact before any Sparkle publish:
47
48```sh
49native/scripts/build-mac.sh --updates-config mac-updates.json \
50 --sign-identity 'Developer ID Application: Team Tito Limited (9U4A84C4WK)'
51"native/build/Oficina Sheets.app/Contents/MacOS/SheetsMac" --oficina-id-launch-check
52```
53
54An ad hoc or simulator build drops the grants; Oficina ID then cannot read the keychain.
55`SignedInLaunchTests` hosts the home window with an Oficina ID already saved and checks it
56settles (Docs 0.1.7/0.1.8 hung at launch only for people signed in).
57
58The Sparkle build updates quietly, as Calls does: `"install": "automatic"` in
59`mac-updates.json` writes Sparkle's automatic check, download and install keys
60(no first-launch question), and `NativeUpdater(policy: .quiet)` keeps scheduled
61checks from opening a window. A downloaded update installs on quit; the app menu
62offers "Update Ready — Restart Sheets" and the Home window shows a one-line notice.
63
64Select a cell, then edit its formula bar, double-click, press Return or F2
65(these keep the cell's contents), or just type (this replaces them, as in
66Numbers or Excel). The keystroke that starts typing goes to the cell's own
67text field, so a dead key (´ then e) or an input method composes from the
68first key. On iPad and iPhone a hardware keyboard works the same way: while
69a cell is selected an invisible text field sits on it holding the keyboard
70(without raising the on-screen one), so arrows, Return, Tab and Delete move
71and clear, and the first typed or composed text starts the edit in place.
72Touch editing stays in the formula bar (double-tap a cell). Enter saves and moves down; Tab saves and moves right; Escape
73discards the focused cell edit. The range field accepts
74addresses such as `A1:C10`. Menus provide copy/paste, clear, fill, formatting,
75size controls, functions, history, comments, sharing and workbook transfer.
76Sort/filter opens a native table preserving each cell's original reference.
77
78Network content uses ephemeral transport. Requested exports stream to a private
79temporary workbook and are handed to the system file-save picker; the temporary
80file is removed on completion, cancellation or failure. Value edits are
81optimistic: a committed cell shows its value at once and the send happens in
82the background, one at a time per document, with edits made meanwhile sent
83together next. A refused or unanswered edit keeps its value on screen with a
84small red corner mark and offers Retry and Revert (on the cell's context menu
85and above the grid); editing carries on around it. Window close and Quit wait
86for edits on their way and ask about failed ones. Edits live in memory until
87the server has them: they do not survive a crash or quit while offline. The app does not claim offline editing or sealed local document caches.
88
89Current web limits remain visible: a single worksheet, a 500-row/200-column
90grid window, 500-cell paste limit, first-worksheet XLSX/XLSM import up to
9120 MiB, and no undo for formatting or sizing. Formula evaluation and number
92display come from the Go server. Charts, conditional-format rule editing,
93structural row/column changes and additional worksheet editing do not exist
94in the web baseline and are not represented as finished features here.
95
96Verification:
97
98```sh
99swift test --package-path native/apple
100go test ./...
101```
102
103`SheetsReview` and `SheetsReviewPhone` are separate, unshipped review targets.
104Their fixture server uses temporary databases and ordinary authenticated
105sessions. Production entry points never contain fixture credentials.
106See the native design spec and review records for exercised coverage;
107compiling a target alone does not establish editing parity.
108