Fix the hours field's label sitting on the outline

The label read "Horas por semana" struck through by the field's own
border: 5px above the wrapper instead of 18, straddling the 2px outline.

Angular Material measures an outlined field's floating label once on
init and writes the result to the element as an inline transform. This
field is the only one inside an @if, so it is measured before it has any
geometry and keeps the unfloated offset. @pi/ui already publishes the
right values for every other field and its rule matches this one too --
it simply loses to an inline style, so the fix restates the library's
own numbers with `!important`, which is what outranks one.

It also gains a placeholder, which every other field already had.

The e2e config now derives the dev server's port from BASE_URL instead
of pinning 4200. With `reuseExistingServer`, an unrelated project's dev
server on that port gets adopted silently and all five tests fail with
"element(s) not found" while the page under test was never served --
which is exactly what happened while verifying this.

Verified: all four labels now land at -18 with a 48px box, light and
dark; lint, 15 unit tests, build and 5 e2e green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
pigui
2026-08-31 00:13:12 +02:00
parent 68ad014df0
commit 25d0fe500b
4 changed files with 54 additions and 2 deletions

View File

@@ -78,6 +78,7 @@ export interface Copy {
email: string;
organisation: string;
hours: string;
hoursHint: string;
message: string;
messageHint: string;
consent: string;
@@ -167,6 +168,7 @@ const es: Copy = {
email: 'Correo',
organisation: 'Organización',
hours: 'Horas por semana',
hoursHint: 'Por ejemplo, 4',
message: 'Mensaje',
messageHint: 'Mínimo 20 caracteres.',
consent: 'Acepto que guardéis mis datos para responderme.',
@@ -264,6 +266,7 @@ const en: Copy = {
email: 'E-mail',
organisation: 'Organisation',
hours: 'Hours per week',
hoursHint: 'For example, 4',
message: 'Message',
messageHint: 'At least 20 characters.',
consent: 'I agree to have my details stored so you can reply.',
@@ -361,6 +364,7 @@ const ca: Copy = {
email: 'Correu',
organisation: 'Organització',
hours: 'Hores per setmana',
hoursHint: 'Per exemple, 4',
message: 'Missatge',
messageHint: 'Mínim 20 caràcters.',
consent: 'Accepto que deseu les meves dades per respondre’m.',