feat(menubar): drop the Spirit Companions and put Grok in their place - #120
Conversation
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
There was a problem hiding this comment.
💡 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".
| 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,) |
There was a problem hiding this comment.
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
起因
issue #117 要求「加一個設定可以隱藏神獸」,理由是它們佔選單列空間。專案擁有者評估後決定直接移除,不做開關——三隻動畫沒有百分比之外的資訊量,卻每次刷新都要付出寬度與重繪成本。空出來的位置給 Grok。
移除神獸
刪掉
menubar/critter_frames.py、共用的 NSTimer 與animateCritters_selector、critter_animation_tick()、refresh.py的animation_groups資料流,以及 15 張動畫幀與整個assets/critters/lion/。assets/critters/phoenix/wrapped.png與dragon/wrapped.png保留——HTML 報表的「年度 Wrapped」卡片用它們,所以setup_app.py的"assets/critters"也留著。scripts/check_file_size.py的menubar/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_grok且grok_weekly.percent is not None;分隔號沿用 Antigravity 的title.length() > 0寫法,避免 Grok 單獨顯示時冒出開頭的·。hide_grok維持預設True,既有使用者不會無預警多出一段。驗證
離屏渲染 production 的
_menubar_attributed_title()路徑:25% · 36% · 0.7% · 41%,四個標記都清楚,沒有神獸。test_set_button_title_updates_for_animation_frame)check_file_size.py/check_doc_parity.py全綠docs/DEVELOPMENT.md的 Spirit Companions 段落一併移除Closes #117
🤖 Generated with Claude Code
https://claude.ai/code/session_01S4jZ2RVf18AHTymTXueqM6