Fix pinned tab causing resize loop on adjacent tab#41884
Fix pinned tab causing resize loop on adjacent tab#41884smitbarmase merged 3 commits intozed-industries:mainfrom
Conversation
smitbarmase
left a comment
There was a problem hiding this comment.
I don't think this is the right way to handle this. This code is essential to add border when there are large amount of unpinned tabs and are scrolled.
Since this PR results in something like this:
I'm not able to reproduce this issue, but can you inspect is_scrollable and is_scrolled bool and figure which one of them is flipping on alternate renders?
We might have to go deeper in checking if tab_bar_scroll_handle.offset().x is flipping to 0 every once in a while or is ittab_bar_scroll_handle.max_offset().width.
|
Thank you so much @smitbarmase for guiding me to tackle this issue. Here's my observation from logs When no border: The 0.8px difference is smaller than the border width, so it creates a loop. So I changed the scrollability check from |
smitbarmase
left a comment
There was a problem hiding this comment.
Great, that’s a nice fix! I moved the code back to children since we should only run all these comparisons when necessary. Thanks for working on this.
…dustries#41884) Closes zed-industries#41467 My first PR in Zed, any guidance or tips are appreciated. This fixes the flickering/resize loop that occurred on the tab immediately to the right of a pinned tab. Removed the conditional border on the pinned tabs container. The border was a visual indicator to show when unpinned tabs were scrolled, but it wasn't essential and was causing the layout thrashing. Release Notes: - Fixed --------- Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
Closes #41467
My first PR in Zed, any guidance or tips are appreciated.
This fixes the flickering/resize loop that occurred on the tab immediately to the right of a pinned tab.
Removed the conditional border on the pinned tabs container. The border was a visual indicator to show when unpinned tabs were scrolled, but it wasn't essential and was causing the layout thrashing.
Release Notes: