-
Notifications
You must be signed in to change notification settings - Fork 60
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 labels being cut-off in SVG features by rendering feature labels on main thread #3088
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
the
needs label triage
Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal)
label
Jul 12, 2022
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
Jul 12, 2022
cmdcolin
changed the title
Render feature labels only on main thread for SVG features to fix labels being cut-off
Fix labels being cut-off in SVG features by rendering feature labels on main thread
Jul 12, 2022
cmdcolin
force-pushed
the
lazy_feature_labels
branch
from
July 12, 2022 20:32
a70090d
to
bfd3309
Compare
Codecov Report
@@ Coverage Diff @@
## main #3088 +/- ##
==========================================
- Coverage 61.41% 61.39% -0.03%
==========================================
Files 595 595
Lines 27216 27221 +5
Branches 6563 6566 +3
==========================================
- Hits 16715 16712 -3
- Misses 10204 10212 +8
Partials 297 297
Continue to review full report at Codecov.
|
Sounds good
…On Tue, Jul 12, 2022 at 1:19 PM Colin Diesh ***@***.***> wrote:
Currently, there can be a mismatch between the server and the client when
hydrating feature labels since they are floated to the right position on
the client side, and this can result in the labels being cut off sometimes
The server tries to float the feature labels in the right place, but a
mismatch can still occur because if the user scrolls for example during the
time the request is sent to when it is hydrated, it can mismatch.
To help with this, this PR proposes using a useEffect to render the
feature only on the main thread (e.g. the useEffect would only be used once
hydrated)
There is a caveat for exportSVG which does use the server side to render
the features
------------------------------
You can view, comment on, or merge this pull request online at:
#3088
Commit Summary
- 980cace
<980cace>
Lazy feature labels
File Changes
(1 file <https://github.com/GMOD/jbrowse-components/pull/3088/files>)
- *M* plugins/svg/src/SvgFeatureRenderer/components/FeatureLabel.tsx
<https://github.com/GMOD/jbrowse-components/pull/3088/files#diff-08bfa0f90b3374230786c45d77602d1c02f413ecda8b604011400d057a681596>
(13)
Patch Links:
- https://github.com/GMOD/jbrowse-components/pull/3088.patch
- https://github.com/GMOD/jbrowse-components/pull/3088.diff
—
Reply to this email directly, view it on GitHub
<#3088>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAASAFLVQNOR44IQFQGAAMDVTXHKBANCNFSM53MHVN4A>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
this was shipped already :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Currently, there can be a mismatch between the server and the client when hydrating feature labels since they are floated to the right position on the client side, and this can result in the labels being cut off sometimes
The server tries to float the feature labels in the right place, but a mismatch can still occur because if the user scrolls for example during the time the request is sent to when it is hydrated, it can mismatch.
To help with this, this PR proposes using a useEffect to render the feature only on the main thread (e.g. the useEffect would only be used once hydrated)
There is a caveat for exportSVG which does use the server side to render the features labels in the requested position, there is no main thread "hydration" of the ssr component from the svg export so the useEffect would not be useful in that case