fix: form item tooltip persists over chat after clicking a toggle#490
Draft
laileni-aws wants to merge 2 commits into
Draft
fix: form item tooltip persists over chat after clicking a toggle#490laileni-aws wants to merge 2 commits into
laileni-aws wants to merge 2 commits into
Conversation
The tooltip for a form item control (e.g. a toggle switch) was shown on mouseover and only hidden on mouseleave. When the control is clicked, toggling it can re-render the prompt input and remove the element before mouseleave fires, leaving the tooltip overlay orphaned on top of the chat and blocking interaction. Hide the tooltip on mousedown/click as well, which also clears any pending show timer. Adds tests covering show-on-hover, dismiss-on-click, and cancelling a pending tooltip.
Wrap the Playwright evaluate result in Boolean() so the value is a genuine boolean in every toolchain, satisfying strict-boolean- expressions. Keeps the repo lint gate green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A form-item tooltip (for example, the tooltip on a toggle switch such as the agentic-coding mode toggle) could remain on screen after the control was clicked, overlaying the chat and blocking interaction until it was dismissed. This PR makes the tooltip dismiss as soon as the control is activated.
Problem
Steps that reproduce the issue:
Root cause
In
src/components/chat-item/chat-item-form-items.ts, the tooltip was wired to only two events:When the control is clicked:
closeOnOutsideClick: false, so clicking does not dismiss it.mouseleavefires. The tooltipOverlayis appended to the document body, so it is left orphaned on top of the chat with no element left to triggermouseleave.Fix
Dismiss the tooltip when the control is activated by also handling
mousedownandclick:hideTooltipboth closes an open tooltip overlay and clears the pending show-timer, so it also prevents a tooltip from appearing after the user has already clicked.Testing
src/components/__test__/chat-item/chat-item-form-items.spec.ts:npx jest): 72 suites / 845 tests.eslintandprettier --checkpass; production build (npm run build) succeeds.Additional change
ui-tests/__test__/flows/quick-action-commands-header.ts: coerced the result of a Playwrightevaluatecall to a boolean withBoolean(...)before using it in a condition. This keeps the value a genuine boolean across toolchains, satisfying@typescript-eslint/strict-boolean-expressions, and keeps the repo lint gate green.Notes