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 split view splitters being offset by sidebar #4088

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

vintydong
Copy link

@vintydong vintydong commented Dec 31, 2024

Fixes #2761

Splitters were calculated using the entire split view overlay which results in an incorrect inset % when a sidebar is present.

Recording.2024-12-30.203029.mp4

A padding-left or padding-right (depending on sidebar position) equal to the sidebar width is added to the overlay for the inset % to be correct. This padding is recalculated under the following actions

  • Sidebar resize
  • Sidebar opening/closing
  • Sidebar reverse position (left/right)
splitview.mp4

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. Bug labels Dec 31, 2024
+ if (this._sidebarResizeObserver) {
+ this._sidebarResizeObserver.disconnect();
+ }
+ this._sidebarResizeObserver = new ResizeObserver(async () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think we should add an observer, I believe there are better ways...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found an easier solution by simply moving the splitview-overlay and wrapper into the tabbrowser so the inset % will be correct based on the tabpanels width.

I think it makes more sense for splitview overlay to be nested within the tabpanel so its always the correct size vs. doing extra calculations. I also removed the xhtml file since it seemed to be the occurrence

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Dec 31, 2024
@mauro-balades mauro-balades self-requested a review January 1, 2025 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Split view can't be resized vertically when bookmarks sidebar is open
2 participants