oficina / calendar Public

Native: Calendar updates quietly, as Calls ("install": "automatic", NativeUpdater(policy: .quiet))

Human

Prompt

Coordinator: One change before publishing: make Calendar update quietly like Calls (add "install": "automatic" to native/mac-updates.json; check rastrillo tools/mac_updates.py INSTALL_MODES for the exact effect and that no Swift change is needed). Keep "localizations": ["en"] (your call is right). Commit via the amadan workflow, make ci, push, wait for hub CI green, then rebuild + re-notarise release 0.1.1 build 3 (never uploaded, so safe), verify launch and that Sparkle no longer asks about automatic checks. Report the new tip and artifact path. Don't merge or publish — I'll land and publish.

From this commit's own message. The prompt ledger has no entries for it — which is what a squashed, rebased or amended commit looks like, and what every commit looks like in a repo without a ledger.

Summary

mac-updates.json gains "install": "automatic". Packaging now writes SUAllowsAutomaticUpdates, SUEnableAutomaticChecks and SUAutomaticallyUpdate (all true) and a daily SUScheduledCheckInterval, so Sparkle no longer asks its first-launch question about automatic checks. CalendarApp uses NativeUpdater(policy: .quiet): a scheduled check never opens a window, a downloaded update installs on quit, and the app menu offers "Update Ready — Restart Calendar". While an update is pending, the main window shows NativeUpdateNotice at the bottom, as Calls does.
Agent notes
One Swift change was needed. mac_updates.py says to pair "automatic" with NativeUpdater(policy: .quiet), and NativeUpdatePolicy says quiet needs both halves. With the JSON alone the standard driver still opens Sparkle windows when a scheduled check finds an update it cannot install silently. Without the notice, a quiet .available update (automatic downloads off, or one that needs the person) would show only under Check for Updates. Not done: an "Update automatically" toggle in Settings like Calls has; the app menu keeps Automatically Check for Updates. localizations stays ["en"].
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev f4c9c017cbeffd628902b9fa5a7f07d3c080d752 parent ec73734
3 files changed, +18 −1
  • native/README.md +6 −0
  • native/apple/Sources/CalendarApp/CalendarApp.swift +11 −1
  • native/mac-updates.json +1 −0

CI passed — run details

CI log
=== vet ===
go vet ./...
go vet -tags browser ./internal/calendartest/
=== fmt ===
=== test ===
go test ./...
?   	amadan.net/oficina/calendar/cmd/calendar	[no test files]
?   	amadan.net/oficina/calendar/cmd/calendar-contract	[no test files]
ok  	amadan.net/oficina/calendar/internal/calendar	24.744s
?   	amadan.net/oficina/calendar/internal/calendar/icons	[no test files]
?   	amadan.net/oficina/calendar/internal/calendar/keymailtest	[no test files]
?   	amadan.net/oficina/calendar/internal/calendar/seal	[no test files]
?   	amadan.net/oficina/calendar/internal/calendar/teamstate	[no test files]
ok  	amadan.net/oficina/calendar/internal/calendartest	3.874s
ok  	amadan.net/oficina/calendar/internal/guardstest	0.081s
?   	amadan.net/oficina/calendar/scripts/writeestilo	[no test files]
=== migration-check ===
go tool rastrillo migration check
rastrillo migration check: models and migrations agree
diff --git a/native/README.md b/native/README.md
index dba02e9..da58c7a 100644
--- a/native/README.md
+++ b/native/README.md
@@ -25,6 +25,12 @@ About, Hide, Quit and Help say "Calendar", and the Settings window is titled
declares `"localizations": ["en"]`; add a language there (and in both
`project.yml` files) only when Calendar ships its strings in it.
+The Sparkle build updates quietly, as Calls does: `"install": "automatic"` in
+`mac-updates.json` writes Sparkle's automatic check, download and install keys
+(no first-launch question), and `NativeUpdater(policy: .quiet)` keeps scheduled
+checks from opening a window. A downloaded update installs on quit; the app menu
+offers "Update Ready — Restart Calendar" and the window shows a one-line notice.
+
Browser sign-in requires the new backend `/native/` routes. A server that has
not received this update reports that native support is unavailable.
diff --git a/native/apple/Sources/CalendarApp/CalendarApp.swift b/native/apple/Sources/CalendarApp/CalendarApp.swift
index a986f63..f58a2d5 100644
--- a/native/apple/Sources/CalendarApp/CalendarApp.swift
+++ b/native/apple/Sources/CalendarApp/CalendarApp.swift
@@ -10,7 +10,10 @@ import AppKit
@main struct CalendarApp: App {
#if os(macOS) && canImport(RastrilloMacUpdates)
- @State private var updater = NativeUpdater()
+ // Quiet, as Calls: a scheduled check never opens a window; an update
+ // downloads in the background and installs on quit. Needs "install":
+ // "automatic" in mac-updates.json too (rastrillo/native docs/mac-updates.md).
+ @State private var updater = NativeUpdater(policy: .quiet)
#endif
@StateObject private var connection = NativeConnection(defaultServer: "https://calendar.oficina.works")
@AppStorage("calendar.showMenuBar") private var showMenuBar = true
@@ -27,6 +30,13 @@ import AppKit
#if os(macOS)
.frame(minWidth: 780, minHeight: 650)
#endif
+ #if os(macOS) && canImport(RastrilloMacUpdates)
+ // The quiet updater's one line, only while an update is pending: where
+ // an update that needs the person (automatic downloads off) shows up.
+ .safeAreaInset(edge: .bottom) {
+ if updater.canInstallPendingUpdate { NativeUpdateNotice(updater: updater).padding(.bottom, 12) }
+ }
+ #endif
}
#if os(macOS)
.defaultSize(width: 1080, height: 800)
diff --git a/native/mac-updates.json b/native/mac-updates.json
index 84ea330..b718b95 100644
--- a/native/mac-updates.json
+++ b/native/mac-updates.json
@@ -1,5 +1,6 @@
{
"bundle_id": "works.oficina.calendar",
+ "install": "automatic",
"url_schemes": [
"works.oficina.calendar"
],