feat: 收口 Rust Web 3000 主链

This commit is contained in:
lix-2026
2026-05-11 13:16:34 +08:00
parent 7f3f7d4e2f
commit 17c003976b
61 changed files with 2090 additions and 2256 deletions
+11 -10
View File
@@ -404,6 +404,15 @@ pub(crate) fn collect_page_tree_render_rows(projection: &Value) -> Vec<PageTreeR
.get("expandedByDefault")
.and_then(Value::as_bool)
.unwrap_or(false),
openable: item
.get("resourceMeta")
.and_then(Value::as_object)
.and_then(|meta| meta.get("documentId"))
.and_then(Value::as_str)
.map(str::trim)
.filter(|value| !value.is_empty())
.is_some()
|| !node_id.starts_with("local-dir:"),
})
})
.collect()
@@ -7475,7 +7484,7 @@ mod tests {
}
#[tokio::test]
async fn tree_route_contracts_compat_sidebar_keeps_boundary_and_trace_fields() {
async fn tree_route_contracts_compat_sidebar_route_is_not_registered_by_default() {
let response = app()
.oneshot(
Request::builder()
@@ -7487,15 +7496,7 @@ mod tests {
.await
.expect("response");
assert_eq!(response.status(), StatusCode::OK);
let body = axum::body::to_bytes(response.into_body(), usize::MAX)
.await
.expect("body");
let payload: Value = serde_json::from_slice(&body).expect("json");
assert_eq!(payload["boundary"], "next_sidebar_compat");
assert_eq!(payload["workspaceId"], "ws_demo");
assert!(payload["requestId"].as_str().is_some());
assert!(payload["traceId"].as_str().is_some());
assert_eq!(response.status(), StatusCode::NOT_FOUND);
}
#[test]