From f074835ee46f2ed84136ffa8377cd86c5beb1c88 Mon Sep 17 00:00:00 2001 From: ldm0 Date: Tue, 24 Nov 2026 04:10:55 +0800 Subject: [PATCH] refactor(navigation): trim traversal seed candidates --- .../src/native_bridge/context_host/navigation.rs | 2 +- moli-types/moli-page-types/src/navigation_history.rs | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/moli-renderer-v8/src/native_bridge/context_host/navigation.rs b/moli-renderer-v8/src/native_bridge/context_host/navigation.rs index f1d7372182c..8e0e74e7b39 100644 --- a/moli-renderer-v8/src/native_bridge/context_host/navigation.rs +++ b/moli-renderer-v8/src/native_bridge/context_host/navigation.rs @@ -67,7 +67,7 @@ pub(crate) struct PendingLocationNavigation { pub(crate) initial_document_environment: Option, pub(crate) entry_seed: Option, - /// Applied by the renderer when it owns the followed navigation. + /// Resolved history handling for requests without a prebuilt entry seed. pub(crate) history_mutation: Option, pub(crate) reserved_service_worker_client: Option, pub(crate) service_worker_client_navigate: diff --git a/moli-types/moli-page-types/src/navigation_history.rs b/moli-types/moli-page-types/src/navigation_history.rs index e79f74ab82b..f0240688ab1 100644 --- a/moli-types/moli-page-types/src/navigation_history.rs +++ b/moli-types/moli-page-types/src/navigation_history.rs @@ -79,7 +79,6 @@ pub struct NavigationActivationSeed { #[derive(Debug, Clone, PartialEq, Eq)] pub struct NavigationTraversalSeedCandidate { - pub current_url: Url, pub target_url: Url, pub seed: NavigationHistoryEntrySeed, } @@ -448,11 +447,9 @@ pub fn traversal_navigation_seed_candidate( return None; } - let current_url = Url::parse(¤t_entry.url).ok()?; let target_url = Url::parse(&target_entry.url).ok()?; Some(NavigationTraversalSeedCandidate { - current_url, - target_url: target_url.clone(), + target_url, seed: NavigationHistoryEntrySeed { session_history: crate::SessionHistorySeed { commit: crate::SessionHistoryCommit::Traverse, @@ -948,10 +945,6 @@ mod tests { let candidate = traversal_navigation_seed_candidate(entries, 0, 1).expect("traversal candidate"); - assert_eq!( - candidate.current_url.as_str(), - "https://example.test/current" - ); assert_eq!(candidate.target_url.as_str(), "https://example.test/target"); assert_eq!(candidate.seed.current_index, 1); assert_eq!(