diff --git a/packages/hoppscotch-agent/src-tauri/src/lib.rs b/packages/hoppscotch-agent/src-tauri/src/lib.rs index e7ead68f..24e34209 100644 --- a/packages/hoppscotch-agent/src-tauri/src/lib.rs +++ b/packages/hoppscotch-agent/src-tauri/src/lib.rs @@ -181,6 +181,20 @@ pub fn run() { .unwrap(); }; + let app_handle_ref = app_handle.clone(); + app_handle.listen("maximize-window", move |_| { + tracing::info!("Maximize window event triggered"); + if let Some(window) = app_handle_ref.get_webview_window("main") { + if let Err(e) = window.emit("show-otp-view", ()) { + tracing::error!("Failed to emit show-otp-view event: {}", e); + } + + if let Err(e) = show_main_window(&app_handle_ref) { + tracing::error!("Failed to maximize window: {}", e); + } + } + }); + let app_handle_ref = app_handle.clone(); app_handle.listen("registration-received", move |_| { tracing::info!("Registration received event triggered"); diff --git a/packages/hoppscotch-agent/src-tauri/src/tray.rs b/packages/hoppscotch-agent/src-tauri/src/tray.rs index afd08441..94952991 100644 --- a/packages/hoppscotch-agent/src-tauri/src/tray.rs +++ b/packages/hoppscotch-agent/src-tauri/src/tray.rs @@ -23,6 +23,13 @@ pub fn create_tray(app: &AppHandle) -> tauri::Result<()> { true, None::<&str>, )?; + let maximize_window = MenuItem::with_id( + app, + "maximize_window", + "Maximize Window", + true, + None::<&str>, + )?; let show_registrations = MenuItem::with_id( app, "show_registrations", @@ -48,9 +55,12 @@ pub fn create_tray(app: &AppHandle) -> tauri::Result<()> { .item(&app_name_item) .item(&app_version_item) .separator() + .item(&maximize_window) + .separator() .item(&clear_registrations) .item(&show_registrations) .separator() + .separator() .item(&quit_i) .build()?; @@ -63,7 +73,7 @@ pub fn create_tray(app: &AppHandle) -> tauri::Result<()> { }) .icon_as_template(cfg!(target_os = "macos")) .menu(&menu) - .menu_on_left_click(true) + .show_menu_on_left_click(true) .on_menu_event(move |app, event| match event.id.as_ref() { "quit" => { tracing::info!("Exiting the agent..."); @@ -85,6 +95,15 @@ pub fn create_tray(app: &AppHandle) -> tauri::Result<()> { tracing::error!("Failed to show window: {}", e); } } + "maximize_window" => { + app.emit("maximize-window", ()) + .unwrap_or_else(|e| { + tracing::error!("Failed to emit maximize-window event: {}", e); + }); + if let Err(e) = show_main_window(&app) { + tracing::error!("Failed to maximize window: {}", e); + } + } _ => { tracing::warn!("Unhandled menu event: {:?}", event.id); } diff --git a/packages/hoppscotch-agent/src/App.vue b/packages/hoppscotch-agent/src/App.vue index e558e7f8..b54b57f6 100644 --- a/packages/hoppscotch-agent/src/App.vue +++ b/packages/hoppscotch-agent/src/App.vue @@ -2,23 +2,18 @@

{{ pipe(state(), getTitle) }}

- diff --git a/packages/hoppscotch-common/locales/en.json b/packages/hoppscotch-common/locales/en.json index ba4643c7..fbd57566 100644 --- a/packages/hoppscotch-common/locales/en.json +++ b/packages/hoppscotch-common/locales/en.json @@ -882,14 +882,15 @@ "account_email_description": "Your primary email address.", "account_name_description": "This is your display name.", "additional": "Additional Settings", - "agent_not_running": "Hoppscotch Agent not detected - click `Retry` to check again.", + "agent_not_running": "Hoppscotch Agent not detected. Please check if the Agent is running.", "agent_not_running_short": "Check Agent's status.", "agent_running": "Hoppscotch Agent is live.", "agent_running_short": "Hoppscotch Agent is live.", - "agent_reset_registration": "Reset Registration", + "agent_discard_registration": "Discard Agent Registration", "agent_registered": "Agent Registered", "agent_registration_successful": "Agent Registered Successfully", - "agent_registration_fetch_failed": "Couldn't fetch Agent registration information", + "agent_registration_fetch_failed": "Couldn't fetch Agent registration information. Please re-register the Agent.", + "agent_registration_already_in_progress": "Agent registration is already in progress. Please complete or cancel the current registration and try again.", "auto_encode_mode": "Auto", "auto_encode_mode_tooltip": "Encode the parameters in the request only if some special characters are present", "background": "Background", @@ -928,6 +929,7 @@ "proxy_url": "Proxy URL", "proxy_use_toggle": "Use the proxy middleware to send requests", "read_the": "Read the", + "register_agent": "Register Agent", "reset_default": "Use Default Proxy", "short_codes": "Short codes", "short_codes_description": "Short codes which were created by you.", diff --git a/packages/hoppscotch-common/src/components/settings/AgentSubtitle.vue b/packages/hoppscotch-common/src/components/settings/AgentSubtitle.vue index 5b52abb1..fad75125 100644 --- a/packages/hoppscotch-common/src/components/settings/AgentSubtitle.vue +++ b/packages/hoppscotch-common/src/components/settings/AgentSubtitle.vue @@ -6,51 +6,16 @@
-
- {{ t("settings.agent_not_running_short") }} -
- -
- -
-
- {{ t("settings.agent_running") }} -
- -
- -
-
+
- {{ maskedAuthKey }} + {{ store.maskedAuthKey.value }}
+ +
+ +