Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent listing/favourite icon jitter #21

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

krassowski
Copy link
Contributor

References

Fixes #20

Code changes

  • attach the icon before the crumbs <div> rather than within it, so that it is never removed; instead position it with CSS; this eliminates the need for mutation observer and throttling
  • improve performance of hasFavorite and isVisible 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

User-facing changes

There is no jitter when changing folders

Before After
before after

The favourites icon stays in top right corner on resize

Before After
b a

There is now a hover indicator

Before After
hb ha

- 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`
@krassowski krassowski added the bug Something isn't working label Nov 10, 2023
Copy link

Binder 👈 Launch a Binder on branch krassowski/jupyterlab-favorites/prevent-icon-jitter

Copy link
Member

@fcollonval fcollonval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @krassowski

@fcollonval fcollonval merged commit a727e49 into jupyterlab-contrib:main Nov 13, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Jitter in the file browser when refreshed
2 participants