Skip to content

Adopt AppKit automatic @Observable tracking in draw/layout (back-deploys to macOS 15) #915

Description

@malpern

Post-1.0. Not for the 1.0 launch. From the WWDC 2026 review — see docs/wwdc-2026-macos-27-opportunities.md (PR #911), opportunity #4.

Why

WWDC26: AppKit now automatically tracks @Observable property reads in draw, layout, updateConstraints, updateLayer (and NSViewController equivalents) and invalidates automatically. Back-deployable to macOS 15 / iOS 18, on by default when building with the 2026 SDKs — one of the few announcements adoptable without a deployment-target bump.

KeyPath's hybrid architecture (MainWindowController, overlay windows + SwiftUI views over KanataViewModel) likely carries manual sync plumbing this makes obsolete.

Plan

  1. Audit the AppKit layer (Sources/KeyPathAppKit/UI/) for hand-rolled notification/KVO bridges between view models and AppKit views/windows.
  2. Replace with direct @Observable reads in draw/layout paths where the automatic tracking applies.
  3. Requires building with Xcode 27 (see the toolchain upgrade issue).

https://claude.ai/code/session_01Nsiqm39oCwHkbrHytefnGM

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions