Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions docs/app/io.js
Original file line number Diff line number Diff line change
Expand Up @@ -3771,6 +3771,18 @@ async function flyRoute() {
const STORE_KEY = 'navaid.route';
let persistTimer = null;
let quotaWarned = false; // #80: stop scheduling after a quota fail
// An empty route is stored as the *absence* of the key, not an empty object, so
// a fresh boot (or a clear-store reload) leaves navaid.route truly cleared
// rather than re-writing "{waypoints:[]…}".
function routeIsEmpty() {
return state.waypoints.length === 0 &&
state.legs.length === 0 &&
state.notes.length === 0;
}
function writeRoute() {
if (routeIsEmpty()) localStorage.removeItem(STORE_KEY);
else localStorage.setItem(STORE_KEY, JSON.stringify(routeSnapshotForStorage()));
}
function persist() {
// When boot detected a corrupt saved blob (issue #73), refuse to overwrite
// it with the empty in-memory state — that's silent data loss. Once the
Expand All @@ -3789,7 +3801,7 @@ function persist() {
persistTimer = null;
try {
// center / zoom are not restored (load fits the route) — not saved.
localStorage.setItem(STORE_KEY, JSON.stringify(routeSnapshotForStorage()));
writeRoute();
} catch (e) {
// #80: a full quota used to fail silently. Surface it once so the
// user knows to export the route; other storage-unavailable errors
Expand All @@ -3814,7 +3826,7 @@ function flushPersist() {
}
if (quotaWarned) return;
try {
localStorage.setItem(STORE_KEY, JSON.stringify(routeSnapshotForStorage()));
writeRoute();
} catch (e) {
if (e && (e.name === 'QuotaExceededError' || e.code === 22 ||
e.code === 1014 /* NS_ERROR_DOM_QUOTA_REACHED */)) {
Expand Down
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
</script>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet-velocity@1.7.0/dist/leaflet-velocity.min.css">
<link rel="stylesheet" href="app/style.css?v=182">
<link rel="stylesheet" href="app/style.css?v=183">
</head>
<body>
<!-- Crawlable static content. The app renders into a full-screen canvas/map
Expand Down Expand Up @@ -622,7 +622,7 @@ <h3 data-i18n="tbSecSim">Simulator</h3>
hack for strings.js. Silences CodeQL js/eval-like-call (#12). -->
<script>
(function () {
var v = '?v=182';
var v = '?v=183';
var srcs = [
'https://unpkg.com/leaflet@1.9.4/dist/leaflet.js',
'https://unpkg.com/leaflet-rotate@0.2.8/dist/leaflet-rotate.js',
Expand Down
9 changes: 9 additions & 0 deletions tests/_setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@
if (host === 'gist.githubusercontent.com') {
return route.abort();
}
// Block the live NOTAM feed (notam-data branch on raw.githubusercontent)
// so UI tests never pull the real ~90 active NOTAMs — that made the
// NOTAM list button appear and intercept map clicks (e.g. magnifier).
// The app falls back to the empty same-origin data/notam.json. Specs
// that need NOTAMs (notam-layer) register their own route, which wins.
if (host === 'raw.githubusercontent.com' &&
/\/notam-data\/|notam\.json$/.test(new URL(url).pathname)) {

Check failure

Code scanning / CodeQL

Missing regular expression anchor High test

Misleading operator precedence. The subexpression 'notam.json$' is anchored at the end, but the other parts of this regular expression are not
return route.abort();
}
} catch (e) { /* relative URLs etc. */ }
return route.continue();
});
Expand Down
3 changes: 3 additions & 0 deletions tests/ui-deep-coverage.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,9 @@ test.describe('Charts modal navigation', () => {
});

test('Charts section modals allow toolbar language change', async ({ page }) => {
// Four full reloads + language switches in one test — the default 15s is
// tight under parallel-worker load, so give it room.
test.setTimeout(45_000);
await boot(page);
const cases = [
{ button: '#charts', marker: '.charts-airport-header' },
Expand Down
Loading