Fix the viewport calculations for when URL params includes &tracklist=true #4250
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
can compare the viewport when visiting these links
https://jbrowse.org/code/jb2/order_of_operations/?loc=BRCA1&assembly=hg19&tracklist=true
https://jbrowse.org/code/jb2/main/?loc=BRCA1&assembly=hg19&tracklist=true
this PR branch includes the gene full width in the view
the main branch has the gene partially hidden
i'm not sure if this is 100% reliable as this code doesn't "wait for the viewport width to include that tracklist" but it could help
the source of this problem is that the state of the view is driven primarily by a combination of variables (bpPerPx and offsetPx and displayedRegions) instead of the desired loc string
This has some odd consequences including the fact that a share link from a screen that is e.g. 800px does not get stretched when shared with a screen that has width 3000px, the 3000px actually views extra data if it loads that share link. This similarly is the case here where the tracklist is subtly changing the width of the viewport, and it isn't stretching the content of the view, it just 'hides it'
fixes #4249