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

Improve schema viewer user experience #2816

Merged
merged 11 commits into from
Jan 20, 2023
Merged

Improve schema viewer user experience #2816

merged 11 commits into from
Jan 20, 2023

Conversation

CarolineDenis
Copy link
Contributor

Fixes #1831

@CarolineDenis CarolineDenis requested review from maxpatiiuk and a team January 13, 2023 20:14
@melton-jason
Copy link
Contributor

melton-jason commented Jan 13, 2023

Is #2080 and/or #2815 within the scope of this Pull Request, or will they be added at a later date?

Copy link
Contributor

@melton-jason melton-jason left a comment

Choose a reason for hiding this comment

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

Looks great, and supports using Find (CTRL + F) to quickly go to any field in the database!

schemaViewer

While not important, would it also be possible to include a button above the Accession Table button in the sidebar to redirect to the user to the very top of the Schema Viewer? Currently the quickest way to back to the list of every table when you are anywhere else on the page is to click on Accession and then scroll up.

@maxpatiiuk maxpatiiuk linked an issue Jan 13, 2023 that may be closed by this pull request
Copy link
Member

@grantfitzsimmons grantfitzsimmons left a comment

Choose a reason for hiding this comment

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

Nice work!

@melton-jason, a jump to the start button would be nice but how often will that be necessary?

@melton-jason
Copy link
Contributor

Nice work!

@melton-jason, a jump to the start button would be nice but how often will that be necessary?

Not that necessary. Not necessary enough to keep this from production.

@grantfitzsimmons
Copy link
Member

Screen.Recording.2023-01-15.at.5.51.17.PM.mov

Unfortunately the first item I select after loading into the schema viewer is not properly highlighted.

Copy link
Member

@grantfitzsimmons grantfitzsimmons left a comment

Choose a reason for hiding this comment

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

Unfortunately the first item I select after loading into the schema viewer is not properly highlighted.

@maxpatiiuk
Copy link
Member

Unfortunately the first item I select after loading into the schema viewer is not properly highlighted.

Can you elaborate on what you mean by this / provide a video?

It works for me, albeit very laggy:

Screen.Recording.2023-01-16.at.08.31.21.mov

@maxpatiiuk
Copy link
Member

Running a profiler shows that the performance issue is caused just by the sheer number of elements on the page, rather than by react:

Screenshot 2023-01-16 at 08 43 21

Thus, the only way to reduce this is to not render as many elements on the page. Solutions:

  1. Allow temporary hiding hidden tables from the list
  2. Add an alternative view that only displays several tables at once
  3. Most satisfactory and most complicated: use a virtual rendering library that only actually renders a subset of the list on the screen. This would also require us to provide custom search functionality as Ctrl+F doesn't work when elements are not rendered on the screen.
  4. Don't do anything and just accept the bad performance

@grantfitzsimmons
Copy link
Member

Can you elaborate on what you mean by this / provide a video?

#2816 (comment)

@maxpatiiuk
Copy link
Member

Can you elaborate on what you mean by this / provide a video?

#2816 (comment)

Sorry! I missed it

@grantfitzsimmons
Copy link
Member

When I’m on a data entry form, Specify uses ~500-600MB of memory – the schema viewer takes 1GB and clicking on a button spikes to using 25-35% of my CPU

The schema print-out uses 100MB of memory and 0.6% of my CPU when I jump to a table

@maxpatiiuk
Copy link
Member

maxpatiiuk commented Jan 16, 2023

yeah, it displays 41,000 cells so that's about what I would expect

the printout page is static and does not use react (in the schema viewer there is a react component for each cell, and they all take memory)

See #2816 (comment) for potential solutions

This fix also properly creates a new line for every field rather than leaving the array in a cell
Copy link
Member

@grantfitzsimmons grantfitzsimmons left a comment

Choose a reason for hiding this comment

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

It is up to the team to decide if we should implement a new solution to make this work without consuming a lot of memory. I would argue that it is not often used or referenced, making it a low priority to optimize.

@maxpatiiuk
Copy link
Member

Let's push this as is before it gets too big.
#1831 mentions 3 more improvements (which are smaller) and can be implemented in the future.

@maxpatiiuk maxpatiiuk merged commit d63318b into production Jan 20, 2023
@maxpatiiuk maxpatiiuk deleted the issue-1831 branch January 20, 2023 05:04
Copy link
Member

@maxpatiiuk maxpatiiuk left a comment

Choose a reason for hiding this comment

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

👍

Edit: didn't know GitHub allows leaving reviews on merged pull requests. Neat!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adapt schema viewer layout for printing and Ctrl+F
4 participants