Agent task: 开发: Phase A+E+F — CSS 全量改造 (mnote-web)

This commit is contained in:
Agent Board
2026-06-16 01:19:04 +08:00
parent 1f483e3d7c
commit 1a3db17eea
13 changed files with 7539 additions and 6552 deletions
+3 -1
View File
@@ -8,6 +8,7 @@ pub(crate) mod evidence;
mod gateway;
mod health;
mod hermes;
mod ui_debug;
mod hermes_client;
mod hermes_tools;
mod kernel;
@@ -788,7 +789,8 @@ pub fn build_router(state: AppState) -> Router {
if enable_debug_shell_routes {
router = router
.route("/tree", get(tree::tree_shell))
.route("/document-debug", get(editor::document_editor_shell));
.route("/document-debug", get(editor::document_editor_shell))
.route("/ui-debug/components", get(ui_debug::components_shell));
}
router.with_state(state)
@@ -0,0 +1,49 @@
//! MNOTE UI Debug 路由 handler
//!
//! `/ui-debug/components` 调试组件矩阵页面。
//! 仅在 `MNOTE_WEB_ENABLE_DEBUG_SHELL_ROUTES=1` 时可用。
use crate::app::AppState;
use crate::context::RequestContext;
use crate::error::WebError;
use crate::routes::web_shell::load_sidebar_tree_html;
use crate::ssr::pages::ui_debug::UiDebugComponentsPage;
use axum::extract::{Extension, State};
use axum::response::{Html, IntoResponse, Response};
/// GET /ui-debug/components
///
/// 渲染组件矩阵调试页面。
pub async fn components_shell(
State(state): State<AppState>,
Extension(context): Extension<RequestContext>,
) -> Result<Response, WebError> {
let workspace_id = "default";
let sidebar_tree_html =
load_sidebar_tree_html(state.config(), &context, workspace_id, None)
.await
.unwrap_or_default();
let body_content = crate::ssr::render_view(leptos::view! {
<UiDebugComponentsPage
sidebar_tree_html={sidebar_tree_html}
/>
});
let full_page = format!(
r#"<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>UI Debug — 组件矩阵 — MNote</title>
<style>{MNOTE_CSS}</style>
</head>
<body>{body_content}</body>
</html>"#,
MNOTE_CSS = crate::ssr::MNOTE_CSS,
body_content = body_content,
);
Ok(Html(full_page).into_response())
}