Telephone and web address rows: say what it is first, then the value #213
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Postulo/postulo#213
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In the rows for telephone numbers, social profiles, code repositories and websites, the fields should come in the order a person decides them: first what the entry is, then the value itself. Today every one of these rows puts the value first and describes it afterwards.
Telephone numbers:
Social profiles, code repositories and websites:
Then, in both kinds of row, the Primary / Gets me back in / Remove controls.
What it is today
Telephone numbers
src/postulo/templates/partials/phone_numbers.html, included by Your details (accounts/profile.html:121) and the contact form (jobs/contact_form.html:38) when Several telephone numbers is on::33-36): Phone, which is thePhoneFieldwidget (partials/phone_widget.html): the country select with its flag, then the number box.:37-83): a three-column grid holding Kind, Name, if Other, and the Primary / Gets me back in / Remove controls.The form declares
fields = ("kind", "label", "number")(core/phone_numbers.py:297), but the template draws them in its own order. Name, if Other is always visible, even though it only means something for Other. The server already requires it in that case (PhoneNumberForm.clean,:313-317), and nothing requires or uses it otherwise.Social profiles, code repositories and websites
src/postulo/templates/partials/web_links.html(#189) draws one block per kind, each only while its feature is on, on Your details and on the contact form::26-29): Address (url), full width.:30-47): a two-column grid with Name (label) and the Primary / Remove controls.These rows have no kind field: each block is a formset of one kind, and the block's legend says which (
core/web_links.py:60-124,WebLinkForm.fields = ("label", "url")at:295). Name is optional and always meaningful (left blank, the address's host is shown instead, per the note at:55-60and the model's help text atcore/models.py:537), so nothing about it is conditional. The change is only the order: Name, then Address on its own full-width line, then the controls.Why it is the way it is
A comment in
phone_numbers.html(:28-32) says the number was given its own line deliberately. Squeezed into a column beside two others, the fixed 10rem country select left the number box a few pixels wide, which is unusable and a WCAG 2.2 2.5.8 target-size failure that axe caught. The new order must not bring that back: country and number stay together as one full-width control (they are one widget already, country first), below kind and name, not squeezed beside them.web_links.html(:23-25) gives the same reason for the address: it is the long thing in the row. That still holds, so the address keeps its own full-width line, now below the name.What a fix has to settle
phone_numbers.html: a line for Kind (and Name when shown), then the phone widget on its own line, then Primary / recovery / Remove. The DOM order is the reading and tab order, so noorder-*utilities.web_links.html: Name on one line, then Address on its own full-width line, then Primary / Remove. There is no kind to add and nothing to show or hide.app.jsshows and hides it as Kind changes, delegated from the document like the rest of the file (the CSP forbids inline handlers), and moves focus nowhere.<noscript>fallback. The first is simpler and matches how the dragging code setsdraggableonly from script.hidden, so it is out of the accessibility tree too. When it appears, it follows Kind in the reading order, so a screen reader meets it next without any announcement.verbose_nameand help text in step (core/models.py:180-183); that is a translation change in every catalogue.sm:.accounts/forms.py:301-312) and the one URL box per kind while its Several … feature is off (core/web_links.py:248-267) have no kind or name to reorder.The same shape elsewhere
These rows have the same Kind + Name, if Other pair:
partials/postal_addresses.html:63);accounts/profile.html:153);jobs/company_form.html:80).The show-only-for-Other behaviour belongs in one place in
app.js(e.g. adata-shows-for-kind="other"attribute on the name field's wrapper) so they can adopt it. Whether they also change order should be decided here and filed separately, not done quietly as part of this.Checks
hidden; a failed submit with Other and no name shows it with its error;tests/e2e/test_accessibility.pyvisits Your details and the contact form with all three link features on; keep axe clean at phone width, and add a step that picks Other and finds the field.npm run build:cssif new classes appear.scripts/messages.py extractfor the changed label.Telephone number rows: kind first, then a name only for Other, then country and numberto Telephone and web address rows: say what it is first, then the value