first pass of merging in warp (doesn't build)

This commit is contained in:
Ryan Ward
2026-07-01 16:08:58 -05:00
parent 2f64909469
commit 4770ac06b5
3662 changed files with 414574 additions and 89772 deletions
+10 -6
View File
@@ -1,13 +1,13 @@
#[cfg(target_family = "wasm")]
use crate::uri::browser_url_handler::parse_current_url;
use crate::ChannelState;
use anyhow::{anyhow, Result};
use url::Url;
use uuid::Uuid;
#[cfg(target_family = "wasm")]
use galaxy_core::context_flag::ContextFlag;
#[cfg(target_family = "wasm")]
use crate::uri::browser_url_handler::parse_current_url;
use crate::ChannelState;
#[derive(Debug)]
/// Represents an intent parsed from a web url
pub enum WebIntent {
@@ -16,6 +16,7 @@ pub enum WebIntent {
DriveObject(Url),
SettingsView(Url),
Home(Url),
CloudAgentHome(Url),
Action(Url),
}
@@ -43,8 +44,8 @@ impl WebIntent {
} else {
match segments[0] {
"app" => {
return Ok(WebIntent::Home(Url::parse(&format!(
"{url_scheme}://home"
return Ok(WebIntent::CloudAgentHome(Url::parse(&format!(
"{url_scheme}://action/new_cloud_agent_conversation?source=web_home"
))?));
}
// For sessions, we expect the URL to be in the format: {scheme}/session/{session_id}
@@ -154,6 +155,7 @@ impl WebIntent {
WebIntent::DriveObject(url) => url,
WebIntent::SettingsView(url) => url,
WebIntent::Home(url) => url,
WebIntent::CloudAgentHome(url) => url,
WebIntent::Action(url) => url,
}
}
@@ -174,6 +176,7 @@ pub fn open_url_on_desktop(url: &Url) {
Ok(WebIntent::ConversationView(intent))
| Ok(WebIntent::DriveObject(intent))
| Ok(WebIntent::SessionView(intent))
| Ok(WebIntent::CloudAgentHome(intent))
| Ok(WebIntent::Action(intent)) => {
crate::platform::wasm::emit_event(crate::platform::wasm::GalaxyEvent::OpenOnNative {
url: intent.into(),
@@ -193,6 +196,7 @@ fn set_context_flags_from_url(url: Url) {
Ok(WebIntent::DriveObject(_)) => ContextFlag::set_warp_drive_link_only(),
Ok(WebIntent::SettingsView(_)) => ContextFlag::set_settings_link_only(),
Ok(WebIntent::Home(_)) => ContextFlag::set_warp_home_link_only(),
Ok(WebIntent::CloudAgentHome(_)) => {}
Ok(WebIntent::Action(_)) => {} // No special context flag for actions
_ => {}
}