jbrowse-components
jbrowse-components copied to clipboard
Add zoom to visible sequence level button
This was proposed by @carolinebridge-oicr in https://github.com/GMOD/jbrowse-components/pull/3200#issuecomment-1254056802. It adds a "Zoom in" button to the "Zoom in to see sequence" message that zooms to 1 bpPerPx so that the sequence is visible.
Looks like this:

what is the "user story" for why a user would want to click this button? seems like it would take them to a somewhat arbitrary region, which is a bit odd to me
Codecov Report
Merging #3221 (ff7ffc1) into track_message_updates (ea59fda) will increase coverage by
0.01%. The diff coverage is66.66%.
@@ Coverage Diff @@
## track_message_updates #3221 +/- ##
=========================================================
+ Coverage 59.48% 59.50% +0.01%
=========================================================
Files 671 671
Lines 28735 28736 +1
Branches 6968 6968
=========================================================
+ Hits 17093 17098 +5
+ Misses 11320 11315 -5
- Partials 322 323 +1
| Impacted Files | Coverage Δ | |
|---|---|---|
| ...uence/src/LinearReferenceSequenceDisplay/model.tsx | 59.37% <66.66%> (ø) |
|
| ...play/components/ServerSideRenderedBlockContent.tsx | 90.69% <0.00%> (-4.66%) |
:arrow_down: |
| packages/core/util/layouts/GranularRectLayout.ts | 87.28% <0.00%> (+0.42%) |
:arrow_up: |
| ...FeatureRenderer/components/ProcessedTranscript.tsx | 88.73% <0.00%> (+1.40%) |
:arrow_up: |
| ...gins/svg/src/SvgFeatureRenderer/components/util.ts | 95.91% <0.00%> (+4.08%) |
:arrow_up: |
| ...src/SvgFeatureRenderer/components/FeatureLabel.tsx | 86.11% <0.00%> (+5.55%) |
:arrow_up: |
| ...svg/src/SvgFeatureRenderer/components/Segments.tsx | 92.85% <0.00%> (+7.14%) |
:arrow_up: |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
Is it possible without too many checks to have it zoom into the first immediate bpperpx where data is visible? My thinking with this was more, a user may have no impression of what zoom level they could nav to in order to render their data. If they click this button, it zooms to the highest zoom level where they can see their data, and then from there nav to a region of interest. Sometimes when I get this message I have to click + on the zoom several times, or just guess on the slider and be "too" zoomed in and have to nav out again.
Smoother workflow would be: click zoom in button on message -> click and drag on region to zoom to region
This PR only applies to the sequence display, and 1 bpPerPx is the first level where the sequence is visible, so there's no need to do any checks. Other displays would probably be more difficult to determine the zoom level.
I think I see @cmdcolin's point, though. 1 bpPerPx is pretty close, so it would be easy to lose your place when you click and end up zooming in that far.
might close for now...if theres interest can reopen