Your details: show an address on the map with a map-pin toggle beside the star and the bin, confirmed in a dialog #923

Closed
opened 2026-10-15 17:19:44 +00:00 by tiagoagueda · 0 comments
Owner

On Your details, whether a postal address is shown on the map becomes a toggle in the address's top line, next to the star and the bin, in place of the tick box under the address. Off by default, it shows Lucide map-pin-off in grey. On, it shows map-pin in green. Turning it on first asks for confirmation in a Basecoat dialog.

What exists today

  • templates/partials/postal_addresses.html: after the address lines, {% if row.on_map %} draws a checkbox {{ row.on_map|add_class:"input" }} with its label, and a help paragraph under it ({{ row.on_map.help_text }}). Then comes the status line data-map-status-line ("On the map at …" / Place it by hand / Move it).
  • on_map is a field only for addresses that are not a company's: the person's own and a contact's. Companies' addresses are always drawn (jobs/views.py::pinned_addresses). Default is off (#702: "a home is somewhere somebody can be found").
  • The star and the bin are in [data-address-head] > [data-row-actions], at the end of the line that holds Type and Name (#866): <c-primary-choice> then <c-remove-button>.
  • Confirmation dialogs exist as <c-dialog> (#303, used by the bins), drawn after the form because a form cannot hold another.

What would change

  • In [data-row-actions], the order becomes: map toggle, star, bin (or another order chosen when building, as long as all three are on that line).
  • The toggle is still the on_map checkbox, so it posts with Save and works with scripts off. It is visually hidden behind a label drawn as an icon, the way <c-primary-choice> hides its radio behind a star. Unchecked: map-pin-off, ink-500. Checked: map-pin, green-600 (green-400 in dark). The two icons differ in shape, not only in colour.
  • With scripts on, ticking it opens a confirmation dialog first. Show on the map sets it, and Cancel or Escape leaves it off. Turning it off needs no confirmation. With scripts off, it ticks directly, as today.
  • The help paragraph under the address goes. Its sentence becomes the toggle's tooltip, and the card's help (the postal-addresses topic) explains it. The status line (On the map at …, Place it by hand, Move it) stays where it is.
  • Contacts' form and the company form: the contact form uses the same partial without remove_at_once and keeps words, not icons, there ("Primary", "Remove"). Decide whether the toggle is Your details only, as the star and bin are.

Accessibility

  • A real checkbox named by the field's label ("Show on the map"), with title and tooltip carrying the sentence, a 24px target, and a visible focus ring as .primary-choice:has(input:focus-visible) has.
  • The dialog is <c-dialog>: it traps focus, returns it to the toggle, and says what is shown and to whom. The map is the person's own, and the address never leaves the instance.

Notes

  • New strings: the dialog's title, text and button. They go through the catalogues and Weblate.

Related: #702, #866, #303.

Checked against main at 56fc9d531.

On *Your details*, whether a postal address is shown on the map becomes a toggle in the address's top line, next to the star and the bin, in place of the tick box under the address. Off by default, it shows Lucide `map-pin-off` in grey. On, it shows `map-pin` in green. Turning it on first asks for confirmation in a Basecoat dialog. ## What exists today - `templates/partials/postal_addresses.html`: after the address lines, `{% if row.on_map %}` draws a checkbox `{{ row.on_map|add_class:"input" }}` with its label, and a help paragraph under it (`{{ row.on_map.help_text }}`). Then comes the status line `data-map-status-line` ("On the map at …" / *Place it by hand* / *Move it*). - `on_map` is a field only for addresses that are not a company's: the person's own and a contact's. Companies' addresses are always drawn (`jobs/views.py::pinned_addresses`). Default is off (#702: "a home is somewhere somebody can be found"). - The star and the bin are in `[data-address-head] > [data-row-actions]`, at the end of the line that holds Type and Name (#866): `<c-primary-choice>` then `<c-remove-button>`. - Confirmation dialogs exist as `<c-dialog>` (#303, used by the bins), drawn after the form because a form cannot hold another. ## What would change - In `[data-row-actions]`, the order becomes: map toggle, star, bin (or another order chosen when building, as long as all three are on that line). - The toggle is still the `on_map` checkbox, so it posts with *Save* and works with scripts off. It is visually hidden behind a label drawn as an icon, the way `<c-primary-choice>` hides its radio behind a star. Unchecked: `map-pin-off`, ink-500. Checked: `map-pin`, green-600 (green-400 in dark). The two icons differ in shape, not only in colour. - With scripts on, ticking it opens a confirmation dialog first. *Show on the map* sets it, and *Cancel* or Escape leaves it off. Turning it off needs no confirmation. With scripts off, it ticks directly, as today. - The help paragraph under the address goes. Its sentence becomes the toggle's tooltip, and the card's help (the postal-addresses topic) explains it. The status line (`On the map at …`, *Place it by hand*, *Move it*) stays where it is. - Contacts' form and the company form: the contact form uses the same partial without `remove_at_once` and keeps words, not icons, there ("Primary", "Remove"). Decide whether the toggle is Your details only, as the star and bin are. ## Accessibility - A real checkbox named by the field's label ("Show on the map"), with `title` and tooltip carrying the sentence, a 24px target, and a visible focus ring as `.primary-choice:has(input:focus-visible)` has. - The dialog is `<c-dialog>`: it traps focus, returns it to the toggle, and says what is shown and to whom. The map is the person's own, and the address never leaves the instance. ## Notes - New strings: the dialog's title, text and button. They go through the catalogues and Weblate. Related: #702, #866, #303. Checked against `main` at `56fc9d531`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Postulo/postulo#923
No description provided.