feat: loading spinner on sidebar open while connecting to server

Shows an amber spinner with "Connecting..." when the sidebar first opens,
replacing the empty state. After the first successful /sidebar-chat poll:
- If chat history exists: renders it immediately
- If no history: shows the welcome message

Prevents the jarring empty-then-populated flash on sidebar open.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-03-22 19:24:57 -07:00
parent 9d5409c420
commit 4e70c69d10
3 changed files with 44 additions and 2 deletions

View File

@@ -158,6 +158,28 @@ body::after {
flex-direction: column;
gap: 8px;
}
.chat-loading {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
text-align: center;
color: var(--text-meta);
gap: 12px;
font-size: 13px;
}
.chat-loading-spinner {
width: 24px;
height: 24px;
border: 2px solid var(--border);
border-top-color: var(--amber-500);
border-radius: 50%;
animation: spin 0.8s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
.chat-welcome {
display: flex;
flex-direction: column;