@@ -1274,11 +1274,36 @@ create_runnable!(
12741274 log:: debug!( "Muxbox bounds: left={}, right={}, top={}, border={}" ,
12751275 muxbox_bounds. left( ) , muxbox_bounds. right( ) , muxbox_bounds. top( ) , has_border) ;
12761276
1277- if let Some ( clicked_tab_index) = crate :: draw_utils:: calculate_tab_click_index(
1277+ // Check for navigation arrow clicks first
1278+ if let Some ( nav_action) = crate :: draw_utils:: calculate_tab_navigation_click(
1279+ * x as usize ,
1280+ muxbox_bounds. left( ) ,
1281+ muxbox_bounds. right( ) ,
1282+ & tab_labels,
1283+ clicked_muxbox. tab_scroll_offset,
1284+ has_border
1285+ ) {
1286+ log:: info!( "Tab navigation clicked: muxbox {} action {:?}" , clicked_muxbox. id, nav_action) ;
1287+ if let Some ( muxbox) = app_context_for_click. app. get_muxbox_by_id_mut( & clicked_muxbox. id) {
1288+ match nav_action {
1289+ crate :: draw_utils:: TabNavigationAction :: ScrollLeft => {
1290+ muxbox. scroll_tabs_left( ) ;
1291+ log:: info!( "Scrolled tabs left for muxbox '{}', new offset: {}" , muxbox. id, muxbox. tab_scroll_offset) ;
1292+ } ,
1293+ crate :: draw_utils:: TabNavigationAction :: ScrollRight => {
1294+ muxbox. scroll_tabs_right( ) ;
1295+ log:: info!( "Scrolled tabs right for muxbox '{}', new offset: {}" , muxbox. id, muxbox. tab_scroll_offset) ;
1296+ } ,
1297+ }
1298+ inner. update_app_context( app_context_for_click. clone( ) ) ;
1299+ }
1300+ handled_tab_click = true ;
1301+ } else if let Some ( clicked_tab_index) = crate :: draw_utils:: calculate_tab_click_index(
12781302 * x as usize ,
12791303 muxbox_bounds. left( ) ,
12801304 muxbox_bounds. right( ) ,
12811305 & tab_labels,
1306+ clicked_muxbox. tab_scroll_offset,
12821307 has_border
12831308 ) {
12841309 log:: info!( "Tab click detected: muxbox {} tab {} ({})" ,
@@ -1475,6 +1500,7 @@ create_runnable!(
14751500 muxbox_bounds. left( ) ,
14761501 muxbox_bounds. right( ) ,
14771502 & tab_labels,
1503+ muxbox. tab_scroll_offset,
14781504 muxbox. calc_border( & app_context_unwrapped. clone( ) , & app_graph)
14791505 ) {
14801506 log:: trace!( "Drag started on tab area for muxbox {} - skipping move operation" , muxbox. id) ;
@@ -2101,6 +2127,28 @@ create_runnable!(
21012127 log:: error!( "SwitchTab message for non-existent muxbox: {}" , muxbox_id) ;
21022128 }
21032129 }
2130+ Message :: ScrollTabsLeft ( muxbox_id) => {
2131+ log:: debug!( "Processing ScrollTabsLeft message: muxbox={}" , muxbox_id) ;
2132+ if let Some ( muxbox) = app_context_unwrapped. app. get_muxbox_by_id_mut( muxbox_id) {
2133+ muxbox. scroll_tabs_left( ) ;
2134+ log:: info!( "Scrolled tabs left for muxbox '{}', new offset: {}" , muxbox_id, muxbox. tab_scroll_offset) ;
2135+ inner. update_app_context( app_context_unwrapped. clone( ) ) ;
2136+ inner. send_message( Message :: RedrawMuxBox ( muxbox_id. clone( ) ) ) ;
2137+ } else {
2138+ log:: error!( "ScrollTabsLeft message for non-existent muxbox: {}" , muxbox_id) ;
2139+ }
2140+ }
2141+ Message :: ScrollTabsRight ( muxbox_id) => {
2142+ log:: debug!( "Processing ScrollTabsRight message: muxbox={}" , muxbox_id) ;
2143+ if let Some ( muxbox) = app_context_unwrapped. app. get_muxbox_by_id_mut( muxbox_id) {
2144+ muxbox. scroll_tabs_right( ) ;
2145+ log:: info!( "Scrolled tabs right for muxbox '{}', new offset: {}" , muxbox_id, muxbox. tab_scroll_offset) ;
2146+ inner. update_app_context( app_context_unwrapped. clone( ) ) ;
2147+ inner. send_message( Message :: RedrawMuxBox ( muxbox_id. clone( ) ) ) ;
2148+ } else {
2149+ log:: error!( "ScrollTabsRight message for non-existent muxbox: {}" , muxbox_id) ;
2150+ }
2151+ }
21042152 Message :: SwitchToStream ( muxbox_id, stream_id) => {
21052153 if let Some ( muxbox) = app_context_unwrapped. app. get_muxbox_by_id_mut( muxbox_id) {
21062154 if muxbox. switch_to_stream( stream_id) {
0 commit comments