Skip to content

Fix splitter bad position when sidebar open#13511

Open
willrossignol wants to merge 1 commit into
zen-browser:devfrom
willrossignol:fix-splitview-with-sidebar
Open

Fix splitter bad position when sidebar open#13511
willrossignol wants to merge 1 commit into
zen-browser:devfrom
willrossignol:fix-splitview-with-sidebar

Conversation

@willrossignol
Copy link
Copy Markdown

@willrossignol willrossignol commented Apr 30, 2026

  • Move zen-splitview-overlay.inc.xhtml into tabpanels element to handle correct drag-and-drop logic when sidebar is open
  • Insert zen-split-view-splitter directly into tabpanels element for correct placement when sidebar is open
  • Adjust inset calculation for zen-split-view-splitter to center in tabpanels element
  • Add translateX: calc(-50%) to ::before styles in order to properly center splitter
image

@willrossignol
Copy link
Copy Markdown
Author

Fix for #11626

@sporocyst
Copy link
Copy Markdown
Contributor

Looking forward to see this finalized. And, be sure to test the conditon when sidebar is open on the right

@willrossignol
Copy link
Copy Markdown
Author

Looking forward to see this finalized. And, be sure to test the conditon when sidebar is open on the right

Can confirm the fixes work when the sidebar is open on the right. Thanks for the heads up!

image

@willrossignol willrossignol force-pushed the fix-splitview-with-sidebar branch from a3f8979 to 31e6108 Compare April 30, 2026 21:39
@willrossignol
Copy link
Copy Markdown
Author

Splitter is properly centered after updates to ::before styling

image

@willrossignol willrossignol marked this pull request as ready for review April 30, 2026 21:41
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. Improvement labels Apr 30, 2026
- <tabpanels id="tabbrowser-tabpanels" flex="1" selectedIndex="0"/>
+#include zen-tabbrowser-elements.inc.xhtml
<tabpanels id="tabbrowser-tabpanels" flex="1" selectedIndex="0"/>
+ <tabpanels id="tabbrowser-tabpanels" flex="1" selectedIndex="0">
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Pretty sure selectedIndex is used to fetch childs within the tab panel. Adding elements inside might mess that up

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I looked into this a bit. Every tab keeps track of the index of its panel in the tabpanels element, so the index of the panels is adjusted to be +1 because of the overlay wrapper being inserted first into the tabpanels element. For the splitter, it is always appended to the list of children of tabpanels, so this also doesn't affect the indices of the panels in tabpanels.

I've been testing around creating new tabs, removing tabs, joining and splitting tabs, and using glance, and I haven't encountered any issues.

I can look into another solution though if you're not happy with this!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The logic that I was looking at is in toolkit/content/widgets/tabbox.js

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

But... even Firefox itself puts splitter into tab panel! It is probably not really a no-no.

Image

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

True, just not really comfortable with messing around firefox's internals. I guess it could be fine for now

Copy link
Copy Markdown
Member

@mr-cheffy mr-cheffy left a comment

Choose a reason for hiding this comment

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

Could you please run npm run lint:fix?

@willrossignol willrossignol force-pushed the fix-splitview-with-sidebar branch from 53ab0d9 to e8b91eb Compare May 6, 2026 12:12
@willrossignol
Copy link
Copy Markdown
Author

Could you please run npm run lint:fix?

Done. Corrected some linting errors in ZenViewSplitter.mjs

@mr-cheffy mr-cheffy self-requested a review May 6, 2026 14:30
@mr-cheffy
Copy link
Copy Markdown
Member

Does drag and dropping split views from the top handle work for you? It doesnt show me the preview

@willrossignol
Copy link
Copy Markdown
Author

Does drag and dropping split views from the top handle work for you? It doesnt show me the preview

Yeah it works but you're right that it doesn't show the preview. I'll look into this

@willrossignol willrossignol force-pushed the fix-splitview-with-sidebar branch from fa13cdc to e20029a Compare May 6, 2026 19:54
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels May 6, 2026
@willrossignol willrossignol force-pushed the fix-splitview-with-sidebar branch from e20029a to 8b37aec Compare May 6, 2026 20:01
@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 May 6, 2026
@willrossignol willrossignol force-pushed the fix-splitview-with-sidebar branch from 8b37aec to f497072 Compare May 6, 2026 20:04
@willrossignol willrossignol force-pushed the fix-splitview-with-sidebar branch from f497072 to 43652b9 Compare May 6, 2026 20:11
Comment on lines +119 to +120
-moz-subtree-hidden-only-visually: 0;
z-index: 2;
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Added these changes to ensure contents of zen-splitview-overlay is shown above the tabs. This fixes not seeing the zen-splitview-dropzone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Improvement size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants