You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(chat): implement responsive status text and isolate message streaming state
- Add dynamic status text that adapts to terminal width for better UX
- Fix bug where streaming state leaked between messages
- Ensure each message's streaming state is properly isolated
- Update tests to reflect the improved chat interface behavior
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Copy file name to clipboardExpand all lines: knowledge.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,7 @@ Codebuff is a tool for editing codebases via natural language instruction to Buf
62
62
- Use `Ctrl+Tab/Ctrl+Shift+Tab` for hint navigation - works reliably everywhere and avoids conflicts with normal Tab behavior
63
63
- Use `Enter` to send messages or expand nodes (context-aware) - prioritizes chat functionality
64
64
- Use `Backspace` to delete characters or collapse nodes (context-aware) - prioritizes chat functionality
65
+
- Use `Left/Right arrows` for toggle control when a toggle is selected - left arrow closes (or moves to previous toggle if already closed), right arrow opens (or moves to next toggle if already open)
65
66
-`Ctrl+Up/Down` is unreliable on macOS
66
67
-`Shift+Arrow` combinations have mixed compatibility
67
68
- Emacs/readline shortcuts (`Ctrl+A`, `Ctrl+E`, etc.) are the most reliable cross-platform
constshortText='Tab: nav • Space: toggle • ESC: exit'
33
+
34
+
// Minimal status text
35
+
constminimalText='ESC: exit'
36
+
37
+
if(availableWidth>=fullText.length){
38
+
returnfullText
39
+
}elseif(availableWidth>=mediumText.length){
40
+
returnmediumText
41
+
}elseif(availableWidth>=shortText.length){
42
+
returnshortText
43
+
}else{
44
+
returnminimalText
45
+
}
46
+
}
20
47
constPLACEHOLDER_TEXT='Type your message...'
21
48
constWELCOME_MESSAGE=
22
49
'Welcome to Codebuff Chat! Type your messages below and press Enter to send. This is a dedicated chat interface for conversations with your AI assistant.'
@@ -83,6 +110,7 @@ interface ChatState {
83
110
messageQueue: string[]
84
111
userHasScrolled: boolean
85
112
currentStreamingMessageId?: string
113
+
currentlyStreamingNodeId?: string
86
114
inputBarFocused: boolean
87
115
}
88
116
@@ -98,6 +126,7 @@ let chatState: ChatState = {
98
126
messageQueue: [],
99
127
userHasScrolled: false,
100
128
currentStreamingMessageId: undefined,
129
+
currentlyStreamingNodeId: undefined,
101
130
inputBarFocused: true,// Start with input bar focused
102
131
}
103
132
@@ -217,6 +246,7 @@ function resetChatState(): void {
217
246
messageQueue: [],
218
247
userHasScrolled: false,
219
248
currentStreamingMessageId: undefined,
249
+
currentlyStreamingNodeId: undefined,
220
250
inputBarFocused: true,// Start with input bar focused
221
251
}
222
252
}
@@ -397,6 +427,7 @@ function finishStreamingMessage(messageId: string): void {
0 commit comments