@@ -77,7 +77,7 @@ pub fn create_app_menu(app: &App) -> Result<Menu<tauri::Wry>> {
7777 "Developer" ,
7878 true ,
7979 & [
80- & MenuItem :: with_id ( app, "restart_app" , "Restart App" , true , Some ( "CmdOrCtrl+Shift+R" ) ) ?,
80+ & MenuItem :: with_id ( app, "restart_app" , "Reload App (Dev) " , true , Some ( "CmdOrCtrl+Shift+R" ) ) ?,
8181 & PredefinedMenuItem :: separator ( app) ?,
8282 & MenuItem :: with_id ( app, "reload_all" , "Reload All Windows" , true , Some ( "CmdOrCtrl+Shift+F5" ) ) ?,
8383 ] ,
@@ -98,7 +98,17 @@ pub fn handle_menu_event(app: &AppHandle, event: tauri::menu::MenuEvent) {
9898 "restart_app" => {
9999 #[ cfg( debug_assertions) ]
100100 {
101- println ! ( "Restarting application..." ) ;
101+ // In development mode, reload all windows instead of restarting the entire process
102+ // This preserves the CLI dev server
103+ println ! ( "Reloading application (dev mode)..." ) ;
104+ for ( _label, window) in app. webview_windows ( ) {
105+ let _ = window. eval ( "window.location.reload()" ) ;
106+ }
107+ }
108+ #[ cfg( not( debug_assertions) ) ]
109+ {
110+ // In production mode, actually restart the application
111+ println ! ( "Restarting application (production mode)..." ) ;
102112 app. restart ( ) ;
103113 }
104114 }
@@ -117,12 +127,12 @@ pub fn handle_menu_event(app: &AppHandle, event: tauri::menu::MenuEvent) {
117127 }
118128 }
119129 "toggle_devtools" => {
130+ #[ cfg( debug_assertions) ]
120131 if let Some ( window) = app. get_webview_window ( "main" ) {
121- if window. is_devtools_open ( ) {
122- let _ = window. close_devtools ( ) ;
123- } else {
124- let _ = window. open_devtools ( ) ;
125- }
132+ // In Tauri v2, devtools are handled differently
133+ // For now, we'll just focus the window
134+ let _ = window. set_focus ( ) ;
135+ println ! ( "DevTools toggle requested (not implemented in Tauri v2)" ) ;
126136 }
127137 }
128138 "about" => {
0 commit comments