-
Notifications
You must be signed in to change notification settings - Fork 7
fix: Leverage scrolling to avoid flicker #98
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
base: main
Are you sure you want to change the base?
Conversation
| } | ||
| }, | ||
| { isActive: isLoading || hasPendingToolCalls }, | ||
| { isActive: !disabled && !isLoading && !hasPendingToolCalls }, |
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.
Is the isActive guard intentional? While isLoading is true the handler never runs, so ESC/onInterrupt can no longer stop a streaming response.
| } | |
| }, | |
| { isActive: isLoading || hasPendingToolCalls }, | |
| { isActive: !disabled && !isLoading && !hasPendingToolCalls }, | |
| } | |
| }, | |
| { isActive: !disabled && !hasPendingToolCalls }, |
Finding type: Logical Bugs
| const scrollToBottom = useCallback(() => { | ||
| if (scrollViewRef.current) { | ||
| setTimeout(() => { | ||
| scrollViewRef.current?.scrollToBottom(); | ||
| }, 0); | ||
| } |
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.
scrollViewRef.current?.scrollToBottom() is invoked during initialization, but ink-scroll-view 0.3.5 only exposes scrollTo/scrollBy/remeasure/getViewportHeight on its ScrollViewRef (there is no scrollToBottom method per the official docs). That will raise "scrollToBottom is not a function" at runtime when this path executes.
| const scrollToBottom = useCallback(() => { | |
| if (scrollViewRef.current) { | |
| setTimeout(() => { | |
| scrollViewRef.current?.scrollToBottom(); | |
| }, 0); | |
| } | |
| const scrollToBottom = useCallback(() => { | |
| if (scrollViewRef.current) { | |
| setTimeout(() => { | |
| scrollViewRef.current?.scrollTo(Number.MAX_SAFE_INTEGER); | |
| }, 0); | |
| } |
Finding type: Type Inconsistency
Generated description
Below is a concise technical summary of the changes proposed in this PR:
Integrate the
ink-scroll-viewcomponent intoChatDisplay.tsxto manage chat message rendering, preventing UI flicker by providing a dedicated scrollable area for messages. Enhance user interaction by enabling keyboard-controlled scrolling and improving theChatInputcomponent to allow tab character insertion when no tool calls are active.ink-scroll-viewcomponent intoChatDisplay.tsxto provide a scrollable area for chat messages, preventing UI flicker and enabling keyboard-driven navigation with auto-scrolling for new messages.Modified files (3)
Latest Contributors(2)
ChatInputcomponent to insert a tab character when the tab key is pressed and no tool calls are active, improving text input functionality.Modified files (1)
Latest Contributors(2)