fix: make mdtodo reindex web-probe dialog-aware (#900)

Co-authored-by: Codex <codex@noreply.local>
This commit is contained in:
Lyon
2026-06-25 23:19:00 +08:00
committed by GitHub
parent 2299274f73
commit 1b168bccbf
@@ -1711,6 +1711,19 @@ async function openMdtodoSourceConfig(command) {
ensureProjectManagementCommand("openMdtodoSourceConfig");
const beforeUrl = currentPageUrl();
const beforeProject = await projectManagementCommandSnapshot();
const existingDialog = page.locator('[data-testid="mdtodo-source-form-hwpod"], [data-testid="mdtodo-source-config-dialog"], [role="dialog"]').first();
if (await visibleLocator(existingDialog)) {
return {
beforeUrl,
afterUrl: currentPageUrl(),
type: "openMdtodoSourceConfig",
alreadyOpen: true,
beforeProject,
afterProject: await projectManagementCommandSnapshot(),
pageId,
valuesRedacted: true
};
}
const button = page.locator('[data-testid="mdtodo-source-config-open"]').first();
await button.waitFor({ state: "visible", timeout: 15000 });
await button.click();
@@ -1804,8 +1817,10 @@ async function reindexMdtodoSource(command) {
const beforeUrl = currentPageUrl();
const beforeProject = await projectManagementCommandSnapshot();
await ensureMdtodoSourceConfigOpen();
const reindex = await clickProjectButtonAndMaybeWait("mdtodo-source-reindex", /^\/v1\/project-management\/mdtodo\/sources/u);
return { beforeUrl, afterUrl: currentPageUrl(), type: "reindexMdtodoSource", reindex, beforeProject, afterProject: await projectManagementCommandSnapshot(), pageId, valuesRedacted: true };
const dialogButton = page.locator('[data-testid="mdtodo-source-reindex-dialog"]').first();
const buttonTestId = await visibleLocator(dialogButton) ? "mdtodo-source-reindex-dialog" : "mdtodo-source-reindex";
const reindex = await clickProjectButtonAndMaybeWait(buttonTestId, /^\/v1\/project-management\/mdtodo\/sources/u);
return { beforeUrl, afterUrl: currentPageUrl(), type: "reindexMdtodoSource", buttonTestId, reindex, beforeProject, afterProject: await projectManagementCommandSnapshot(), pageId, valuesRedacted: true };
}
async function selectTaskIfCommandTargetsOne(command) {