fix flickering UI in Powershell #36
Merged
+100
−68
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.
What does this PR do?
This pull request introduces several updates across the codebase, focusing on performance improvements, code readability, and platform-specific optimizations. The key changes include memoization of chat entries to prevent unnecessary re-renders, adjustments to loading spinner intervals to reduce flickering on Windows, and enhancements for platform-specific behavior in the console. Additionally, a minor version bump and a new test function were added.
Performance and Optimization:
Memoized Chat Entries: Introduced
MemoizedChatEntry
insrc/ui/components/chat-history.tsx
to optimize rendering by preventing unnecessary re-renders of chat entries. This change includes updates to how entries are rendered in theChatHistory
component. [1] [2] [3]Reduced Loading Spinner Flickering: Adjusted the spinner frame update interval to 500ms (from 250ms) and the loading text update interval to 4 seconds (from 2 seconds) in
src/ui/components/loading-spinner.tsx
to reduce flickering and state changes, especially on Windows. [1] [2]Platform-Specific Enhancements:
src/ui/components/chat-interface.tsx
to conditionally clear the console only on non-Windows platforms or when not using PowerShell, addressing flickering issues in PowerShell.Code Maintenance:
Version Bump: Updated the package version in
package.json
from0.0.8
to0.0.9
.Test Function Addition: Added a simple
dummy_function
intest.py
for testing purposes.Fixes #34
Checklist