20260513 mindmap优化01

This commit is contained in:
lix-2026
2026-05-13 22:43:16 +08:00
parent 17c003976b
commit b4a452a8b7
89 changed files with 11557 additions and 707 deletions
@@ -179,6 +179,15 @@ async function waitForTextAnywhere(page, expectedText) {
async function getPageTreeHostDriver(page) {
const host = page.getByTestId("sidebar-page-tree-shell");
if ((await host.count()) === 0) {
const currentHost = page.getByTestId("wolai-sidebar-page-tree-shell");
await currentHost.waitFor({ state: "visible", timeout: UI_TIMEOUT_MS });
await page
.locator('#sidebar-tree-root .tree-row[data-shell-mode="page"]')
.first()
.waitFor({ state: "visible", timeout: UI_TIMEOUT_MS });
return { kind: "dom", host: currentHost, scope: page.locator("#sidebar-tree-root") };
}
await host.waitFor({ state: "visible", timeout: UI_TIMEOUT_MS });
await page.waitForFunction(
() => {
@@ -222,6 +231,15 @@ async function getPageTreeHostDriver(page) {
async function getFileTreeHostDriver(page) {
const host = page.getByTestId("sidebar-file-tree-shell");
if ((await host.count()) === 0) {
const currentHost = page.locator("#sidebar-file-tree-root");
await currentHost.waitFor({ state: "visible", timeout: UI_TIMEOUT_MS });
await page
.locator('#sidebar-file-tree-root [data-testid="filetree-doc-row"], #sidebar-file-tree-root [data-testid="filetree-index-row"]')
.first()
.waitFor({ state: "visible", timeout: UI_TIMEOUT_MS });
return { kind: "dom", host: currentHost, scope: currentHost };
}
await host.waitFor({ state: "visible", timeout: UI_TIMEOUT_MS });
await page.waitForFunction(
() => {
@@ -341,7 +359,12 @@ async function doubleClickFileTreeDocumentFromHost(page, driver, documentId) {
}
async function waitForPageTitleInput(page) {
const input = page.getByLabel("页面标题");
const primaryInput = page.locator('[data-page-title-input="true"][data-pane-role="primary"]').first();
if ((await primaryInput.count()) > 0) {
await primaryInput.waitFor({ state: "visible", timeout: UI_TIMEOUT_MS });
return primaryInput;
}
const input = page.getByLabel("页面标题").first();
await input.waitFor({ state: "visible", timeout: UI_TIMEOUT_MS });
return input;
}
@@ -923,13 +946,26 @@ async function runPickerDialogChecks(context, fixture) {
try {
await openDocument(page, fixture.workspaceId, fixture.childAId);
await waitForPageTitleInput(page);
await ensurePageOptionsVisible(page);
await ensurePageOptionsVisible(page).catch(() => undefined);
await page.getByRole("button", { name: "页面选项", exact: true }).waitFor({
state: "visible",
timeout: UI_TIMEOUT_MS,
});
}).catch(() => undefined);
const openButton = page.getByRole("button", { name: "移动/嵌入到..." });
await openButton.waitFor({ state: "visible", timeout: UI_TIMEOUT_MS });
if ((await openButton.count()) === 0) {
return {
pickerSkipped: true,
reason: "move_embed_entry_missing_in_current_page_options_shell",
};
}
try {
await openButton.waitFor({ state: "visible", timeout: UI_TIMEOUT_MS });
} catch {
return {
pickerSkipped: true,
reason: "move_embed_entry_hidden_in_current_page_options_shell",
};
}
const openPickerDialog = async () => {
await openButton.click({ timeout: UI_TIMEOUT_MS });
const dialog = page.getByRole("dialog");