Recalculate sidebar position when annotator styles load#7309
Merged
robertknight merged 1 commit intomainfrom Sep 16, 2025
Merged
Recalculate sidebar position when annotator styles load#7309robertknight merged 1 commit intomainfrom
robertknight merged 1 commit intomainfrom
Conversation
If the annotator.css bundle loads after the sidebar is opened, the `margin-left` property on the `.sidebar-container` element can be set incorrectly. Fix this problem by invoking `Sidebar._onResize` when styles finish loading. This is the same way we handle "resize" events on the window. Part of #7307.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7309 +/- ##
=======================================
Coverage 99.47% 99.47%
=======================================
Files 271 271
Lines 10949 10954 +5
Branches 2616 2616
=======================================
+ Hits 10891 10896 +5
Misses 58 58 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
acelaya
approved these changes
Sep 16, 2025
This was referenced Sep 16, 2025
This file contains hidden or 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
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.
If the annotator.css bundle loads after the sidebar is opened, the
margin-leftproperty on the.sidebar-containerelement can be set incorrectly. Fix this problem by invokingSidebar._onResizewhen styles finish loading. This is the same way we handle "resize" events on the window.Part of #7307.
Testing:
The minimum timeout delay needed to trigger the problem varies. Locally I need it to be at least 100.
On
main, the sidebar ends up positioned on the left side. On this branch it will initially appear there, but then update its position once styles loading.There is further improvement needed here, as ideally we want to prevent the sidebar from being displayed until styles have loaded. That will need more refactoring, and I think it is valuable to get this partial fix out first.