fortrangoingonforty/sniffly / 13f475d

Browse files

auto-switch to new tabs on creation (no auto-scan)

Authored by espadonne
SHA
13f475ddf81de04921cbb51b23f70d3d95d46225
Parents
0a91afe
Tree
7936372

1 changed file

StatusFile+-
M src/gui/tab_widget.f90 12 3
src/gui/tab_widget.f90modified
@@ -194,12 +194,21 @@ contains
194194
 
195195
     print *, "Created new tab ", new_tab_index
196196
 
197
+    ! Switch to the new tab
198
+    call switch_to_tab(new_tab_index)
199
+
197200
     ! Rebuild tab bar to show the new tab
198
-    ! TODO: Implement proper clear_tab_bar to avoid duplicates
199
-    ! For now, just refresh which will add the new tab
200201
     call refresh_tab_bar()
201202
 
202
-    print *, "Tab bar refreshed with new tab"
203
+    ! Update visual states (yellow border on new active tab)
204
+    call update_tab_visual_states()
205
+
206
+    ! Update UI for the new tab (but don't auto-scan empty tabs)
207
+    if (associated(tab_switch_cb)) then
208
+      call tab_switch_cb()
209
+    end if
210
+
211
+    print *, "Tab bar refreshed and switched to new tab ", new_tab_index
203212
   end subroutine on_plus_clicked
204213
 
205214
   ! Callback when a tab button is clicked