From 9a4dc80f11c3fafcc6c973138779610badc6ec95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D1=82=D0=BE=D0=BD=20=D0=A2=D1=80=D0=BE=D1=88?= =?UTF-8?q?=D0=B8=D0=BD?= Date: Tue, 6 Oct 2026 21:37:09 +0300 Subject: [PATCH] v3.22.5: the PWA view history and the i18n completeness The browser Back button now walks the app's own view stack: - a small state object {tab, sub, parser, view, listtab, preset, suite, script, item} is recorded on every view switch (navRecord/navCurrent/ navStateKey) via history.pushState - session-only, the URL never changes (pushState throwing on file:// degrades to no history); - popstate replays through the same switch functions under a _navApplying guard (they re-render and re-translate): the seven tabs, every pill set (SCP80 / Remote APDU + parser / Simulator / SCP81), the Cards list/editor (preset id), the test-suite views (suite/script ids) and the Profiler views/list tabs (profile/snapshot ids); unresolvable ids fall back to the area's default view; - the in-app Cancel/Back buttons (cardsCancelEdit, testScriptBack, testBackToSuites, profilerBackToList, profilerSaveProfile) call navReplace() so their entry is replaced instead of stacked, and the initial entry is seeded with replaceState so the first Back returns to the initial view. The reported untranslated suite Run button was the tip of a larger gap: the sweep found 21 t() keys without a Russian entry (Run/Suite/Move/Copy/Warning/ Text, the respond-result names, the event-data errors, the CAP tooltip, ...) - all added, and html.test.js now asserts every t('...') literal and every data-l10n/data-l10n-title attribute has a LANG_RU entry. Tests: nav.test.js (the recording/replace hooks, the state-key canonicalisation, the router core), the i18n completeness test, the extracted-function stubs in the cards/phone/profiler tests. 842 frontend + 819 Python; sw cache simple-v409. --- frontend/index.html | 203 +++++++++++++++++++++++++++++- frontend/sw.js | 2 +- frontend/tests/cards_form.test.js | 4 +- frontend/tests/html.test.js | 25 ++++ frontend/tests/nav.test.js | 78 ++++++++++++ frontend/tests/phone_tabs.test.js | 3 +- frontend/tests/profiler.test.js | 2 + pyproject.toml | 2 +- pysim_simple_server/server.py | 2 +- 9 files changed, 312 insertions(+), 9 deletions(-) create mode 100644 frontend/tests/nav.test.js diff --git a/frontend/index.html b/frontend/index.html index a0b948a..8158918 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -1384,7 +1384,7 @@