feat(quit): close-window button + manual hint on the farewell overlay

The farewell overlay already attempted ``window.top.close()`` after a
Close click — but browsers only honour that for tabs that JS opened
(Chrome --app windows qualify; a regular browser tab does not). For
users whose Chrome wasn't auto-detected and who fall back to
``webbrowser.open``, the overlay stays put and they had no in-page
way to close.

Add to the overlay HTML:
- A "Close this window" button (uses the user-gesture path, which has
  slightly looser browser rules than auto-close).
- A hidden hint paragraph that reveals itself 250 ms after the
  button is clicked IF the window is still here, telling the user to
  press Ctrl+W (⌘W on Mac).

Wired through the existing _farewell_script template + ``_js_html_safe``
escaping so neither label can break out of the JS string literal.

New i18n keys (en + es): ``quit.close_window_button`` and
``quit.close_hint``.

The existing auto-close attempt remains — Chrome --app users still get
their window closed without touching the button.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-16 20:59:17 +00:00
parent 27f0648093
commit d1aaf3c2b9
3 changed files with 44 additions and 6 deletions

View File

@@ -51,7 +51,9 @@
"button": "Cerrar app",
"shutting_down": "Cerrando… ya puedes cerrar esta ventana.",
"farewell_title": "DataTools se ha cerrado",
"farewell_subtitle": "Ya puedes cerrar esta ventana."
"farewell_subtitle": "Ya puedes cerrar esta ventana.",
"close_window_button": "Cerrar esta ventana",
"close_hint": "Tu navegador bloqueó el cierre. Presiona Ctrl+W (o ⌘W en Mac) para cerrar esta pestaña manualmente."
},
"close_page": {
"page_title": "DataTools — Cerrar",