Skip to content

fix: defer completion card collapse when mouse is inside panel#69

Merged
wxtsky merged 1 commit intowxtsky:mainfrom
lkangd:fix/defer-completion-card-collapse
Apr 13, 2026
Merged

fix: defer completion card collapse when mouse is inside panel#69
wxtsky merged 1 commit intowxtsky:mainfrom
lkangd:fix/defer-completion-card-collapse

Conversation

@lkangd
Copy link
Copy Markdown
Contributor

@lkangd lkangd commented Apr 12, 2026

Summary

  • 修复完成卡片(completion card)在鼠标仍在面板内时被自动收起的竞态问题
  • 新增 deferCollapseOnMouseLeave 标志,当 5 秒自动折叠定时器触发但鼠标仍在面板内时,延迟收起到鼠标离开时执行
  • 将模型状态变更移出 withAnimation 闭包,确保动画中断时状态仍能正确更新

Problem

完成卡片展示后会在 5 秒后自动折叠。如果用户此时正将鼠标悬停在面板上阅读内容,面板会在用户眼皮底下突然消失,体验不佳。

Solution

引入延迟折叠机制:

  1. 定时器触发时,若鼠标已进入过完成卡片(completionHasBeenEntered == true),则设置 deferCollapseOnMouseLeave = true 而非立即折叠
  2. 鼠标离开面板时,检查 completionHasBeenEntered || deferCollapseOnMouseLeave,满足任一条件即执行折叠
  3. 模型状态变更(重置标志、取消队列)放在 withAnimation 闭包外部,保证不受动画中断影响

Test plan

  • 触发一个任务完成,在完成卡片出现后将鼠标移入面板,等待 5 秒以上,确认面板不会自动折叠
  • 鼠标移出面板后,确认面板正常折叠
  • 完成卡片出现后不将鼠标移入面板,确认 5 秒后正常自动折叠
  • 连续多次触发完成事件,确认队列行为正常
  • 在延迟折叠状态下调用 cancelCompletionQueue(),确认标志被正确重置

Prevent the completion card from auto-collapsing while the user is
still hovering over it. When the auto-collapse timer fires with the
mouse inside the panel, collapse is deferred until the mouse leaves.
nguyenvanduocit pushed a commit to nguyenvanduocit/CodeIsland that referenced this pull request Apr 13, 2026
Two new tasks from wxtsky/CodeIsland PRs wxtsky#70 and wxtsky#69 (both open, Apr 12 2026):
- T-024 (XS/high): settings window close calls NSApp.hide(nil) — panel flicker bug
- T-025 (S/medium): completion card auto-collapses while mouse is hovering

All other v1.0.19 changes skipped (non-Claude CLIs, L10n, CI/release infra).
vibeislandapp/vibe-island: no code changes since Apr 3.

https://claude.ai/code/session_01SaW44SRNDomF8BFgv9atRT
@wxtsky wxtsky merged commit 19f487f into wxtsky:main Apr 13, 2026
@lkangd lkangd deleted the fix/defer-completion-card-collapse branch April 14, 2026 02:00
nguyenvanduocit pushed a commit to nguyenvanduocit/CodeIsland that referenced this pull request Apr 15, 2026
- PR wxtsky#80 MERGED: configurable notch height modes → T-026
- PR wxtsky#86 open: auto-collapse after session jump → T-027 (watch)
- PR wxtsky#76 open: message input bar + TerminalWriter → T-028 (watch)
- Issue wxtsky#84: Ghostty quick terminal activation bug → T-029
- Note PR wxtsky#69 and wxtsky#70 now merged upstream (T-024, T-025 ready)
- vibe-island: no new code changes

https://claude.ai/code/session_01Hoa4hooNsWEnv8vC42x8G3
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.

2 participants