An application's reminders: Put off until tomorrow or next week drops focus to the start of the page #520
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
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#520
Loading…
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?
Found on 2026-09-29 in a read-only review of postulo at
95348908d, reading the reminder actions and the focus handover after htmx swaps.Checked again on 2026-10-01 against
mainat0a5cad587: still present. The code is now attemplates/cotton/reminder_actions.html:55-66(the Later form; Done at:39-40) andstatic/js/app.js:1894-1916(the focus handover);templates/applications/partials/reminders.htmlis unchanged. Since #310 the menu's trigger is a<button popovertarget>with noid, not a<summary>, and since #316 the reminders page is the calendar.On an application's page the two Put off menu items post through htmx and replace the whole
#remindersregion, as Done does. Done says where focus goes afterwards; the Put off items do not, and htmx 2.0.10 restores focus only to an element with anid, which they lack. The focused menu item is replaced and focus falls to<body>. The template's comment says nothing needs handing over for Later, which is true of the content and not of the DOM.templates/cotton/reminder_actions.html:41-52(the Later form:hx-target="{{ target }}" hx-swap="outerHTML", and tworole="menuitem"buttons with noidand nodata-focus-after; only Done at:32-33carriesdata-focus-after);templates/applications/partials/reminders.html:1-16(the comment, andtarget="#reminders"at:27-28);static/js/app.js:1659-1683(htmx:beforeRequestlooks for[data-focus-after]in or around the requesting form and finds none, sohtmx:afterSettledoes nothing);static/js/vendor/htmx.min.js(focus is restored only whenee(t.elt,"id")).tests/e2e/test_application_swaps.pycovers only Done.reminder-{{ reminder.pk }}-actionson the trigger<button popovertarget>drawn bycotton/dropdown_menu.html, through a new attribute) and have the Later buttons carrydata-focus-afterpointing at it, so focus returns to the same reminder's trigger once its new date is drawn; fall back to the region when the trigger is gone. Correct the comment inreminders.html.Done when
tests/e2e/test_application_swaps.pyopens a reminder's menu with the keyboard on an application's page, chooses Put off until tomorrow, and asserts that focus is on that reminder's actions trigger (not on<body>). It fails today and passes after the fix.Landed on main with a green Forgejo CI run. Its entry in the CHANGELOG's Unreleased section ends in (#520).