Conversation actions don't consistently move from the headerbar to the actionbar
I found that issue on mainline, in some 40.alpha commit.
When shrinking the window quickly, it's possible for buttons in the headerbar to not be moved to the actionbar, making the UI inconsistent and preventing it from properly working on phones.
This is because the buttons are moved depending on the headerbar allocated size, and because the headerbar's size request changes based on the buttons it contains, creating an interdependency. As a general rule, to implement adaptiveness you never want to check size alocations and you never want to move widgets around of change their visibility. Here, we do both, causing these issues.
I suggest having two sets of buttons, one set in the headerbar and one set in the actionbar. The buttons in the headerbar would be wrapped in a HdySqueezer
and have an empty box for sibbling. When the window is narrow, the squeezer would show the empty box instead of the buttons, you could monitor its visible_child
property to reveal the action bar when the empty box is visible, and to conceal it otherwise. No widget would move around and the headerbar's width request would never change, solving the issue.
I noticed how these action buttons are implemented and moved around is fairly convoluted, so that would have to be simplified drastically in order to fix that issue.