Escape closes the panel a button opened, whatever its tooltip remembers #1028

Merged
tiagoagueda merged 2 commits from 917-escape-panel into main 2026-10-21 09:37:50 +00:00
Owner

Refs #917. Follow-up to #1015 and #1025.

What changed

app.js, the Escape handler for tooltips: before it decides whether a tooltip takes the key, a tooltip place whose anchor is a popovertarget button for a panel that is open now is marked spent. The panel gets the first Escape.

Why

#1025 marked the button's place spent when the panel opened. CI still failed test_the_keyboard_opens_it_and_escape_closes_it_and_returns_the_focus on a loaded runner (run 1138, which has #1025): a place made afresh after the toggle, by a late hover or focus event, starts with spent false and takes the first Escape. Deciding at Escape time, from what is open, does not depend on how the places were rebuilt.

A panel opened by something else, such as the masthead's New menu, still leaves the focused field's tooltip its Escape (test_escape_puts_it_away_and_does_nothing_else).

Tests

test_help.py, test_map.py, test_page_help.py, test_company_names_popover.py and test_birth_picker.py: 79 passed, 6 skipped. The race itself I cannot make happen on this machine, so CI under load is the real check.

Library check

None needed.

🤖 Generated with Claude Code

Refs #917. Follow-up to #1015 and #1025. ## What changed `app.js`, the Escape handler for tooltips: before it decides whether a tooltip takes the key, a tooltip place whose anchor is a `popovertarget` button for a panel that is open now is marked spent. The panel gets the first Escape. ## Why #1025 marked the button's place spent when the panel opened. CI still failed `test_the_keyboard_opens_it_and_escape_closes_it_and_returns_the_focus` on a loaded runner (run 1138, which has #1025): a place made afresh after the toggle, by a late hover or focus event, starts with `spent` false and takes the first Escape. Deciding at Escape time, from what is open, does not depend on how the places were rebuilt. A panel opened by something else, such as the masthead's *New* menu, still leaves the focused field's tooltip its Escape (`test_escape_puts_it_away_and_does_nothing_else`). ## Tests `test_help.py`, `test_map.py`, `test_page_help.py`, `test_company_names_popover.py` and `test_birth_picker.py`: 79 passed, 6 skipped. The race itself I cannot make happen on this machine, so CI under load is the real check. ## Library check None needed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Escape closes the panel a button opened, whatever its tooltip remembers (#917)
Some checks failed
CI / Checks: lint, migrations, catalogues, settings, built files (push) Successful in 2m42s
CI / Unit tests and coverage (Python 3.14) (push) Successful in 13m52s
CI / Database tests on PostgreSQL (push) Successful in 4m5s
CI / Security audit (push) Failing after 58s
CI / Browser tests (Chromium) (push) Successful in 29m49s
Every Python / Unit tests (Python 3.12) (push) Successful in 13m7s
Every Python / Unit tests (Python 3.13) (push) Successful in 14m13s
CI / Browser tests (Chromium) (pull_request) Failing after 35m25s
CI / Unit tests and coverage (Python 3.14) (pull_request) Successful in 16m35s
CI / Checks: lint, migrations, catalogues, settings, built files (pull_request) Successful in 3m20s
CI / Database tests on PostgreSQL (pull_request) Successful in 4m23s
CI / Security audit (pull_request) Failing after 1m0s
93f70e9ac7
The first fix put the opening button's tooltip away when the panel opened. CI still saw the
company-names popover keep its first Escape for the tooltip: a place made afresh after the
panel opened (a late hover or focus event) starts unspent. The rule is now applied when
Escape is pressed, from what is open at that moment.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Merge remote-tracking branch 'origin/main' into 917-escape-panel
All checks were successful
CI / Security audit (push) Successful in 1m8s
CI / Unit tests and coverage (Python 3.14) (push) Successful in 13m21s
CI / Checks: lint, migrations, catalogues, settings, built files (push) Successful in 2m59s
CI / Database tests on PostgreSQL (push) Successful in 4m11s
CI / Checks: lint, migrations, catalogues, settings, built files (pull_request) Successful in 2m50s
CI / Database tests on PostgreSQL (pull_request) Successful in 4m19s
CI / Browser tests (Chromium) (push) Successful in 33m0s
CI / Unit tests and coverage (Python 3.14) (pull_request) Successful in 14m7s
CI / Security audit (pull_request) Successful in 1m7s
CI / Browser tests (Chromium) (pull_request) Successful in 30m33s
Every Python / Unit tests (Python 3.13) (push) Successful in 14m35s
Every Python / Unit tests (Python 3.12) (push) Successful in 14m20s
dbec6dc78c
tiagoagueda deleted branch 917-escape-panel 2026-10-21 09:37:50 +00:00
Sign in to join this conversation.
No reviewers
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!1028
No description provided.