Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions app/src/workspace/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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.
Expand Down
14 changes: 14 additions & 0 deletions app/src/workspace/view_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down