Redesign the home page and voice stream panel into a compact dock layout to improve the chat experience. Implement a flush mechanism in the PCM playback worklet to handle the resampler tail, preventing premature session termination due to phantom outstanding playback. Fix document filter visibility in settings to ensure controls remain accessible when no results match, and refactor transcript insertion to maintain correct user/assistant ordering.
298 lines
5.4 KiB
CSS
298 lines
5.4 KiB
CSS
/* Host collapses its row to 0 when the call ends, so the composer never jumps when the bar is removed. */
|
|
:host {
|
|
display: grid;
|
|
grid-template-rows: 1fr;
|
|
opacity: 1;
|
|
animation: dockIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
|
|
transition:
|
|
grid-template-rows 0.35s cubic-bezier(0.22, 1, 0.36, 1),
|
|
opacity 0.3s ease,
|
|
margin 0.35s ease;
|
|
}
|
|
|
|
:host(.is-ended) {
|
|
grid-template-rows: 0fr;
|
|
opacity: 0;
|
|
margin-bottom: 0 !important;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.call-dock {
|
|
direction: rtl;
|
|
box-sizing: border-box;
|
|
min-height: 0;
|
|
overflow: hidden;
|
|
background: var(--surface-bg);
|
|
border: 1px solid var(--surface-border);
|
|
border-radius: 1.25rem;
|
|
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
|
|
}
|
|
|
|
:host(.is-ended) .call-dock {
|
|
border-color: transparent;
|
|
box-shadow: none;
|
|
}
|
|
|
|
.dock-row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.75rem;
|
|
padding: 0.5rem 0.75rem;
|
|
}
|
|
|
|
/* ---------- Orb ---------- */
|
|
/* The canvas is larger than the bar is tall (negative margin) so the orb and its glow are not tiny. */
|
|
.orb-container {
|
|
width: 96px;
|
|
height: 96px;
|
|
margin-block: -20px;
|
|
margin-inline: -14px;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.orb-container canvas {
|
|
display: block;
|
|
width: 100% !important;
|
|
height: 100% !important;
|
|
}
|
|
|
|
/* Shown only when WebGL is unavailable */
|
|
.orb-fallback {
|
|
width: 55%;
|
|
height: 55%;
|
|
border-radius: 50%;
|
|
background: radial-gradient(circle at 35% 30%, #93c5fd, #3b82f6 55%, #1e3a5f);
|
|
box-shadow: 0 0 24px rgba(59, 130, 246, 0.35);
|
|
animation: fallbackPulse 2.4s ease-in-out infinite;
|
|
}
|
|
|
|
@keyframes fallbackPulse {
|
|
0%,
|
|
100% {
|
|
transform: scale(1);
|
|
}
|
|
50% {
|
|
transform: scale(1.08);
|
|
}
|
|
}
|
|
|
|
/* ---------- Status ---------- */
|
|
.dock-info {
|
|
flex: 1;
|
|
min-width: 0;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
}
|
|
|
|
.status-text {
|
|
margin: 0;
|
|
min-width: 0;
|
|
font-size: 0.875rem;
|
|
color: var(--text-secondary);
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.status-dot {
|
|
width: 10px;
|
|
height: 10px;
|
|
border-radius: 50%;
|
|
background: var(--muted);
|
|
flex-shrink: 0;
|
|
transition: background 0.3s ease;
|
|
}
|
|
|
|
.status-dot[data-state='LISTENING'] {
|
|
background: #22c55e;
|
|
animation: dotPulse 1.6s ease-in-out infinite;
|
|
}
|
|
|
|
.status-dot[data-state='PROCESSING'] {
|
|
background: #818cf8;
|
|
animation: dotPulse 0.9s ease-in-out infinite;
|
|
}
|
|
|
|
.status-dot[data-state='SPEAKING'] {
|
|
background: #a78bfa;
|
|
animation: dotPulse 0.7s ease-in-out infinite;
|
|
}
|
|
|
|
.status-dot[data-state='INTERRUPTED'] {
|
|
background: #f59e0b;
|
|
}
|
|
|
|
@keyframes dotPulse {
|
|
0%,
|
|
100% {
|
|
opacity: 1;
|
|
transform: scale(1);
|
|
}
|
|
50% {
|
|
opacity: 0.55;
|
|
transform: scale(1.3);
|
|
}
|
|
}
|
|
|
|
/* ---------- Controls ---------- */
|
|
.dock-actions {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.dock-btn {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 0.375rem;
|
|
height: 40px;
|
|
min-width: 40px;
|
|
padding: 0 0.75rem;
|
|
border: 1px solid var(--surface-border);
|
|
border-radius: 9999px;
|
|
background: var(--surface-bg);
|
|
color: var(--text-secondary);
|
|
font-family: inherit;
|
|
font-size: 0.875rem;
|
|
cursor: pointer;
|
|
transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
|
|
user-select: none;
|
|
}
|
|
|
|
.dock-btn:hover:not(:disabled) {
|
|
background: var(--sidebar-hover);
|
|
color: var(--text-primary);
|
|
transform: scale(1.04);
|
|
}
|
|
|
|
.dock-btn:active:not(:disabled) {
|
|
transform: scale(0.96);
|
|
}
|
|
|
|
.dock-btn:disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.dock-btn:focus-visible {
|
|
outline: 2px solid var(--color-primary);
|
|
outline-offset: 2px;
|
|
}
|
|
|
|
.dock-btn.is-active {
|
|
background: rgba(239, 68, 68, 0.1);
|
|
border-color: rgba(239, 68, 68, 0.5);
|
|
color: #dc2626;
|
|
}
|
|
|
|
.dock-btn.is-end {
|
|
background: #ef4444;
|
|
border-color: #ef4444;
|
|
color: #ffffff;
|
|
}
|
|
|
|
.dock-btn.is-end:hover:not(:disabled) {
|
|
background: #dc2626;
|
|
border-color: #dc2626;
|
|
color: #ffffff;
|
|
}
|
|
|
|
/* ---------- Retryable server error (second row inside the bar) ---------- */
|
|
.dock-error {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
margin: 0 0.75rem 0.5rem;
|
|
padding: 0.375rem 0.625rem;
|
|
border: 1px solid rgba(239, 68, 68, 0.45);
|
|
border-radius: 0.75rem;
|
|
color: #dc2626;
|
|
font-size: 0.8125rem;
|
|
line-height: 1.6;
|
|
}
|
|
|
|
.dock-error span {
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
.dock-error-close {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 24px;
|
|
height: 24px;
|
|
border: none;
|
|
border-radius: 50%;
|
|
background: transparent;
|
|
color: inherit;
|
|
cursor: pointer;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.dock-error-close:focus-visible {
|
|
outline: 2px solid var(--color-primary);
|
|
outline-offset: 1px;
|
|
}
|
|
|
|
@keyframes dockIn {
|
|
from {
|
|
opacity: 0;
|
|
transform: translateY(10px);
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
transform: translateY(0);
|
|
}
|
|
}
|
|
|
|
.sr-only {
|
|
position: absolute;
|
|
width: 1px;
|
|
height: 1px;
|
|
padding: 0;
|
|
margin: -1px;
|
|
overflow: hidden;
|
|
clip: rect(0, 0, 0, 0);
|
|
white-space: nowrap;
|
|
border: 0;
|
|
}
|
|
|
|
@media (prefers-reduced-motion: reduce) {
|
|
:host,
|
|
.status-dot,
|
|
.orb-fallback,
|
|
.dock-btn {
|
|
animation: none !important;
|
|
transition: none !important;
|
|
}
|
|
}
|
|
|
|
@media (max-width: 640px) {
|
|
.dock-row {
|
|
gap: 0.5rem;
|
|
padding: 0.375rem 0.625rem;
|
|
}
|
|
|
|
.orb-container {
|
|
width: 84px;
|
|
height: 84px;
|
|
margin-block: -16px;
|
|
margin-inline: -12px;
|
|
}
|
|
|
|
.dock-btn-label {
|
|
display: none;
|
|
}
|
|
|
|
.dock-btn.is-end {
|
|
padding: 0;
|
|
width: 40px;
|
|
}
|
|
} |