mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-21 23:40:44 -07:00
Fix: Animated scrollbar renders black in NO_COLOR mode (#13188)
This commit is contained in:
@@ -49,11 +49,15 @@ export function useAnimatedScrollbar(
|
||||
const unfocusedColor = theme.ui.dark;
|
||||
const startColor = colorRef.current;
|
||||
|
||||
if (!focusedColor || !unfocusedColor) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Phase 1: Fade In
|
||||
let start = Date.now();
|
||||
const animateFadeIn = () => {
|
||||
const elapsed = Date.now() - start;
|
||||
const progress = Math.min(elapsed / fadeInDuration, 1);
|
||||
const progress = Math.max(0, Math.min(elapsed / fadeInDuration, 1));
|
||||
|
||||
setScrollbarColor(interpolateColor(startColor, focusedColor, progress));
|
||||
|
||||
@@ -69,7 +73,10 @@ export function useAnimatedScrollbar(
|
||||
start = Date.now();
|
||||
const animateFadeOut = () => {
|
||||
const elapsed = Date.now() - start;
|
||||
const progress = Math.min(elapsed / fadeOutDuration, 1);
|
||||
const progress = Math.max(
|
||||
0,
|
||||
Math.min(elapsed / fadeOutDuration, 1),
|
||||
);
|
||||
setScrollbarColor(
|
||||
interpolateColor(focusedColor, unfocusedColor, progress),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user