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

Fix circular view being rendered as a blank area if tab is opened in the background #3415

Merged
merged 4 commits into from
Dec 17, 2022

Conversation

cmdcolin
Copy link
Collaborator

Fixes #2921

Basically the initial load gets out of whack because the width is 0 (https://github.com/GMOD/jbrowse-components/compare/width_initialized_circular?expand=1#diff-73c3047508be77cca92bdbd3a5c691bd72be00e1cc3ebba7001c9cb1315d4070L107) in this case #2921

This code is similar to what the linear genome view does, it makes sure that setWidth has been called before trying to perform any operations. Possibly just making it non-zero can help, but i believe it's best to start loading after the browser has told us what space it has to render (this especially helps with linear genome view to avoid false-starts for data fetching)

@github-actions github-actions bot added the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label Dec 17, 2022
@cmdcolin cmdcolin added bug Something isn't working and removed needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) labels Dec 17, 2022
@cmdcolin cmdcolin changed the title Check for width being initialized before doing any circular view operations Fix circular view being rendered as a blank area if tab is opened in the background Dec 17, 2022
@codecov
Copy link

codecov bot commented Dec 17, 2022

Codecov Report

Merging #3415 (a46c9a1) into main (cc6a0eb) will decrease coverage by 0.00%.
The diff coverage is 70.53%.

@@            Coverage Diff             @@
##             main    #3415      +/-   ##
==========================================
- Coverage   61.23%   61.23%   -0.01%     
==========================================
  Files         816      817       +1     
  Lines       29520    29526       +6     
  Branches     7109     7111       +2     
==========================================
+ Hits        18077    18079       +2     
- Misses      11270    11275       +5     
+ Partials      173      172       -1     
Impacted Files Coverage Δ
...rc/LinearSNPCoverageDisplay/components/Tooltip.tsx 35.71% <5.26%> (ø)
...gle/src/LinearWiggleDisplay/components/Tooltip.tsx 35.71% <30.76%> (ø)
...cular-view/src/CircularView/models/CircularView.ts 77.34% <76.70%> (+2.48%) ⬆️
...ular-view/src/CircularView/components/Controls.tsx 83.33% <83.33%> (ø)
...ar-view/src/CircularView/components/ImportForm.tsx 75.00% <83.33%> (+1.08%) ⬆️
...-view/src/CircularView/components/CircularView.tsx 100.00% <100.00%> (+10.25%) ⬆️
...ircular-view/src/CircularView/components/Ruler.tsx 66.12% <0.00%> (-22.59%) ⬇️
...-genome-view/src/createModel/createSessionModel.ts 11.48% <0.00%> (+1.35%) ⬆️
...r-genome-view/src/createModel/createConfigModel.ts 77.77% <0.00%> (+22.22%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@cmdcolin cmdcolin merged commit 029e42a into main Dec 17, 2022
@cmdcolin cmdcolin deleted the width_initialized_circular branch December 17, 2022 22:56
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.

Opening a new tab while the circular view is loading produces empty panel
1 participant