-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: resolve send button flashing issue in webview #7320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Changed transition-all to transition-opacity for more specific animations - Reduced transition duration from 150ms to 100ms for smoother effect - Increased base opacity from 60% to 75% for better visibility - Applied same fixes to all icon buttons to ensure consistency - Fixes intermittent flashing reported in send message button
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed my own code. Found it suspiciously free of bugs. Must have missed something.
| "relative inline-flex items-center justify-center", | ||
| "bg-transparent border-none p-1.5", | ||
| "rounded-md min-w-[28px] min-h-[28px]", | ||
| "text-vscode-foreground opacity-85", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I notice we're using here for the stop TTS and add images buttons, but other buttons in this file use (lines 1107, 1133). Is this intentional, or should we standardize on one opacity value for consistency across all icon buttons?
| // Removed transition-all to prevent unwanted animations | ||
| "opacity-75 hover:opacity-100 text-vscode-descriptionForeground hover:text-vscode-foreground", | ||
| // Use transition only for specific properties to avoid flashing | ||
| "transition-opacity duration-100", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good fix changing from to ! However, I'm wondering if we should also add to smooth out the background and border color changes on hover? This would maintain smooth transitions without causing the flashing issue.
| "rounded-md min-w-[28px] min-h-[28px]", | ||
| "opacity-60 hover:opacity-100 text-vscode-descriptionForeground hover:text-vscode-foreground", | ||
| "transition-all duration-150", | ||
| "opacity-75 hover:opacity-100 text-vscode-descriptionForeground hover:text-vscode-foreground", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These buttons use while some others use . Could we pick one standard opacity value for all icon buttons to maintain visual consistency?
| "relative inline-flex items-center justify-center", | ||
| "bg-transparent border-none p-1.5", | ||
| "rounded-md min-w-[28px] min-h-[28px]", | ||
| "text-vscode-foreground opacity-85", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This component uses as the base opacity. Since this is the reusable icon button component, whatever opacity we choose here should probably be the standard for all icon buttons. Consider aligning all button opacities with this value.
|
This has unrelated changes |
Summary
Fixes intermittent flashing of the send message button and other icon buttons in the webview UI.
Problem
User reported that the send message button was flashing intermittently in the web view, causing a poor user experience.
Solution
The issue was caused by using
transition-allwith a 150ms duration, which was animating unintended CSS properties and causing visual flashing.Changes Made:
transition-alltotransition-opacityfor more specific, controlled animationsFiles Modified:
webview-ui/src/components/chat/ChatTextArea.tsx- Fixed send button, enhance prompt button, stop TTS button, and add images buttonwebview-ui/src/components/chat/EditModeControls.tsx- Fixed cancel and send buttons in edit modewebview-ui/src/components/chat/IconButton.tsx- Fixed generic icon button componentwebview-ui/src/components/chat/IndexingStatusBadge.tsx- Fixed indexing status buttonTesting
Review Score
Code review confidence: 95% (High Confidence)
Fixes the issue reported via Slack about the send message button flashing intermittently.
Important
Fixes flashing issue of send and icon buttons in webview by adjusting CSS transitions and opacity.
ChatTextArea.tsx,EditModeControls.tsx,IconButton.tsx, andIndexingStatusBadge.tsxby changingtransition-alltotransition-opacity.ChatTextArea.tsx: Adjusts send button, enhance prompt button, stop TTS button, and add images button.EditModeControls.tsx: Adjusts cancel and send buttons in edit mode.IconButton.tsx: Adjusts generic icon button component.IndexingStatusBadge.tsx: Adjusts indexing status button.This description was created by
for 5641c84. You can customize this summary. It will automatically update as commits are pushed.