feat(status): allow dismissing live status bubbles - #42
Conversation
|
PR Title: feat(status): allow dismissing live status bubbles Commit: 本次 PR 实现了“允许用户手动隐藏 live bubble”功能,涉及 4 个文件的改动:
整体设计合理:动画与状态分离(UI 层负责动画,Controller 负责状态),退场有 fallback 兜底,键盘可访问性通过 focus-visible 支持。未发现功能性缺陷或安全风险。 |
📝 WalkthroughWalkthroughLiveStatusController 新增会话隐藏、恢复和清理逻辑。状态卡片新增隐藏按钮、无障碍标签和退出动画。测试覆盖隐藏后的事件处理、恢复条件和会话隔离。 Changes会话状态隐藏
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant 状态卡片
participant LiveStatusController
participant AgentEvent
状态卡片->>LiveStatusController: dismiss(sessionKey)
LiveStatusController-->>状态卡片: emitChange()
LiveStatusController->>LiveStatusController: getStatuses() 过滤 dismissed 会话
AgentEvent->>LiveStatusController: UserPromptSubmit 或非 compact SessionStart
LiveStatusController->>LiveStatusController: 移除 dismissed 标记
LiveStatusController-->>状态卡片: 返回可显示状态
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/live-status.test.ts (1)
96-116: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win补充
SessionStart的恢复条件测试。当前测试只验证
UserPromptSubmit会恢复已隐藏会话。请增加非compactSessionStart恢复状态的测试,并增加compactSessionStart保持隐藏的测试。这样可保护LiveStatusController中的两个条件分支。🤖 Prompt for 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. In `@src/live-status.test.ts` around lines 96 - 116, 在现有 live-status 恢复测试附近补充 LiveStatusController 的 SessionStart 场景:验证非 compact 的 SessionStart 会恢复已 dismiss 的会话,并验证 compact 的 SessionStart 仍保持隐藏;保留现有 UserPromptSubmit 流程,覆盖这两个条件分支。
🤖 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 `@src/styles.css`:
- Around line 87-99: Update the background declaration in the
.status-dismiss::before/.status-dismiss::after rule to use the lowercase
currentcolor keyword, preserving the existing styling and pseudo-element
behavior.
---
Nitpick comments:
In `@src/live-status.test.ts`:
- Around line 96-116: 在现有 live-status 恢复测试附近补充 LiveStatusController 的
SessionStart 场景:验证非 compact 的 SessionStart 会恢复已 dismiss 的会话,并验证 compact 的
SessionStart 仍保持隐藏;保留现有 UserPromptSubmit 流程,覆盖这两个条件分支。
🪄 Autofix
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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 43d7c3b8-857b-4484-bbbf-5a53c2eedf78
📒 Files selected for processing (4)
src/live-status.test.tssrc/live-status.tssrc/status.tssrc/styles.css
| .status-dismiss::before, | ||
| .status-dismiss::after { | ||
| content: ""; | ||
| position: absolute; | ||
| top: 50%; | ||
| left: 50%; | ||
| width: 9px; | ||
| height: 1.5px; | ||
| border-radius: 999px; | ||
| background: currentColor; | ||
| } | ||
| .status-dismiss::before { transform: translate(-50%, -50%) rotate(45deg); } | ||
| .status-dismiss::after { transform: translate(-50%, -50%) rotate(-45deg); } |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
修正 Stylelint 的值关键字大小写错误。
Line 96 的 currentColor 违反 value-keyword-case。将它改为 currentcolor,以使 Stylelint 检查通过。
建议修改
- background: currentColor;
+ background: currentcolor;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| .status-dismiss::before, | |
| .status-dismiss::after { | |
| content: ""; | |
| position: absolute; | |
| top: 50%; | |
| left: 50%; | |
| width: 9px; | |
| height: 1.5px; | |
| border-radius: 999px; | |
| background: currentColor; | |
| } | |
| .status-dismiss::before { transform: translate(-50%, -50%) rotate(45deg); } | |
| .status-dismiss::after { transform: translate(-50%, -50%) rotate(-45deg); } | |
| .status-dismiss::before, | |
| .status-dismiss::after { | |
| content: ""; | |
| position: absolute; | |
| top: 50%; | |
| left: 50%; | |
| width: 9px; | |
| height: 1.5px; | |
| border-radius: 999px; | |
| background: currentcolor; | |
| } | |
| .status-dismiss::before { transform: translate(-50%, -50%) rotate(45deg); } | |
| .status-dismiss::after { transform: translate(-50%, -50%) rotate(-45deg); } |
🧰 Tools
🪛 Stylelint (17.14.0)
[error] 96-96: Expected "currentColor" to be "currentcolor" (value-keyword-case)
(value-keyword-case)
🤖 Prompt for 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.
In `@src/styles.css` around lines 87 - 99, Update the background declaration in
the .status-dismiss::before/.status-dismiss::after rule to use the lowercase
currentcolor keyword, preserving the existing styling and pseudo-element
behavior.
Source: Linters/SAST tools
🤖 I have created a release *beep* *boop* --- ## [1.8.0](v1.7.0...v1.8.0) (2026-08-07) ### Features * **i18n:** add English and Chinese localization ([#44](#44)) ([1594d3e](1594d3e)) * **status:** allow dismissing live bubbles ([#42](#42)) ([5c91d5e](5c91d5e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **新功能** * 支持英文和中文本地化。 * 支持关闭实时气泡显示。 * **文档** * 更新 1.8.0 版本变更记录,并补充上述功能说明。 * **版本更新** * 产品版本已升级至 1.8.0。 <!-- end of auto-generated comment: release notes by coderabbit.ai -->
概要
为实时状态气泡增加可发现、可访问的手动关闭能力,并明确关闭只作用于当前任务,而不会停用 Agent 状态联动。
主要改动
行为语义
点击关闭按钮后,LiveStatusController 会保留会话状态、事件去重和终止事件账本,只在可见状态列表中过滤当前会话。这样高频 Hook 和轮询重复事件不会让气泡立即复活,同时新任务仍可自然恢复展示。
验证
Summary by CodeRabbit
新功能
改进
测试