feat: 添加猫爪HUD显示开关 - #2424
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
Walkthrough变更概览新增任务 HUD 设置开关及多语言文案,持久化可见性偏好,并在关闭时停止任务轮询、隐藏 HUD。 Changes任务 HUD 开关流程
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile Summary这个 PR 在猫爪工具栏的"高级设置"子面板中新增了任务 HUD 显示开关,使用
Confidence Score: 5/5可以合并喵~三条关键链路(开关关闭即隐藏、WebSocket 自动显示拦截、默认值向后兼容)均已正确实现,没有发现功能缺陷。 偏好门控已被加入 showAgentTaskHUD,确保 WebSocket 自动显示路径也受开关约束;stopAgentTaskPolling 内部调用 hideAgentTaskHUD,保证关闭时立即生效;localStorage 读取默认 true,现有用户升级后 HUD 不会意外消失。整体改动范围小、逻辑清晰、各边界条件都已覆盖喵。 Files Needing Attention: No files require special attention
|
| Filename | Overview |
|---|---|
| static/app/app-agent.js | checkAndToggleTaskHUD 新增 event 参数及 localStorage 偏好读写;默认值为 true(向后兼容),关闭时调用 stopAgentTaskPolling 触发 hideAgentTaskHUD;逻辑正确。 |
| static/avatar/avatar-ui-popup.js | 新增 createTaskHudSettingsSidePanel 及"高级设置"菜单项;复选框从 localStorage 初始化,change handler 正确写入并调用 checkAndToggleTaskHUD;side panel 注册到 attachSidePanelHover 白名单。 |
| static/common-ui-hud.js | showAgentTaskHUD 新增 !isAgentTaskHudVisiblePreferenceEnabled() 门控,封堵了 WebSocket 自动显示路径;isAgentTaskHudVisiblePreferenceEnabled 默认返回 true,向后兼容。 |
| static/locales/en.json | 新增 showTaskHud 英文文案,与其他语言包格式一致。 |
Reviews (6): Last reviewed commit: "Merge branch 'main' of github.com:Projec..." | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a55fe7cf57
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@static/common-ui-hud.js`:
- Around line 516-523: Update static/common-ui-hud.js lines 516-523 in
_createAgentPopupContent to find the task HUD checkbox via popup.querySelector
and default saved visibility to true unless localStorage explicitly contains
'false'; apply the same !== 'false' default in static/app/app-agent.js lines
1631-1642 for taskhudOn, and remove the unused taskhud binding from the el()
destructuring in static/js/agent_ui_v2.js line 485.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a17d53e8-c1a5-4a26-8921-80fa14131242
📒 Files selected for processing (11)
static/app/app-agent.jsstatic/common-ui-hud.jsstatic/js/agent_ui_v2.jsstatic/locales/en.jsonstatic/locales/es.jsonstatic/locales/ja.jsonstatic/locales/ko.jsonstatic/locales/pt.jsonstatic/locales/ru.jsonstatic/locales/zh-CN.jsonstatic/locales/zh-TW.json
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
Project-N-E-K-O/N.E.K.O.-PC(manual)
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
|
你好,涉及到ui改动的部分,还请在pr描述中贴一张截图,谢谢~ |
改了改了 |
|
感觉……不是很美观啊() |
|
( ° △ °|||) 啊这…… |
|
@MingTianSang 想个别方案🤔? |
|
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
…e/add-agent-taskhud-switch # Conflicts: # static/avatar/avatar-ui-popup.js
|
寄了说是 高级选项没了 @MingTianSang |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f90a61360d
ℹ️ 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".
| if (isAgentHudSuppressedByGoodbye() || !isAgentTaskHudVisiblePreferenceEnabled()) { | ||
| this.hideAgentTaskHUD(); | ||
| return; |
There was a problem hiding this comment.
Allow the tutorial to override the HUD preference
When neko-agent-taskhud-visible is false and the user runs or replays the Day 6 tutorial, its show-task-hud operation calls showAgentTaskHUD(), which now immediately hides the HUD and returns. The tutorial's fallback only runs when that method is absent, and it subsequently waits for #agent-task-hud to become visible, so both task-HUD tutorial scenes lose their target. Provide a force-show path for the tutorial or temporarily override and restore the preference.
Useful? React with 👍 / 👎.
| if (taskhudCheckbox) { | ||
| taskhudOn = taskhudCheckbox.checked; | ||
| try { localStorage.setItem('neko-agent-taskhud-visible', taskhudOn ? 'true' : 'false'); } catch (_) {} |
There was a problem hiding this comment.
Read storage unless the HUD checkbox triggered the check
When the preference is changed in another same-origin app window, that window updates localStorage but the existing checkbox in this document remains stale. A later no-argument call to checkAndToggleTaskHUD()—for example from an agent-status synchronization—or a child-capability change then replaces the freshly read stored value with the stale checkbox state and writes it back, silently undoing the user's choice. Only use and persist checkbox.checked when changedCheckbox is the event source; otherwise retain the stored value (or synchronize the checkbox on storage events).
Useful? React with 👍 / 👎.



改动概述 / Summary
#2414 中提到给猫爪任务悬浮窗加一个开关,因为我想要一直挂着mcp而多一个悬浮窗有时候会比较碍事,因此在猫爪工具栏中加了一个开关,便于随时开关
这个开关为开启的时候保留原有逻辑显示hud,关闭的时候强制关闭hud
回归报告 / Regression Report
不拆分理由 / Why Not Split
测试 / Testing
npm run build没问题npm test全passed手动验证相关场景没问题
截图对比
Summary by CodeRabbit