Skip to content

Align menu bar usage metrics with weekly priority#81

Merged
kargnas merged 6 commits intomainfrom
improve-menu-bar
Feb 16, 2026
Merged

Align menu bar usage metrics with weekly priority#81
kargnas merged 6 commits intomainfrom
improve-menu-bar

Conversation

@kargnas
Copy link
Member

@kargnas kargnas commented Feb 16, 2026

Screenshot 2026-02-16 at 22 51 36

Summary

  • document the weekly-first priority for usage percentages in the design decisions file
  • ensure the status bar menu, provider models, enums, and icon view respect the weekly/monthly/daily fallback order while showing all windows in-app
  • clarify the differences between .openCode and .openCodeZen through updated docs

Testing

  • Not run (not requested)

@op-gg-ai-devops
Copy link
Contributor

맥 메뉴 막대 아이콘에 표시될 사용량 메트릭의 우선순위(주간 > 월간...)를 재정립하고, 아이콘 전용/고정/알림 우선 모드 등 다양한 디스플레이 옵션과 중요 알림 배지(Red Dot) 기능을 추가했습니다.


Code Review (Preview)

  1. Defensive UI Updates: menuWillOpen/menuDidClose 델리게이트를 활용해 메뉴가 열려있는 동안 상태 바 업데이트를 지연시키는(flushDeferredUIUpdatesIfNeeded) 처리는 AppKit 런루프 충돌 방지를 위한 매우 훌륭한 방어적 패턴입니다.
  2. Maintenance Consideration: usagePercentCandidates 메서드의 거대한 switch 문은 새로운 프로바이더 추가 시마다 수정이 필요해 유지보수 비용이 높습니다. 추후 각 프로바이더 모델이 직접 자신의 우선순위/후보군을 반환하도록 ProviderProtocol을 확장하여 책임을 분산시키는 리팩토링을 권장합니다.
  3. Drawing Logic: StatusBarIconView에서 drawCriticalBadgeIfNeeded로 직접 배지를 그리는 방식은 가볍고 효율적입니다. 다만 overrideText, iconOnlyMode 등 상태 변수가 많아졌으므로, 뷰의 상태를 명확한 Enum 하나로 관리하면 코드가 더 깔끔해질 것 같습니다.
  4. Change Detection: refreshRecentChangeCandidate에서 변화 감지 임계값이 일괄적으로 0.01로 설정되어 있습니다. Cost($)와 Usage(%)가 혼재된 상황에서 너무 민감하게 반응하여 "Recent Change" 모드가 과도하게 깜빡이지 않을지 사용성 확인이 필요합니다.

이것은 짧은 미리보기입니다. 버그 탐지와 보안 점검을 포함한 전체 코드 리뷰를 원하시면 @opgginc/op-gg-ai-devops 리뷰해줘라고 댓글을 달거나 @opgginc/op-gg-ai-devops 팀을 리뷰어로 등록해주세요(커밋 푸시 시 자동 리뷰).
(리뷰 언어 설정은 AGENTS.md에서 변경할 수 있습니다. 예: Default review language: English)

@kargnas
Copy link
Member Author

kargnas commented Feb 16, 2026

@opgginc/op-gg-ai-devops

@op-gg-ai-devops
Copy link
Contributor

op-gg-ai-devops bot commented Feb 16, 2026

✅ AI Code Review Completed

상태 작업 결과
리뷰 컨텍스트 초기화 (AGENTS.md, /tmp/references, 기존 리뷰, CI 상태 확인) 야, 문서들 다 읽어봤어. 대충 상황 파악 끝남.
Diff 및 관련 파일 검사; 이슈, 테스트, 문서 업데이트 확인 니가 고친 코드 다 뜯어봤다. 뭐가 문젠지 다 보임.
셋업 실행, 의존성 설치 및 스모크 테스트 수행 시키는 대로 빌드랑 테스트 돌려봤는데 잘 돌아가네.
GitHub 리뷰 페이로드 준비 및 게시; 상태 댓글 업데이트 리뷰 올렸고 상태도 갱신했음.

리뷰 올렸고 핵심 이슈 3건 남겼다. CI는 전부 통과했고, 인라인 제안 확인하면 됨.
Reviewed with openai/gpt-5.2-codex


📋 View Full Logs

Copy link
Contributor

@op-gg-ai-devops op-gg-ai-devops bot left a comment

Choose a reason for hiding this comment

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

🤖 OP.GG DevOps AI Code Review

요약

  • Recent Quota Change Only 표기가 used 없이 퍼센트만 보여서 규칙(used/left 명시) 위반이라 모호함.
  • Total Cost가 0일 때 $0.00 표시로 바뀌어 디자인 결정(0이면 OC Bar)과 불일치.
  • 새 Status Bar Options 메뉴(표시 모드/배지/이름 표시) 설명이 README에 누락됨.

테스트

  • npm install
  • npm run lint:actions

CI/CD Status

  • ✅ CI/Lint/Test/Build/CodeQL 모두 성공

누군가 이 PR 브랜치에 커밋을 다시 push하면, 이 봇이 전체 PR을 자동으로 다시 리뷰함.
PR 코멘트에 @opgginc/op-gg-ai-devops 멘션해도 다시 리뷰함. 예시:

  1. @opgginc/op-gg-ai-devops Status Bar Options 문서 추가 누락 체크해줘
  2. @opgginc/op-gg-ai-devops Recent Quota Change Only 표시 규칙 재검토해줘
  3. @opgginc/op-gg-ai-devops 0일 때 OC Bar 표기 동작 확인해줘

@kargnas
Copy link
Member Author

kargnas commented Feb 16, 2026

@opgginc/op-gg-ai-devops PR updated: please review when convenient. Commit: e4546e6

@op-gg-ai-devops
Copy link
Contributor

op-gg-ai-devops bot commented Feb 16, 2026

✅ AI Code Review Completed

Review finished and inline comments are posted. CI/Test/Build are still running for this commit, so re-check once they complete. Local tests were not run because the Xcode toolchain is unavailable in this environment.

Status Task Result
Collect context: read AGENTS, existing reviews, diff range Context gathered and diff reviewed.
Inspect dependencies, install if applicable, run smoke tests Dependencies not installed; SwiftPM/Xcode resolution unavailable here.
Analyze changes for bugs/perf/security/docs, draft inline comments Issues identified and inline suggestions prepared.
Post review via gh api and update status comment Review posted and status updated.

Reviewed with openai/gpt-5.2-codex


📋 View Full Logs

Copy link
Contributor

@op-gg-ai-devops op-gg-ai-devops bot left a comment

Choose a reason for hiding this comment

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

🤖 OP.GG DevOps AI Code Review

Summary

  • Pinned provider display can drift when the pinned provider is disabled, leading to UI mismatch between menu selection and status bar text.
  • Critical badge logic ignores over-100% usage, so a provider over quota may not show the badge.

CI/CD Status

  • ⏳ CI/Test/Build are still running for this commit.

Tests

  • Not run (Xcode toolchain not available in this environment).
  • Dependencies not installed; SwiftPM/Xcode resolution not available here, so results may be incomplete.

Review Language

If you want a default review language, add it to AGENTS.md. Example: Default review language: English.

…ail Percents

Introduce consistent naming conventions:
- Status Bar Percent: single representative percentage in macOS top status bar
- Dropdown Detail Percents: multi-window percentages in dropdown menu

Update both AGENTS-design-decisions.md and README.md to use new terminology.

Co-authored-by: opencode <no-reply@opencode.ai>
@kargnas
Copy link
Member Author

kargnas commented Feb 16, 2026

@opgginc/op-gg-ai-devops Please review this PR.

@op-gg-ai-devops
Copy link
Contributor

op-gg-ai-devops bot commented Feb 16, 2026

✅ AI Code Review Completed

Review posted with one inline suggestion about status-bar priority across accounts. CI/Test/Build are still running; local tests were not run due to missing Xcode. Dependency installation was skipped because no lockfiles were found.

Status Task Result
Initialize review context (language, instructions, references) Completed.
Collect PR data (diff, files, CI status, prior reviews) Completed.
Run setup/install and smoke checks per repo guidance Setup done; no lockfiles found for install.
Analyze changes and craft inline suggestions Completed.
Post review and update status comment Completed.

Reviewed with openai/gpt-5.2-codex


📋 View Full Logs

Copy link
Contributor

@op-gg-ai-devops op-gg-ai-devops bot left a comment

Choose a reason for hiding this comment

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

🤖 OP.GG DevOps AI Code Review

Summary

  • Status-bar percent priority is currently applied per account, which can surface a lower-priority window (hourly) even when a higher-priority window (weekly) exists on another account. This breaks the fixed priority rule for the status bar.

CI/CD Status

  • ⏳ CI/Test/Build are still running for this commit.

Tests

  • Not run (Xcode toolchain not available in this environment).
  • Dependencies: no lockfiles detected, install skipped.

Review Language

If you want a default review language, add it to AGENTS.md. Example: Default review language: English.

…r critical badge

- selectedPinnedProvider() now returns nil when pinned provider is disabled
  instead of silently falling back to first enabled provider, preventing
  UI mismatch between menu selection and status bar display
- usagePercentsForMostUsed() now clamps values to 100% instead of filtering
  them out, so over-quota providers still trigger critical badge detection

Co-authored-by: opencode <no-reply@opencode.ai>
@kargnas
Copy link
Member Author

kargnas commented Feb 16, 2026

@opgginc/op-gg-ai-devops Fixed both unresolved threads. Please re-review.

@op-gg-ai-devops
Copy link
Contributor

op-gg-ai-devops bot commented Feb 16, 2026

✅ AI Code Review Completed

Review posted with one priority issue about status bar percent priority across accounts; see the inline suggestion. CI is still running, and SwiftPM resolution could not run here because xcodebuild is unavailable.

Reviewed with openai/gpt-5.2-codex


📋 View Full Logs

Copy link
Contributor

@op-gg-ai-devops op-gg-ai-devops bot left a comment

Choose a reason for hiding this comment

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

🤖 OP.GG DevOps AI Code Review

Summary

  • Status Bar Percent priority is still applied per-account, so a lower-priority window can win when another account has higher %; this breaks the fixed priority rule.

CI/CD Status

  • ⏳ CI/Test/Build are still running for this commit.

Tests

  • npm install --no-package-lock
  • npm run lint:actions
  • SwiftPM dependency resolution not run (xcodebuild not available in this environment).

Review Language

If you want a default review language, add it to AGENTS.md. Example: Default review language: English.

Per IMMUTABLE design rule, the status bar priority (Weekly → Monthly →
Daily → Hourly → fallback) must be applied globally across all accounts,
not per-account then maxed. Added preferredUsedPercentForStatusBar() that
collects all candidates from all accounts first, then picks the highest
priority window globally. Removed dead usedPercentsForStatusBar().

Co-authored-by: opencode <no-reply@opencode.ai>
@kargnas
Copy link
Member Author

kargnas commented Feb 16, 2026

✅ Fixed. Added preferredUsedPercentForStatusBar(identifier:result:) that aggregates all UsagePercentCandidates from main result + sub-accounts + Gemini special case into a single pool, then applies the global priority rule (lowest rawValue = highest priority → max percent within that priority). This prevents an hourly-only account from beating a weekly account across accounts. Removed dead usedPercentsForStatusBar() since both callers now use the new function.

@kargnas
Copy link
Member Author

kargnas commented Feb 16, 2026

✅ Fixed in the same commit as the above thread. The root cause was identical — per-account priority selection then cross-account max(). Now both formatProviderForStatusBar and usagePercentsForMostUsed use the new global aggregation function.

@kargnas
Copy link
Member Author

kargnas commented Feb 16, 2026

@opgginc/op-gg-ai-devops Please re-review. Fixed cross-account priority aggregation — now applies global priority rule across all accounts before selecting max percent.

@op-gg-ai-devops
Copy link
Contributor

op-gg-ai-devops bot commented Feb 16, 2026

✅ AI Code Review Completed

Review finished. Check the PR for inline comments.


📋 View Logs | 🤖 Model: google/gemini-3-pro-preview

- StatusBarController.swift 내 모든 퍼센트 출력에서 'used' 문자열 제거
- AGENTS-design-decisions.md에 공간이 협소할 경우 퍼센트 단독 표시 허용 규칙 추가
- 상태 표시줄 텍스트를 더 짧고 간결하게 유지하도록 가이드라인 업데이트
- 쿼타 기반 및 알림 텍스트 포맷을 '숫자%' 형식으로 통일
@kargnas kargnas merged commit 7738b92 into main Feb 16, 2026
13 checks passed
@kargnas kargnas deleted the improve-menu-bar branch February 16, 2026 15:26
@kargnas kargnas linked an issue Feb 16, 2026 that may be closed by this pull request
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.

Feature Request: Let me configure menubar text

1 participant