Sign In Sign Up

Refactor update view model functions

Let's move the pill background, foreground, and badge functions from @macos/Sources/Features/Update/UpdateAccessoryView.swift to @macos/Sources/Features/Update/UpdateViewModel.swift and make them more generic (background, foreground, badge)

Done! I've moved pillBackgroundColor and pillForegroundColor from UpdateAccessoryView.swift to UpdateViewModel.swift as backgroundColor and foregroundColor. The view now references model.backgroundColor and model.foregroundColor.

Do the badge as well.

Done! I've renamed the badge properties to be more generic:

  • badgeTexttext
  • badgeIconNameiconName
  • badgeIconColoriconColor
Do the badge icon View as well so that's reusable.

Done! I've extracted the badge icon view into a reusable BadgeIconView.swift component that can be used anywhere the badge icon is needed.

Please analyze this codebase and create an AGENTS.md file containing: 1. Build/lint/test commands - especially for running a single test 2. Architecture and codebase structure information, including important subprojects, internal APIs, databases, etc. 3. Code style guidelines, including imports, conventions, formatting, types, naming conventions, error handling, etc. The file you create will be given to agentic coding tools (such as yourself) that operate in this repository. Make it about 20 lines long. If there are Cursor rules (in .cursor/rules/ or .cursorrules), Claude rules (CLAUDE.md), Windsurf rules (.windsurfrules), Cline rules (.clinerules), Goose rules (.goosehints), or Copilot rules (in .github/copilot-instructions.md), make sure to include them. Also, first check if there is an existing AGENTS.md or AGENT.md file, and if so, update it instead of overwriting it.