From 0ca914f440af2e0d6cdbf3e1f2934b1f4353fc06 Mon Sep 17 00:00:00 2001 From: Miodec Date: Thu, 22 Jan 2026 14:17:31 +0100 Subject: [PATCH 1/3] fix: broken screenshots --- frontend/src/ts/test/test-screenshot.ts | 9 ++++++--- frontend/src/ts/utils/dom.ts | 9 +++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/frontend/src/ts/test/test-screenshot.ts b/frontend/src/ts/test/test-screenshot.ts index 87cf8085258f..7f2c42630a11 100644 --- a/frontend/src/ts/test/test-screenshot.ts +++ b/frontend/src/ts/test/test-screenshot.ts @@ -29,7 +29,7 @@ function revert(): void { qs(".pageTest .buttons")?.show(); qs("noscript")?.show(); qs("#nocss")?.show(); - qsa("header, footer")?.show(); + qsa("header, footer")?.removeClass("invisible"); qs("#result")?.removeClass("noBalloons"); qs(".wordInputHighlight")?.show(); qs(".highlightContainer")?.show(); @@ -119,8 +119,11 @@ async function generateCanvas(): Promise { } await Misc.sleep(50); // Small delay for render updates - const sourceX = src.getOffsetLeft() ?? 0; - const sourceY = src.getOffsetTop() ?? 0; + const sourceX = src.screenBounds().left ?? 0; + const sourceY = src.screenBounds().top ?? 0; + + console.log(sourceX, sourceY); + const sourceWidth = src.getOuterWidth(); const sourceHeight = src.getOuterHeight(); const paddingX = convertRemToPixels(2); diff --git a/frontend/src/ts/utils/dom.ts b/frontend/src/ts/utils/dom.ts index 8ab325ce785f..ffa671fdc3d7 100644 --- a/frontend/src/ts/utils/dom.ts +++ b/frontend/src/ts/utils/dom.ts @@ -582,12 +582,17 @@ export class ElementWithUtils { /** * Get the element's bounding client rect offset */ - offset(): { top: number; left: number } { + screenBounds(): { top: number; left: number; width: number; height: number } { const rect = this.native.getBoundingClientRect(); const scrollLeft = window.pageXOffset || document.documentElement.scrollLeft; const scrollTop = window.pageYOffset || document.documentElement.scrollTop; - return { top: rect.top + scrollTop, left: rect.left + scrollLeft }; + return { + top: rect.top + scrollTop, + left: rect.left + scrollLeft, + width: rect.width, + height: rect.height, + }; } /** From 76473c7e26e8c55f4e807c58e944b9aef915be81 Mon Sep 17 00:00:00 2001 From: Miodec Date: Thu, 22 Jan 2026 14:28:50 +0100 Subject: [PATCH 2/3] chore: update comment --- frontend/src/ts/utils/dom.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/ts/utils/dom.ts b/frontend/src/ts/utils/dom.ts index ffa671fdc3d7..29f9c59d0b9e 100644 --- a/frontend/src/ts/utils/dom.ts +++ b/frontend/src/ts/utils/dom.ts @@ -580,7 +580,7 @@ export class ElementWithUtils { } /** - * Get the element's bounding client rect offset + * Get the element's screen bounds: top, left, width and height */ screenBounds(): { top: number; left: number; width: number; height: number } { const rect = this.native.getBoundingClientRect(); From f0ae3b3b649588dde91d3e9fb2634a2cf77433ce Mon Sep 17 00:00:00 2001 From: Leonabcd123 <156839416+Leonabcd123@users.noreply.github.com> Date: Thu, 22 Jan 2026 16:12:21 +0200 Subject: [PATCH 3/3] fix(quote-search): Fix qsa warning in quote search modal (@Leonabcd123) (#7418) --- frontend/src/ts/modals/quote-search.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/ts/modals/quote-search.ts b/frontend/src/ts/modals/quote-search.ts index 7dc67ba651b8..f9442110d618 100644 --- a/frontend/src/ts/modals/quote-search.ts +++ b/frontend/src/ts/modals/quote-search.ts @@ -56,7 +56,7 @@ function applyQuoteLengthFilter(quotes: Quote[]): Quote[] { if (!modal.isOpen()) return []; const quoteLengthDropdown = modal .getModal() - .qs(".quoteLengthFilter"); + .qs("select.quoteLengthFilter"); const selectedOptions = quoteLengthDropdown ? Array.from(quoteLengthDropdown.native.selectedOptions) : [];