From 9bae1fce052b34c5a8a66381fc85fad4bc580b75 Mon Sep 17 00:00:00 2001 From: byseif21 Date: Tue, 7 Apr 2026 16:23:03 +0200 Subject: [PATCH 1/7] refactor: extract LabeledField wrapper to remove label+input boilerplate --- .../modals/CustomGeneratorModal.tsx | 28 +++++++-------- .../ts/components/modals/WordFilterModal.tsx | 36 ++++++++----------- .../ts/components/ui/form/LabeledField.tsx | 21 +++++++++++ 3 files changed, 48 insertions(+), 37 deletions(-) create mode 100644 frontend/src/ts/components/ui/form/LabeledField.tsx diff --git a/frontend/src/ts/components/modals/CustomGeneratorModal.tsx b/frontend/src/ts/components/modals/CustomGeneratorModal.tsx index e743fb83dc00..1598febb9841 100644 --- a/frontend/src/ts/components/modals/CustomGeneratorModal.tsx +++ b/frontend/src/ts/components/modals/CustomGeneratorModal.tsx @@ -7,6 +7,7 @@ import { AnimatedModal } from "../common/AnimatedModal"; import { Button } from "../common/Button"; import { Separator } from "../common/Separator"; import { InputField } from "../ui/form/InputField"; +import { LabeledField } from "../ui/form/LabeledField"; import { SubmitButton } from "../ui/form/SubmitButton"; import { TextareaField } from "../ui/form/TextareaField"; import SlimSelect from "../ui/SlimSelect"; @@ -159,9 +160,8 @@ export function CustomGeneratorModal(props: { }} class="grid gap-4" > -
-
presets
-
+ +
-
+
Enter characters or strings separated by spaces. Random combinations will be generated using these inputs.
-
-
character set
+ )} -
+
-
-
min length
+ {(field) => } -
-
-
max length
+ + {(field) => } -
+
-
-
word count
+ {(field) => } -
+
{ '"Set" replaces the current custom text with generated words, "Add" appends generated words to the current custom text.' diff --git a/frontend/src/ts/components/modals/WordFilterModal.tsx b/frontend/src/ts/components/modals/WordFilterModal.tsx index 89e3c1b3794e..84bd072111cd 100644 --- a/frontend/src/ts/components/modals/WordFilterModal.tsx +++ b/frontend/src/ts/components/modals/WordFilterModal.tsx @@ -20,6 +20,7 @@ import { Button } from "../common/Button"; import { Separator } from "../common/Separator"; import { Checkbox } from "../ui/form/Checkbox"; import { InputField } from "../ui/form/InputField"; +import { LabeledField } from "../ui/form/LabeledField"; import { SubmitButton } from "../ui/form/SubmitButton"; import SlimSelect from "../ui/SlimSelect"; @@ -228,15 +229,14 @@ export function WordFilterModal(props: { }} >
-
-
language
+ -
+
You can manually filter words by length, words or characters (separated by spaces) on the left side. On the right side you can @@ -246,21 +246,18 @@ export function WordFilterModal(props: {
-
-
min length
+ {(field) => } -
-
-
max length
+ + {(field) => } -
+
-
-
include
+ {(field) => } @@ -283,39 +280,36 @@ export function WordFilterModal(props: { /> )} -
-
-
exclude
+ + {(field) => ( )} -
+