From ee2e680ffe487db73135d9748a1dff975550a785 Mon Sep 17 00:00:00 2001 From: Miodec Date: Tue, 16 Dec 2025 10:18:08 +0100 Subject: [PATCH 1/2] fix(account settings): some buttons being visible when they shouldnt be --- frontend/src/ts/pages/account-settings.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/ts/pages/account-settings.ts b/frontend/src/ts/pages/account-settings.ts index 2ff8344c9357..ab7ea2378da8 100644 --- a/frontend/src/ts/pages/account-settings.ts +++ b/frontend/src/ts/pages/account-settings.ts @@ -34,9 +34,9 @@ const state: State = { }; function updateAuthenticationSections(): void { - pageElement.qs(".section.passwordAuthSettings button")?.addClass("hidden"); - pageElement.qs(".section.googleAuthSettings button")?.addClass("hidden"); - pageElement.qs(".section.githubAuthSettings button")?.addClass("hidden"); + pageElement.qsa(".section.passwordAuthSettings button")?.addClass("hidden"); + pageElement.qsa(".section.googleAuthSettings button")?.addClass("hidden"); + pageElement.qsa(".section.githubAuthSettings button")?.addClass("hidden"); const user = getAuthenticatedUser(); if (user === null) return; From 65aadb7e89c65ede641cde472c6140697a70bfdb Mon Sep 17 00:00:00 2001 From: Miodec Date: Tue, 16 Dec 2025 10:55:37 +0100 Subject: [PATCH 2/2] fix: out of focus warning sometimes showing even though words were focused --- frontend/src/ts/commandline/commandline.ts | 2 +- frontend/src/ts/test/out-of-focus.ts | 2 ++ frontend/src/ts/test/test-ui.ts | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/src/ts/commandline/commandline.ts b/frontend/src/ts/commandline/commandline.ts index dac9c13593af..f76a33b3d3f9 100644 --- a/frontend/src/ts/commandline/commandline.ts +++ b/frontend/src/ts/commandline/commandline.ts @@ -64,7 +64,7 @@ function removeCommandlineBackground(): void { function addCommandlineBackground(): void { qs("#commandLine")?.removeClass("noBackground"); - if (Config.showOutOfFocusWarning && !isInputElementFocused()) { + if (!isInputElementFocused()) { OutOfFocus.show(); } } diff --git a/frontend/src/ts/test/out-of-focus.ts b/frontend/src/ts/test/out-of-focus.ts index 4b153568dc24..5a9050583954 100644 --- a/frontend/src/ts/test/out-of-focus.ts +++ b/frontend/src/ts/test/out-of-focus.ts @@ -1,4 +1,5 @@ import * as Misc from "../utils/misc"; +import Config from "../config"; const outOfFocusTimeouts: (number | NodeJS.Timeout)[] = []; @@ -11,6 +12,7 @@ export function hide(): void { } export function show(): void { + if (!Config.showOutOfFocusWarning) return; outOfFocusTimeouts.push( setTimeout(() => { $("#words, #compositionDisplay") diff --git a/frontend/src/ts/test/test-ui.ts b/frontend/src/ts/test/test-ui.ts index a65de58d185c..f7422084f4e8 100644 --- a/frontend/src/ts/test/test-ui.ts +++ b/frontend/src/ts/test/test-ui.ts @@ -465,7 +465,7 @@ function updateWordWrapperClasses(): void { void updateHintsPositionDebounced(); Caret.updatePosition(); - if (document.activeElement !== getInputElement()) { + if (!isInputElementFocused()) { OutOfFocus.show(); } } @@ -1998,7 +1998,7 @@ $("#wordsInput").on("focus", (e) => { }); $("#wordsInput").on("focusout", () => { - if (!TestState.resultVisible && Config.showOutOfFocusWarning) { + if (!isInputElementFocused()) { OutOfFocus.show(); } Caret.hide();