Fix streaming content disappearing on window switch and improve skills scanning
- Add useRef + visibilitychange/focus listener to re-sync streaming content when Electron window regains focus, preventing blank content flash - Remove duplicate text SSE events from assistant handler (stream_event already provides real-time deltas) - Make skills scanner recursive to find commands in subdirectories - Add debug logging for skills directory resolution Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
fab8b41966
commit
a5e9fc76a8
3 files changed
+59
-15
No files matched your search
@@ -289,13 +289,10 @@ export function streamClaude(options: ClaudeStreamOptions): ReadableStream<strin
|
||||
switch (message.type) {
|
||||
case 'assistant': {
|
||||
const assistantMsg = message as SDKAssistantMessage;
|
||||
// Text deltas are handled by stream_event for real-time streaming.
|
||||
// Only track lastAssistantText here and process tool_use blocks.
|
||||
const text = extractTextFromMessage(assistantMsg);
|
||||
if (text && text !== lastAssistantText) {
|
||||
// Send the new delta
|
||||
const delta = text.slice(lastAssistantText.length);
|
||||
if (delta) {
|
||||
controller.enqueue(formatSSE({ type: 'text', data: delta }));
|
||||
}
|
||||
if (text) {
|
||||
lastAssistantText = text;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user