Fix tab bar button's focus handling lagging behind

Thorsten Ball created

This fixes https://github.com/zed-industries/community/issues/2442 for
me.

Previously, the tab bar buttons would stay when the chat panel was
opened (and received focus) until something else was drawn (or caused a
render?)

With this change, the tab bar buttons are only shown if the pane was
focus.

I'm not sure about the side-effects of this, but the toolbar still seems
to work fine.

Change summary

crates/workspace/src/pane.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Detailed changes

crates/workspace/src/pane.rs 🔗

@@ -1470,7 +1470,7 @@ impl Pane {
                         ),
                 )
             })
-            .when(self.was_focused || self.has_focus(cx), |tab_bar| {
+            .when(self.has_focus(cx), |tab_bar| {
                 tab_bar.end_child({
                     let render_tab_buttons = self.render_tab_bar_buttons.clone();
                     render_tab_buttons(self, cx)