Skip to content

feat: Add macOS widget support - #859

Draft
validatedev wants to merge 6 commits into
mainfrom
feat/macos-widget-support
Draft

feat: Add macOS widget support#859
validatedev wants to merge 6 commits into
mainfrom
feat/macos-widget-support

Conversation

@validatedev

Copy link
Copy Markdown
Collaborator

TL;DR

Adds native macOS WidgetKit support for OpenUsage. Each widget instance can show one configured provider in small, medium, or large sizes, backed by display-only snapshots exported by the host app.

What was happening

  • OpenUsage usage data was only available from the menu-bar popover.
  • The SwiftPM host had no WidgetKit extension, shared data bridge, or widget deep-link routing.
  • Local and release build scripts did not embed or sign an app extension.

What this changes

  • Adds a WidgetKit extension for Claude, Codex, Cursor, Antigravity, Copilot, Devin, Grok, OpenRouter, and Z.ai.
  • Supports small, medium, and large widgets with provider configuration, stale/error states, reset dates, and metric ordering inherited from OpenUsage.
  • Publishes privacy-safe, display-ready snapshots through a versioned App Group bridge; the extension never reads credentials or contacts provider APIs.
  • Opens the relevant dashboard provider from a widget, or routes disabled/empty providers to Customize.
  • Adds extension embedding, Team ID extraction, nested signing, universal release builds, and release validation to the existing scripts.
  • Documents widget behavior, refresh timing, debugging, architecture, and the provider-registration checklist.
  • Uses a 30-minute stale threshold to account for WidgetKit's background update budget.

Heads-up

  • A valid Apple Development identity and Apple WWDR certificate are required for local WidgetKit embedding. Without one, the normal development script still builds the host app and warns that widget support was omitted.
  • Screenshots are intentionally pending while this PR remains a draft; add them before marking it ready for review.

Tests

  • swift test: 900 XCTest cases passed, 3 skipped; 3 Swift Testing cases also passed.
  • xcodebuild -project OpenUsageWidgets.xcodeproj -scheme OpenUsageWidgets -configuration Debug CODE_SIGNING_ALLOWED=NO build: passed.
  • ./script/build_and_run.sh: built and launched a team-signed host with the signed widget extension embedded.
  • codesign --verify --deep --strict dist/OpenUsage.app: passed.
  • git diff --check: passed.

Screenshots

Pending before this draft is marked ready for review.

@validatedev validatedev changed the title [codex] Add macOS widget support feat: Add macOS widget support Jul 6, 2026
@validatedev
validatedev force-pushed the feat/macos-widget-support branch from 9230130 to 4e5444a Compare July 6, 2026 12:50
@robinebers robinebers added the gate-passed Passed the automated PR gatekeeper checks (gatekeeper skips it on later runs) label Jul 6, 2026 — with Cursor
@validatedev

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dc3e6ec440

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/OpenUsage/App/StatusItemController.swift Outdated
…port

# Conflicts:
#	Package.swift
#	README.md
#	Sources/OpenUsage/App/OpenUsageApp.swift
#	Sources/OpenUsage/Stores/LayoutStore.swift
#	Sources/OpenUsage/Views/DashboardView.swift
#	docs/architecture.md
#	script/build_and_run.sh
#	script/release.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs gate-passed Passed the automated PR gatekeeper checks (gatekeeper skips it on later runs) tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants