feat: chat UX overhaul — GLM local model, icons, layout modes, instant bubbles
- Add GLM-4.7-Flash as default Ollama model (replaces Mistral) - Fix WRITE_TIMEOUT (15s→120s) and HTMX timeout (5s→120s) for local LLM - Auto-warmup model on startup in development mode - Add /api/chat/status endpoint for model readiness polling - Show "Initializing AI model..." indicator while model loads - Add user avatar (mdi:account) on chat messages - Inject company/project/course sprite icons inline in chat responses - Replace cramped header icons with 4 icon buttons + tooltips (Compact, Side panel, Floating, Full screen) - Add floating/draggable chat mode with smooth drag support - Chip questions show user bubble instantly and clear input - Help modal prefills input instead of auto-sending - User bubble rendered client-side for immediate feedback
This commit is contained in:
@@ -98,6 +98,32 @@
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
/* Size: Floating — draggable, resizable feel */
|
||||
.chat-panel.chat-float {
|
||||
top: 10vh;
|
||||
left: auto;
|
||||
right: 2rem;
|
||||
bottom: auto;
|
||||
width: 420px;
|
||||
max-height: 70vh;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
|
||||
resize: both;
|
||||
overflow: hidden;
|
||||
transition: none;
|
||||
}
|
||||
|
||||
/* Disable transition during active drag for instant movement */
|
||||
.chat-panel.chat-dragging {
|
||||
transition: none !important;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.chat-panel.chat-float .chat-messages {
|
||||
max-height: none;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
/* Size: Full width */
|
||||
.chat-panel.chat-full {
|
||||
top: 0;
|
||||
@@ -135,46 +161,64 @@
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
/* Size controls — 3 discrete toggle icons */
|
||||
.chat-size-controls {
|
||||
/* Header actions — icon buttons with tooltips */
|
||||
.chat-header-actions {
|
||||
margin-left: auto;
|
||||
display: flex;
|
||||
gap: 2px;
|
||||
align-items: center;
|
||||
gap: 1px;
|
||||
}
|
||||
|
||||
.chat-size-opt {
|
||||
.chat-mode-btn {
|
||||
background: none;
|
||||
border: none;
|
||||
color: rgba(255,255,255,0.6);
|
||||
color: rgba(255,255,255,0.5);
|
||||
cursor: pointer;
|
||||
font-size: 0.85rem;
|
||||
padding: 2px;
|
||||
font-size: 0.95rem;
|
||||
padding: 4px;
|
||||
display: flex;
|
||||
border-radius: 3px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 4px;
|
||||
transition: all 0.15s;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.chat-size-opt:hover,
|
||||
.chat-size-opt.active {
|
||||
.chat-mode-btn:hover {
|
||||
color: #fff;
|
||||
background: rgba(255,255,255,0.15);
|
||||
}
|
||||
|
||||
.chat-help-btn {
|
||||
margin-left: 0;
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--action-bar-text-muted, rgba(255, 255, 255, 0.85));
|
||||
cursor: pointer;
|
||||
font-size: 1rem;
|
||||
transition: color 0.2s;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0;
|
||||
.chat-mode-btn.active {
|
||||
color: #fff;
|
||||
background: rgba(255,255,255,0.2);
|
||||
}
|
||||
|
||||
.chat-help-btn:hover {
|
||||
/* Native tooltip via title attr — enhanced with CSS for consistent look */
|
||||
.chat-mode-btn[title]:hover::after {
|
||||
content: attr(title);
|
||||
position: absolute;
|
||||
top: calc(100% + 6px);
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
background: var(--black-bar, #2b2b2b);
|
||||
color: #fff;
|
||||
padding: 4px 8px;
|
||||
border-radius: 4px;
|
||||
font-size: 0.65rem;
|
||||
font-family: 'Source Sans Pro', sans-serif;
|
||||
font-weight: 400;
|
||||
white-space: nowrap;
|
||||
z-index: 1001;
|
||||
pointer-events: none;
|
||||
box-shadow: 0 2px 8px rgba(0,0,0,0.3);
|
||||
}
|
||||
|
||||
.chat-header-divider {
|
||||
width: 1px;
|
||||
height: 16px;
|
||||
background: rgba(255,255,255,0.25);
|
||||
margin: 0 3px;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
@@ -222,6 +266,10 @@
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.chat-avatar-user {
|
||||
background: var(--text-light, #999999);
|
||||
}
|
||||
|
||||
.chat-msg {
|
||||
padding: 10px 14px;
|
||||
border-radius: 16px;
|
||||
@@ -293,6 +341,13 @@
|
||||
Navigation Links in Chat Messages
|
||||
========================================================================== */
|
||||
|
||||
/* Inline sprite icons in chat messages */
|
||||
.chat-msg .icon-sprite {
|
||||
vertical-align: middle;
|
||||
margin-right: 2px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.chat-nav-link {
|
||||
color: var(--accent-green, #27ae60);
|
||||
text-decoration: none;
|
||||
@@ -331,6 +386,24 @@
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.chat-typing-dots {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.chat-status-text {
|
||||
font-size: 0.72rem;
|
||||
color: var(--accent-green, #27ae60);
|
||||
font-style: italic;
|
||||
animation: statusPulse 2s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes statusPulse {
|
||||
0%, 100% { opacity: 0.6; }
|
||||
50% { opacity: 1; }
|
||||
}
|
||||
|
||||
.chat-typing-dot {
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
|
||||
Reference in New Issue
Block a user