-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: ensure VersionIndicator only shows on welcome screen #5288
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
- Move VersionIndicator inside the welcome screen conditional block - Fix mock implementation to use correct import path - Update tests to properly mock VersionIndicator visibility - Resolves test failures where VersionIndicator appeared with active tasks
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.
Pull Request Overview
This PR resolves failing tests by ensuring the VersionIndicator is only rendered on the welcome screen when there is no active task. Key changes include:
- Moving the VersionIndicator component inside the welcome screen conditional in ChatView.tsx.
- Updating the VersionIndicator mock in ChatView.spec.tsx to use the correct import path and handling for Vitest hoisting.
- Adjusting the container styling in ChatView.tsx to support proper absolute positioning of the VersionIndicator.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| webview-ui/src/components/chat/tests/ChatView.spec.tsx | Updated the mock implementation, import path, and temporary overrides for VersionIndicator tests |
| webview-ui/src/components/chat/ChatView.tsx | Moved VersionIndicator into the conditional rendering block and updated container styling |
Comments suppressed due to low confidence (1)
webview-ui/src/components/chat/tests/ChatView.spec.tsx:1158
- [nitpick] Ensure that the aria-label values for the VersionIndicator mock are consistent across tests to avoid confusion; consider unifying the label ('Version 3.22.5' vs 'chat:versionIndicator.ariaLabel') for clarity.
aria-label="Version 3.22.5">
|
✅ No security or compliance issues detected. Reviewed everything up to 6daaf22. Security Overview
Detected Code Changes
Reply to this PR with |
- Created createMockVersionIndicator helper to reduce code duplication - Replaced 5 repeated mock implementations with calls to the helper - Maintains same functionality with improved maintainability - Addresses PR review feedback from Copilot
Co-authored-by: Daniel Riccio <[email protected]>
…#5288) Co-authored-by: Daniel Riccio <[email protected]>
Description
This PR fixes failing tests in the ChatView component where the VersionIndicator was appearing when a task was active, despite tests expecting it to only show on the welcome screen.
Changes Made
!task) in ChatView.tsx../../common/VersionIndicator)vi.mockedTesting
Technical Details
The issue was caused by:
The fix ensures proper conditional rendering and correct mocking behavior.
Checklist
Important
Fix
VersionIndicatorinChatViewto only display on the welcome screen and update tests accordingly.VersionIndicatorinside the welcome screen conditional block inChatView.tsxto ensure it only shows when no task is active.ChatView.spec.tsxto mockVersionIndicatorusing the correct import path and handle Vitest hoisting issues withvi.mocked.VersionIndicatormock when needed.VersionIndicatoronly appears on the welcome screen and not when a task is active.ChatViewtest suite.This description was created by
for 6daaf22. You can customize this summary. It will automatically update as commits are pushed.