Skip to content

[3.0] Point these labels at the fields they name - #9500

Open
albertlast wants to merge 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/label-for-targets
Open

[3.0] Point these labels at the fields they name#9500
albertlast wants to merge 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/label-for-targets

Conversation

@albertlast

Copy link
Copy Markdown
Collaborator

Description

Three labels in the theme carry a for that matches no element. Clicking them does nothing, and assistive technology has no field to announce them against.

The notification timeout label is a copy-paste. Profile.template.php:1956 prints notify_alert_timeout's text over an input with id="notify_alert_timeout", but its for names notify_send_body — the setting immediately above. One word.

The two on the attachment preview could not be fixed the same way, which is why they were left out of an earlier markup change. The block they sit in is a template that dropzone clones once per attached file, so an id on the inputs would be repeated across every preview — and a label resolves against the first match in the document, so every copy would point at the first file's field instead of its own. Wrapping the input inside its label associates the two with no id at all, and survives cloning.

The caption moves into a <span> so the width that lines the two inputs up still applies to the caption alone rather than to the caption and input together.

How they were found

By walking every label[for] on twenty-five pages and resolving each id against its own document — board index, topic, posting, five profile areas, seven admin areas, personal messages, search, memberlist, registration, reminder, login and the moderation centre:

pages loaded:     25
labels checked:  177
dangling:          1

The attachment pair does not appear in that sweep because the block only exists once a file has been attached.

Layout is unchanged

Measured on the rendered preview, before and after, with the block forced visible:

before after
containing box 156.87 × 34.10 156.87 × 34.10
caption width 100 100
input width 50.47 50.47
input offset in box 103.66 103.66
caption and input on one line yes yes
clicking the caption focuses the input no yes

The offset is what caught a first attempt: collapsing the caption and input onto one source line dropped the whitespace text node between them and moved the input 3.66px left. The space is kept.

Unrelated, but seen while testing this

Every attachment upload on release-3.0 fails outright — the preview comes back as an error box reading Unknown column 'm.id_topic' in 'field list', from Sources/Attachment.php:537. That is the bug #9459 fixes, still open. It does not affect this change, since the preview and its labels are built before the upload is attempted.

Issues References (Fixes|Related|Closes)

Related #9459

Three labels in the theme carry a `for` that matches no element, so clicking
them does nothing and assistive technology has no field to announce them
against.

The notification timeout label is a copy-paste: its text and its input are both
the alert timeout, but the `for` names notify_send_body, the setting above it.
That one is a single word.

The two on the attachment preview cannot be fixed the same way, which is why
they were left before. The block they sit in is a template that dropzone clones
once per attached file, so an id on the inputs would be repeated across every
preview, and a label resolves against the first match in the document - each
copy would point at the first file's field rather than its own. Wrapping the
input in its label associates the two with no id at all, and survives cloning.

The caption moves into a span so the width that lines the two inputs up still
applies to the caption alone rather than to the caption and input together.

Found by walking every label[for] on twenty-five pages and resolving each id
against its own document: 177 labels, one dangling. The attachment pair does not
appear in that sweep because the block only exists once a file has been
attached.

Layout is unchanged, measured on the rendered preview before and after: the
containing box 156.87x34.10, the caption 100px, the input 50.47px starting
103.66px in, caption and input on one line. Only the association changes -
clicking the caption focused nothing before and focuses the input now.

Signed-off-by: Mathias Alberts <mathiaspapealbert@hotmail.com>
Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
@jdarwood007 jdarwood007 added this to the 3.0 Alpha 5 milestone Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants