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 the viewport calculations for when URL params includes &tracklist=true #4250

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

cmdcolin
Copy link
Collaborator

@cmdcolin cmdcolin commented Feb 29, 2024

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

Copy link

codecov bot commented Feb 29, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 62.69%. Comparing base (1d82797) to head (e487bd7).

Files Patch % Lines
...ar-genome-view/src/LaunchLinearGenomeView/index.ts 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4250      +/-   ##
==========================================
+ Coverage   62.63%   62.69%   +0.05%     
==========================================
  Files        1086     1086              
  Lines       31397    31397              
  Branches     7504     7504              
==========================================
+ Hits        19667    19685      +18     
+ Misses      11556    11537      -19     
- Partials      174      175       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cmdcolin
Copy link
Collaborator Author

this PR actually additionally "fixes" the issue where missing track IDs in the &tracks= param caused the &tracklist=true to stop working, because tracks are loaded as a last step, so any error from loading them does not affect e.g. previous steps

@cmdcolin cmdcolin merged commit fbe8e91 into main Feb 29, 2024
10 checks passed
@cmdcolin cmdcolin deleted the order_of_operations branch February 29, 2024 22:40
cmdcolin added a commit that referenced this pull request Mar 3, 2024
…=true (#4250)

Order of operations for launching view
@cmdcolin cmdcolin added the bug Something isn't working label Mar 5, 2024
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.

"conflict" between url parameters 'loc' and 'tracklist'
1 participant