From 85819bcb2504c41245571f6084ef0af69a951a7f Mon Sep 17 00:00:00 2001 From: Soroush Yousefpour Date: Tue, 5 May 2026 21:30:00 +0200 Subject: [PATCH] Reserve titlebar space for right-side window controls --- app/src/workspace/view.rs | 14 +++++--------- app/src/workspace/view_test.rs | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/app/src/workspace/view.rs b/app/src/workspace/view.rs index 0da5630c4..5df6d80c3 100644 --- a/app/src/workspace/view.rs +++ b/app/src/workspace/view.rs @@ -17528,15 +17528,7 @@ impl Workspace { let zoom_factor = WindowSettings::as_ref(ctx).zoom_level.as_zoom_factor(); let traffic_light_data = traffic_light_data(ctx, self.window_id); if let Some(traffic_light_data) = traffic_light_data.as_ref() { - let vertical_tabs_active = FeatureFlag::VerticalTabs.is_enabled() - && *TabSettings::as_ref(ctx).use_vertical_tabs; - let right_panel_open = self.current_workspace_state.is_right_panel_open(); - let should_reserve_right_traffic_light_space = - vertical_tabs_active || !right_panel_open; - - if traffic_light_data.side == TrafficLightSide::Right - && should_reserve_right_traffic_light_space - { + if should_reserve_traffic_light_space_in_tab_bar(traffic_light_data.side) { target.add_child( ConstrainedBox::new(Empty::new().finish()) .with_width(traffic_light_data.width(zoom_factor)) @@ -23887,6 +23879,10 @@ impl Workspace { } } +fn should_reserve_traffic_light_space_in_tab_bar(side: TrafficLightSide) -> bool { + side == TrafficLightSide::Right +} + /// Returns every tab-bar-equivalent rect laid out in `window_id` (horizontal /// tab bar and/or vertical tabs panel). Both must be considered because a /// window with vertical tabs still renders the horizontal bar at the top. diff --git a/app/src/workspace/view_test.rs b/app/src/workspace/view_test.rs index 0349a73ff..c9bf08750 100644 --- a/app/src/workspace/view_test.rs +++ b/app/src/workspace/view_test.rs @@ -78,6 +78,20 @@ use ai::index::full_source_code_embedding::manager::CodebaseIndexManager; use ai::project_context::model::ProjectContextModel; use pane_group::{NotebookPane, PaneState, SplitPaneState, TerminalPaneId}; use session_sharing_protocol::common::SessionId; + +#[test] +fn tab_bar_reserves_space_for_right_side_traffic_lights() { + assert!(should_reserve_traffic_light_space_in_tab_bar( + TrafficLightSide::Right + )); +} + +#[test] +fn tab_bar_does_not_reserve_space_for_left_side_traffic_lights() { + assert!(!should_reserve_traffic_light_space_in_tab_bar( + TrafficLightSide::Left + )); +} use terminal::shared_session::permissions_manager::SessionPermissionsManager; use terminal::view::ActiveSessionState; use warp_editor::editor::NavigationKey;