From 4bdb411d29158d005c76cb2e5ae528800346cbba Mon Sep 17 00:00:00 2001 From: vorotamoroz Date: Fri, 30 Oct 2026 11:42:50 +0000 Subject: [PATCH] Measure the visible CouchDB action bounds --- test/e2e-obsidian/scripts/dialog-mounts.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/e2e-obsidian/scripts/dialog-mounts.ts b/test/e2e-obsidian/scripts/dialog-mounts.ts index 3beb9d8b..6c2f5021 100644 --- a/test/e2e-obsidian/scripts/dialog-mounts.ts +++ b/test/e2e-obsidian/scripts/dialog-mounts.ts @@ -528,6 +528,11 @@ async function assertCouchDBKeyboardFormSpace(page: Page, modal: Locator): Promi throw new Error("CouchDB form layout is unavailable."); const footer = footerElement.getBoundingClientRect(); const row = rowElement.getBoundingClientRect(); + const actions = Array.from(footerElement.querySelectorAll("button"), (button) => + button.getBoundingClientRect() + ); + const footerTop = Math.min(footer.top, ...actions.map((action) => action.top)); + const footerBottom = Math.max(footer.bottom, ...actions.map((action) => action.bottom)); const modalElement = element.querySelector(".modal"); if (!modalElement) throw new Error("The CouchDB modal is unavailable."); const modalRect = modalElement.getBoundingClientRect(); @@ -539,10 +544,10 @@ async function assertCouchDBKeyboardFormSpace(page: Page, modal: Locator): Promi width: innerWidth, height: innerHeight, formTop, - footerTop: footer.top, - formHeight: Math.min(footer.top, contentRect.bottom, modalRect.bottom) - formTop, + footerTop, + formHeight: Math.min(footerTop, contentRect.bottom, modalRect.bottom) - formTop, rowHeight: row.height + (parseFloat(getComputedStyle(host).rowGap) || 0), - footerBottom: footer.bottom, + footerBottom, }; }); console.log(JSON.stringify({ event: "couchdb-keyboard-form-space", keyboardHeight, bounds }));