diff --git a/AGENTS.md b/AGENTS.md index dd0e6b5..6c6776f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -16,10 +16,13 @@ PYTHONPATH=. .venv/bin/pytest -m "not browser" --cov --cov-report=term-missing - git diff --check ``` -Also run `pytest -m browser` with CI's WebKit setup when available. On this -Rocky host, the bundled WebKit cannot launch because of its system-library -requirements. Use a rootless `podman` (or Docker) installation and network -access to the Microsoft Playwright image to run WebKit in a matching container: +Also run `pytest -m browser` with CI's WebKit setup. On this Rocky host, the +bundled WebKit cannot launch because of its system-library requirements, but a +rootless `podman` installation and network access to the Microsoft Playwright +image are available. When working on this machine, presume that the +containerized WebKit procedure below can be run and attempt it before using any +fallback. A bundled-WebKit launch failure is not evidence that WebKit is +unavailable. ```sh WEBKIT_VERSION="$(.venv/bin/python -c 'from importlib.metadata import version; print(version("playwright"))')" @@ -34,8 +37,11 @@ podman stop driving-record-webkit The image and installed Python Playwright version must match because the run-server protocol is version-specific. `--network host` lets containerized -WebKit reach the temporary `127.0.0.1` server created by the tests. If this -setup is unavailable, state that limitation explicitly and run the project's -configured Chromium fallback only when the test documents it. +WebKit reach the temporary `127.0.0.1` server created by the tests. If sandbox +permissions prevent loopback binding or Podman execution, request escalation +and retry the same procedure. Use the project's configured Chromium fallback +only after the containerized WebKit procedure has been attempted and failed; +report the exact failing command and reason before doing so. If the procedure +cannot be run after that retry, state the limitation explicitly. Inspect each PR's GitHub check results after pushing; distinguish a pre-existing or unrelated failure from one introduced by the branch with log evidence. diff --git a/driving_log/static/app.js b/driving_log/static/app.js index 5d02fab..66e7cf7 100644 --- a/driving_log/static/app.js +++ b/driving_log/static/app.js @@ -333,6 +333,33 @@ }); }); + const driveGroups = document.querySelectorAll("details[data-drive-group-key]"); + if (driveGroups.length) { + const storageKey = `driving-log:expanded-drive-groups:${location.pathname}${location.search}`; + let expanded = new Set(); + try { + expanded = new Set(JSON.parse(sessionStorage.getItem(storageKey) || "[]")); + } catch (_) { + // Storage may be unavailable in private browsing or under a strict policy. + } + const saveExpanded = () => { + try { + sessionStorage.setItem(storageKey, JSON.stringify([...expanded])); + } catch (_) { + // The disclosure still works for this page when persistence is unavailable. + } + }; + driveGroups.forEach(group => { + const key = group.dataset.driveGroupKey; + if (expanded.has(key)) group.open = true; + group.addEventListener("toggle", () => { + if (group.open) expanded.add(key); + else expanded.delete(key); + saveExpanded(); + }); + }); + } + document.querySelectorAll("[data-cancel-form]").forEach(link => { const form = document.getElementById(link.dataset.cancelForm); if (!form) return; diff --git a/driving_log/templates/drives.html b/driving_log/templates/drives.html index ffb2888..297b56e 100644 --- a/driving_log/templates/drives.html +++ b/driving_log/templates/drives.html @@ -80,7 +80,7 @@