Skip to content

fix: resolve CGFloat/Double operator ambiguity in WorkTimeCanvas - #212

Merged
mikehasa merged 1 commit into
mainfrom
fix/swift-build-cgfloat
Sep 14, 2026
Merged

mikehasa merged 1 commit into
mainfrom
fix/swift-build-cgfloat

Conversation

@mikehasa

Copy link
Copy Markdown
Owner

Problem

WorkTimeCanvas.swift (new in #190) mixes CGFloat (the GraphicsContext size inside a Canvas closure) with Double in one CGRect expression. The Xcode 26.3 toolchain rejects this as ambiguous use of operator '-', even though the CI runner's newer Xcode 26.6 accepts it.

CI's macos-app job builds and tests Swift under Xcode 26.6, so it stayed green — but the release DMG is cut on a macOS 15.7 / Xcode 26.3 machine, where swift build -c release (the exact command build-app.sh runs) fails. Result: main's app currently cannot be built into a signed DMG on the release toolchain, which blocks any rebuild release.

Fix

Bind the canvas width to Double once and convert size.height explicitly, matching the Double-based geometry already used elsewhere in the same file (e.g. let width = Double(geometry.size.width)). Numerically identical — CGFloat is Double-backed on arm64.

Verification

  • swift build -c release — compiles clean on Xcode 26.3 (was failing before this change).
  • swift test — 496 executed, 0 failures, 6 skipped.
  • pytest -q — 2881 passed (unaffected; included for completeness).

Follow-up

CI cannot currently catch this class of break because its Swift job runs on a newer Xcode than the release machine can. A separate PR will add a swift build -c release leg under the oldest installed Xcode 26.x so "compiles only on the newest toolchain" regressions fail at PR time.

The activity-timeline density canvas mixed CGFloat (the GraphicsContext
size) with Double in one expression, which the Xcode 26.3 toolchain rejects
as an ambiguous use of operator '-' even though newer toolchains accept it.
This broke `swift build -c release` — the exact command build-app.sh runs to
produce the DMG — on the release toolchain, so no signed build could be cut.

Bind the canvas width to Double once and convert size.height explicitly,
matching the Double-based geometry already used elsewhere in the file.
Numerically identical (CGFloat is Double-backed on arm64).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant