From 602c37b40e11cc85c85407074b5cf73a3a7bbd52 Mon Sep 17 00:00:00 2001 From: krassowski <5832902+krassowski@users.noreply.github.com> Date: Fri, 10 Nov 2023 22:53:51 +0000 Subject: [PATCH] Prevent listing/icon jitter: - attach the icon before the crumbs rather than within, so that it is never removed and just position it with CSS; this eliminates the need for mutation observer and throttling - improve performance of `hasFavorite` and `isVisible` checks by skipping sorting of items when querying for visible items - reduce CSS selector complexity for svg icons - remove unnecessary style rules - add class names needed for button hover - mnt: replace deprecated `toArray()` use with `Array.from` --- package.json | 2 -- src/components.tsx | 2 +- src/index.tsx | 27 +++++++++------------------ src/manager.ts | 26 ++++++++++++++------------ style/base.css | 27 ++++++++++++++++++--------- yarn.lock | 6 ++---- 6 files changed, 44 insertions(+), 46 deletions(-) diff --git a/package.json b/package.json index 669821c..29397c7 100644 --- a/package.json +++ b/package.json @@ -77,10 +77,8 @@ "@jupyterlab/services": "^7.0.5", "@jupyterlab/settingregistry": "^4.0.5", "@jupyterlab/ui-components": "^4.0.5", - "@lumino/algorithm": "^2.0.0", "@lumino/commands": "^2.0.1", "@lumino/coreutils": "^2.0.1", - "@lumino/polling": "^2.0.0", "@lumino/signaling": "^2.0.0", "@lumino/widgets": "^2.0.1" }, diff --git a/src/components.tsx b/src/components.tsx index 7155b1c..77b9dfb 100644 --- a/src/components.tsx +++ b/src/components.tsx @@ -133,7 +133,7 @@ export const FavoritesBreadCrumbs: React.FunctionComponent< const icon = getFavoritesIcon(isFavorite); return (