Skip to content

fix: hide the command suggestion tooltip whenever the suggestion panel closes#9312

Merged
Soulter merged 1 commit into
masterfrom
codex/fix-command-tooltip
Jul 18, 2026
Merged

fix: hide the command suggestion tooltip whenever the suggestion panel closes#9312
Soulter merged 1 commit into
masterfrom
codex/fix-command-tooltip

Conversation

@Soulter

@Soulter Soulter commented Jul 18, 2026

Copy link
Copy Markdown
Member

Summary

  • hide the command suggestion tooltip whenever the suggestion panel closes
  • cover keyboard selection, Escape, blur, and other programmatic close paths without coupling the parent to child internals

Root cause

The suggestion panel remained mounted when its visible prop became false, while the tooltip was teleported to document.body and controlled by independent local state. Selecting a command with Enter closed the panel without firing mouseleave, 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 typecheck
  • pnpm exec prettier --check src/components/chat/CommandSuggestion.vue
  • pnpm build
  • uv run ruff format --check .
  • uv run ruff check .

Closes #9286

Summary by Sourcery

Bug Fixes:

  • Hide the command suggestion tooltip whenever the suggestion panel visibility is toggled off, preventing stray tooltips after non-pointer closes.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +91 to +98
watch(
() => props.visible,
(visible) => {
if (!visible) {
tooltip.visible = false;
}
},
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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;
  },
);

@Soulter Soulter changed the title fix: hide command tooltip with suggestion panel fix: hide the command suggestion tooltip whenever the suggestion panel closes Jul 18, 2026
@Soulter
Soulter marked this pull request as ready for review July 18, 2026 10:30
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 18, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

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

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jul 18, 2026
@Soulter
Soulter merged commit 7ef1af2 into master Jul 18, 2026
21 of 22 checks passed
@Soulter
Soulter deleted the codex/fix-command-tooltip branch July 18, 2026 10:30

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]WebChat 使用enter选择指令导致Tooltip残留在Chat界面

1 participant