feat: consolidate local-first mnote web runtime

This commit is contained in:
lix-2026
2026-05-28 22:01:44 +08:00
parent 7354807ee9
commit 39b9a0183a
154 changed files with 13591 additions and 12728 deletions
@@ -59,6 +59,7 @@ async function uploadLocalAsset(page, root, documentId, fileName, mimeType, byte
const form = new FormData();
form.append("rootUri", rootUri);
form.append("documentId", documentId);
form.append("uploadIntent", "editor.markdown.attach");
form.append("kind", kind);
form.append("file", new File([new Uint8Array(bytes)], fileName, { type: mimeType }));
const response = await fetch("/api/local-folder/assets/upload", { method: "POST", body: form });
@@ -173,7 +174,7 @@ async function main() {
await page.waitForTimeout(100);
// 尝试关闭 dirty 的 resource tab — 应被阻止
const closeBtn = page.locator('.mnote-main-tab.is-active .mnote-main-tab-close');
const closeBtn = page.locator('.mnote-main-tab.is-active[data-pane-role="primary"] .mnote-main-tab-close:not([data-mnote-pane-close])');
await closeBtn.click({ timeout: UI_TIMEOUT_MS });
await page.waitForTimeout(300);