feat(tree): checkpoint resource lifecycle work

提交当前顶层 mnote Git 工作区,范围集中在 04-tree-domain 的 resource/trash/filetree 生命周期、mnote-web resource_trash 路由、Convex/Next 兼容接口、sidebar/file-tree 客户端适配、smoke 脚本与对应设计/bug 记录。

不包含被 ignore 的 design/05-editor-mainline/reference-code/leptos-tiptap 嵌套仓库改动。新增 smoke 的测试密码改为运行时读取 MNOTE_E2E_PASSWORD,避免提交明文 credential assignment。
This commit is contained in:
lix-2026
2026-05-16 07:38:45 +08:00
parent 274779c0d8
commit 384da4e44c
85 changed files with 12570 additions and 394 deletions
+18 -5
View File
@@ -412,9 +412,8 @@ mod tests {
assert!(degraded_projection.degraded);
assert!(degraded_html.contains("data-mnote-workspace-shell-degraded=\"true\""));
assert!(degraded_html.contains(
"data-mnote-workspace-shell-degraded-reason=\"projection_unavailable\""
));
assert!(degraded_html
.contains("data-mnote-workspace-shell-degraded-reason=\"projection_unavailable\""));
let dev_dataset = json!({
"workspaces": [{ "id": "ws_demo", "name": "开发用户 的工作区" }],
@@ -486,9 +485,18 @@ pub fn render_workspace_shell_sidebar_html(
.bottom_entries
.iter()
.map(|entry| {
let extra_attrs = if entry.id == "trash" {
format!(
r#" data-testid="mnote-sidebar-trash-entry" data-mnote-action="open-trash-modal" data-workspace-id="{}""#,
escape_html(&projection.workspace_id),
)
} else {
String::new()
};
format!(
r#"<a href="{}" class="wolai-footer-entry">{}{}</a>"#,
r#"<a href="{}" class="wolai-footer-entry"{}>{}{}</a>"#,
escape_html(&entry.href),
extra_attrs,
render_symbol(&entry.icon, "wolai-footer-icon"),
escape_html(&entry.label),
)
@@ -500,7 +508,12 @@ pub fn render_workspace_shell_sidebar_html(
degraded_marker = if projection.degraded {
format!(
r#"<span hidden data-mnote-workspace-shell-degraded="true" data-mnote-workspace-shell-degraded-reason="{}"></span>"#,
escape_html(projection.degraded_reason.as_deref().unwrap_or("projection_unavailable")),
escape_html(
projection
.degraded_reason
.as_deref()
.unwrap_or("projection_unavailable")
),
)
} else {
String::new()