Skip to content

feat(menubar): drop the Spirit Companions and put Grok in their place - #120

Merged
aqua5230 merged 2 commits into
mainfrom
feat/menubar-drop-critters-add-grok
Aug 30, 2026
Merged

feat(menubar): drop the Spirit Companions and put Grok in their place#120
aqua5230 merged 2 commits into
mainfrom
feat/menubar-drop-critters-add-grok

Conversation

@aqua5230

Copy link
Copy Markdown
Owner

起因

issue #117 要求「加一個設定可以隱藏神獸」,理由是它們佔選單列空間。專案擁有者評估後決定直接移除,不做開關——三隻動畫沒有百分比之外的資訊量,卻每次刷新都要付出寬度與重繪成本。空出來的位置給 Grok。

移除神獸

刪掉 menubar/critter_frames.py、共用的 NSTimer 與 animateCritters_ selector、critter_animation_tick()refresh.pyanimation_groups 資料流,以及 15 張動畫幀與整個 assets/critters/lion/

assets/critters/phoenix/wrapped.pngdragon/wrapped.png 保留——HTML 報表的「年度 Wrapped」卡片用它們,所以 setup_app.py"assets/critters" 也留著。

scripts/check_file_size.pymenubar/app.py 上限從 1242 降到 1135(實際 1127)。

加入 Grok

Grok 早就是第 4 張額度卡,Windows 系統匣提示文字也早就有它,只有 macOS 選單列沒有

新增 assets/grok_mono_menubar.png(48×48 template,與其他三家同規格)與 _grok_menubar_icon()_menubar_attributed_title() 與純文字後備 _compose_title() 都在 Antigravity 之後補上 Grok 段,條件是 not hide_grokgrok_weekly.percent is not None;分隔號沿用 Antigravity 的 title.length() > 0 寫法,避免 Grok 單獨顯示時冒出開頭的 ·

hide_grok 維持預設 True,既有使用者不會無預警多出一段。

驗證

離屏渲染 production 的 _menubar_attributed_title() 路徑:25% · 36% · 0.7% · 41%,四個標記都清楚,沒有神獸。

  • 1788 passed, 5 skipped(比改動前多 4 個新測試,唯一刪掉的既有測試是 test_set_button_title_updates_for_animation_frame
  • ruff / mypy / check_file_size.py / check_doc_parity.py 全綠
  • 五份 README 與 docs/DEVELOPMENT.md 的 Spirit Companions 段落一併移除

Closes #117

🤖 Generated with Claude Code

https://claude.ai/code/session_01S4jZ2RVf18AHTymTXueqM6

The three animated critters (phoenix, dragon, lion) cost menu bar width
on every refresh without carrying information the percentages don't
already give, so they are removed outright rather than made optional:
critter_frames.py, the shared NSTimer and its animateCritters_ selector,
critter_animation_tick(), the animation_groups plumbing in refresh.py,
and the 15 frame assets plus the whole lion folder. The Wrapped card in
the HTML report keeps phoenix/dragon wrapped.png, which is why
assets/critters stays in setup_app.py.

Grok takes the freed space. It was already the fourth quota card and
already in the Windows tray tooltip; only the macOS menu bar lacked it.
_grok_menubar_icon() loads a new template asset and both
_menubar_attributed_title() and the plain-text _compose_title() fallback
append it after Antigravity, gated on hide_grok — which still defaults
to True, so nothing changes until a user enables the section.

Verified by rendering the real _menubar_attributed_title() path offscreen:
25% · 36% · 0.7% · 41%, four legible marks, no critters.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S4jZ2RVf18AHTymTXueqM6

@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: 50cd3ea222

ℹ️ 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 menubar/title.py
lion_visible = not state.hide_agy and state.agy_session.percent is not None
lion_frame = int(app.lion_frame) if lion_visible else None
title_key = (title, phoenix_frame, dragon_frame, lion_frame)
title_key = (title,)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Include provider identity in the title cache key

When provider visibility changes but the rendered percentages happen to remain identical, this text-only key prevents the attributed title from being rebuilt. For example, if Antigravity is the only visible provider at 47%, then a refresh makes Antigravity unavailable while Grok becomes available at 47%, _compose_title() remains "47%", so the menu bar continues showing the Antigravity icon for Grok's quota. Include the visible provider identities or hide flags in the key.

Useful? React with 👍 / 👎.

_empty_state() derives hide_agy from find_agy(), so the test passed on a
machine with Antigravity installed and dropped the middle segment on CI.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S4jZ2RVf18AHTymTXueqM6
@aqua5230
aqua5230 merged commit b88c2bc into main Aug 30, 2026
7 checks passed
@aqua5230
aqua5230 deleted the feat/menubar-drop-critters-add-grok branch August 30, 2026 03:00
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.

Spirit Companions hide option

1 participant