From 7f04503921e84fb89a4f010a389000a019bbefab Mon Sep 17 00:00:00 2001 From: Miodec Date: Tue, 30 Apr 2024 21:00:02 +0200 Subject: [PATCH] impr(max line width): setting the value to 0 will now always align the words to the width of the container --- backend/src/api/schemas/config-schema.ts | 2 +- frontend/src/html/pages/settings.html | 3 +- frontend/src/styles/test.scss | 1 - frontend/src/ts/config.ts | 2 +- frontend/src/ts/constants/default-config.ts | 2 +- frontend/src/ts/test/test-ui.ts | 56 +++++++++++++-------- 6 files changed, 39 insertions(+), 27 deletions(-) diff --git a/backend/src/api/schemas/config-schema.ts b/backend/src/api/schemas/config-schema.ts index 65c3592fc..2b524d0d8 100644 --- a/backend/src/api/schemas/config-schema.ts +++ b/backend/src/api/schemas/config-schema.ts @@ -146,7 +146,7 @@ const CONFIG_SCHEMA = joi.object({ britishEnglish: joi.boolean(), lazyMode: joi.boolean(), showAverage: joi.string().valid("off", "speed", "acc", "both"), - maxLineWidth: joi.number().min(20).max(1000), + maxLineWidth: joi.number().min(20).max(1000).allow(0), }); export default CONFIG_SCHEMA; diff --git a/frontend/src/html/pages/settings.html b/frontend/src/html/pages/settings.html index 2cd9e8bb4..f021be038 100644 --- a/frontend/src/html/pages/settings.html +++ b/frontend/src/html/pages/settings.html @@ -900,6 +900,7 @@
Change the maximum width of the typing test, measured in characters. + Setting this to 0 will align the words to the edges of the content area.
@@ -907,7 +908,7 @@ type="number" placeholder="max line width" class="input" - min="20" + min="0" />