Improve local filetree view state and sidebar performance

This commit is contained in:
lix-2026
2026-05-27 11:31:12 +08:00
parent 58e2fdb5d8
commit 3ae33cc21d
56 changed files with 8614 additions and 461 deletions
@@ -174,7 +174,7 @@ async function openPageSettingsDialog(page) {
async function waitForOptionsResponse(page, documentId, mutate) {
const responsePromise = page.waitForResponse(
async (response) => {
if (!response.url().includes("/api/documents/options") || response.request().method() !== "POST") {
if (!response.url().includes("/api/ui/preferences") || response.request().method() !== "PUT") {
return false;
}
const payload = response.request().postDataJSON();
@@ -185,8 +185,8 @@ async function waitForOptionsResponse(page, documentId, mutate) {
await mutate();
const response = await responsePromise;
const payload = await response.json();
assert.equal(payload?.meta?.commandName, "page.layout.updateOptions", "页面设置写入必须走 page.layout.updateOptions");
assert.equal(payload?.meta?.canonicalCommand, "page.layout.updateOptions", "页面设置 canonical command 必须稳定");
assert.equal(payload?.owner, "mnote-web", "页面设置写入必须由 mnote-web 持有");
assert(payload?.result?.pageOptions, "页面设置写入必须返回 SQLite 合并后的 pageOptions");
return response.status();
}