fix(webui): synchronize neutral Ring sidebar activity indicators (#6371)
* fix(webui): synchronize neutral Trace sidebar activity indicators * fix(webui): use the requested Ring activity indicator * fix(webui): synchronize running rings before their first frame
This commit is contained in:
1 parent
fbb61a373f
commit
29d1600837
7 files changed
+171
-3
No files matched your search
@@ -1884,6 +1884,12 @@ function ChatsFoldFooter({
|
||||
);
|
||||
}
|
||||
|
||||
function synchronizeRunningRing(element: SVGCircleElement | null) {
|
||||
if (!element) return;
|
||||
// Align pending animations before their first frame, not only after animationstart.
|
||||
for (const animation of element.getAnimations()) animation.startTime = 0;
|
||||
}
|
||||
|
||||
function SessionActivityIndicator({
|
||||
state,
|
||||
}: {
|
||||
@@ -1917,7 +1923,18 @@ function SessionActivityIndicator({
|
||||
aria-label={label}
|
||||
className="grid h-4 w-4 shrink-0 place-items-center"
|
||||
>
|
||||
<span className="h-3 w-3 animate-spin rounded-full border border-blue-500/25 border-t-blue-500 [animation-duration:1.4s] motion-reduce:animate-none dark:border-blue-400/25 dark:border-t-blue-400" />
|
||||
<svg
|
||||
className="h-3 w-3 text-sidebar-muted-foreground"
|
||||
viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" aria-hidden="true"
|
||||
>
|
||||
<circle cx="12" cy="12" r="10" opacity="0.2" />
|
||||
<circle
|
||||
cx="12" cy="12" r="10" strokeDasharray="16 46.8" strokeLinecap="round"
|
||||
className="sidebar-running-ring"
|
||||
ref={synchronizeRunningRing}
|
||||
onAnimationStart={(event) => synchronizeRunningRing(event.currentTarget)}
|
||||
/>
|
||||
</svg>
|
||||
</span>
|
||||
</HoverHint>
|
||||
);
|
||||
|
||||
@@ -1092,6 +1092,20 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* loading.dev Ring, Copyright (c) 2026 Jakub Krehel (MIT); THIRD_PARTY_NOTICES.md. */
|
||||
.sidebar-running-ring {
|
||||
transform-origin: center;
|
||||
animation: sidebar-running-ring 800ms linear infinite;
|
||||
}
|
||||
@keyframes sidebar-running-ring {
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.sidebar-running-ring {
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (pointer: coarse) {
|
||||
/* Readable form text avoids Safari's focus zoom without disabling the user's
|
||||
pinch zoom. Keep this after utilities so compact desktop overrides cannot
|
||||
|
||||
@@ -12,6 +12,10 @@ if (!HTMLElement.prototype.hasPointerCapture) {
|
||||
if (!HTMLElement.prototype.scrollIntoView) {
|
||||
HTMLElement.prototype.scrollIntoView = () => {};
|
||||
}
|
||||
// happy-dom has no animation timeline; rendered motion is covered in browser tests.
|
||||
if (!Element.prototype.getAnimations) {
|
||||
Element.prototype.getAnimations = () => [];
|
||||
}
|
||||
|
||||
// happy-dom does not load fonts; text measurements can run immediately.
|
||||
Object.defineProperty(document, "fonts", {
|
||||
|
||||
Reference in new issue
Block a user