feat: add thinking indicator while model is generating
- src/types.ts: Add isThinking flag to ChatMessage to track transient 'model is working' state. - src/chat-view.ts: Set isThinking: true on the assistant placeholder message when user sends input. Clear it when the first stream chunk arrives or on error. Update render() to show a spinner + 'Thinking…' text while isThinking is active. - styles.css: Add ollama-thinking-indicator class with a CSS spinner animation and muted italic text styling.
This commit is contained in:
+26
@@ -149,3 +149,29 @@
|
||||
.ollama-send-button:active {
|
||||
filter: brightness(0.95);
|
||||
}
|
||||
|
||||
/* Thinking indicator */
|
||||
.ollama-thinking-indicator {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: var(--size-4-1);
|
||||
font-style: italic;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.ollama-thinking-indicator::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 0.9em;
|
||||
height: 0.9em;
|
||||
border: 2px solid var(--text-muted);
|
||||
border-top-color: transparent;
|
||||
border-radius: 50%;
|
||||
animation: ollama-spin 1s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes ollama-spin {
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user