From 2a83c47c839d87fb71c6ee8d2216ff48f9affaa1 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Thu, 4 Sep 2025 09:45:18 -0400 Subject: [PATCH] Remove non-functional animations from FilterNavigatorBar. --- src/components/shared/FilterNavigatorBar.css | 58 +------------------ src/components/shared/FilterNavigatorBar.tsx | 54 ++++++----------- .../FilterNavigatorBar.test.tsx.snap | 6 +- 3 files changed, 23 insertions(+), 95 deletions(-) diff --git a/src/components/shared/FilterNavigatorBar.css b/src/components/shared/FilterNavigatorBar.css index 3ecfea1f32..95337adf6d 100644 --- a/src/components/shared/FilterNavigatorBar.css +++ b/src/components/shared/FilterNavigatorBar.css @@ -20,7 +20,9 @@ cursor: default; user-select: none; - /* Note: no overflow: hidden so that we can see the exit animation for ranges */ + /* Note: no overflow: hidden for historical reasons - we wanted to see + an animation for items at the end while they were fading out, but + we have removed this animation in the meantime */ } .filterNavigatorBarItem { @@ -40,9 +42,6 @@ in the forced colors media query. */ forced-color-adjust: none; line-height: 24px; - transition: - opacity 250ms var(--animation-curve), - transform 250ms var(--animation-curve); } .filterNavigatorBarRootItem { @@ -98,23 +97,12 @@ } .filterNavigatorBarItem:not(.filterNavigatorBarLeafItem)::after { - animation: fadeIn 250ms var(--animation-curve); background-image: var(--internal-separator-img); background-position: -18px -12px; background-repeat: no-repeat; background-size: 24px 24px; } -@keyframes fadeIn { - from { - opacity: 0; - } - - to { - opacity: 1; - } -} - .filterNavigatorBarItem:not( .filterNavigatorBarRootItem, .filterNavigatorBarLeafItem @@ -163,46 +151,6 @@ opacity: 0.65; } -/* Animation */ - -.filterNavigatorBarUncommittedTransition-exit { - /* Because of the underlying transition library, this element is still here - * while the new "committed" element is created, which pushes it further - * right. By using display: none here, we prevent this bad effect. */ - display: none; -} - -.filterNavigatorBarTransition-enter { - color: inherit; - - /* We use the same value as the uncommitted item. - * Note that the "uncommitted item" won't have this "enter" class when - * committing, because of how we insert it (it's not part of the same loop). */ - opacity: 0.65; -} - -.filterNavigatorBarTransition-enter.filterNavigatorBarTransition-enter-active { - color: var(--internal-selected-color); - opacity: 1; -} - -.filterNavigatorBarTransition-exit { - opacity: 1; -} - -.filterNavigatorBarTransition-exit.filterNavigatorBarTransition-exit-active { - opacity: 0; - transform: translateX(50%); -} - -/* Do not animate the filter navigator bar items when user prefers reduced motion */ -@media (prefers-reduced-motion) { - .filterNavigatorBarItem { - animation: none; - transition: none; - } -} - @media (forced-colors: active) { .filterNavigatorBar { --internal-background-color: ButtonFace; diff --git a/src/components/shared/FilterNavigatorBar.tsx b/src/components/shared/FilterNavigatorBar.tsx index 5fb371e2a0..12011ef64d 100644 --- a/src/components/shared/FilterNavigatorBar.tsx +++ b/src/components/shared/FilterNavigatorBar.tsx @@ -4,7 +4,6 @@ import * as React from 'react'; import classNames from 'classnames'; -import { CSSTransition, TransitionGroup } from 'react-transition-group'; import './FilterNavigatorBar.css'; type FilterNavigatorBarListItemProps = { @@ -71,31 +70,21 @@ export class FilterNavigatorBar extends React.PureComponent { const { className, items, selectedItem, uncommittedItem, onPop } = this.props; - const transitions = items.map((item, i) => ( - - - {item} - - - )); - - if (uncommittedItem) { - transitions.push( - + return ( +
    + {items.map((item, i) => ( + + {item} + + ))} + {uncommittedItem ? ( { > {uncommittedItem} - - ); - } - - return ( - - {transitions} - + ) : null} +
); } } diff --git a/src/test/components/__snapshots__/FilterNavigatorBar.test.tsx.snap b/src/test/components/__snapshots__/FilterNavigatorBar.test.tsx.snap index 3f55fcf823..b1d6e6c631 100644 --- a/src/test/components/__snapshots__/FilterNavigatorBar.test.tsx.snap +++ b/src/test/components/__snapshots__/FilterNavigatorBar.test.tsx.snap @@ -40,7 +40,7 @@ exports[`app/ProfileFilterNavigator renders ProfileFilterNavigator properly 2`]