fix: hide the command suggestion tooltip whenever the suggestion panel closes#9312
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a watcher in CommandSuggestion.vue to hide the tooltip when the component's visibility changes to false. The reviewer suggested also watching props.commands to ensure the tooltip is hidden when the command list changes, preventing stale tooltips when hovered items are filtered out.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| watch( | ||
| () => props.visible, | ||
| (visible) => { | ||
| if (!visible) { | ||
| tooltip.visible = false; | ||
| } | ||
| }, | ||
| ); |
There was a problem hiding this comment.
When the user types to filter the commands, the command list (props.commands) changes. If the currently hovered command is filtered out or its position changes, the DOM element is removed or updated. Because the element is removed/replaced, the browser's native mouseleave event may not fire on the hovered item, causing the tooltip to remain visible with stale content.
To prevent this, we should also watch props.commands and hide the tooltip when the command list changes.
watch(
() => props.visible,
(visible) => {
if (!visible) {
tooltip.visible = false;
}
},
);
watch(
() => props.commands,
() => {
tooltip.visible = false;
},
);
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
astrbot-docs | f75fe72 | Commit Preview URL Branch Preview URL |
Jul 18 2026, 10:34 AM |
Summary
Root cause
The suggestion panel remained mounted when its
visibleprop became false, while the tooltip was teleported todocument.bodyand controlled by independent local state. Selecting a command with Enter closed the panel without firingmouseleave, so the tooltip stayed visible.Impact
Command tooltips no longer remain over the WebChat UI after selecting a command with Enter or closing the suggestion panel through another non-pointer path.
Validation
pnpm typecheckpnpm exec prettier --check src/components/chat/CommandSuggestion.vuepnpm builduv run ruff format --check .uv run ruff check .Closes #9286
Summary by Sourcery
Bug Fixes: