@meri-imperiumi/signalk-passage-briefing 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.7.1] - 2026-10-05
6
+
7
+ ### Fixed
8
+ - Notes resource `bbox` queries crossing the antimeridian now match notes on both sides of 180° (`plugin/notes-store.js`): a west edge east of the east edge — the natural way to frame a Pacific box around the seam — previously matched nothing, since no single longitude is simultaneously ≥ 170 and ≤ -175. Such a box now wraps the seam (matching west of the east edge or east of the west edge); regular west≤east boxes behave exactly as before
9
+
5
10
  ## [0.7.0] - 2026-10-04
6
11
 
7
12
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meri-imperiumi/signalk-passage-briefing",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Offshore passage daily briefing webapp for Signal K",
5
5
  "main": "plugin/index.js",
6
6
  "scripts": {
@@ -66,11 +66,16 @@ function matchesQuery(note, params) {
66
66
  if (params.bbox != null) {
67
67
  const [swLon, swLat, neLon, neLat] = params.bbox;
68
68
  const { latitude, longitude } = note.position ?? {};
69
+ // A west edge east of the east edge declares an
70
+ // antimeridian-crossing box: match either side of the seam
71
+ const lonInBox =
72
+ swLon <= neLon
73
+ ? longitude >= swLon && longitude <= neLon
74
+ : longitude <= neLon || longitude >= swLon;
69
75
  if (
70
76
  latitude == null ||
71
77
  longitude == null ||
72
- longitude < swLon ||
73
- longitude > neLon ||
78
+ !lonInBox ||
74
79
  latitude < swLat ||
75
80
  latitude > neLat
76
81
  ) {
@@ -69,6 +69,16 @@ test("bbox filter: sw/ne corners, including the antimeridian edge", () => {
69
69
  );
70
70
  });
71
71
 
72
+ test("bbox filter: a seam-crossing box matches both sides of 180°", () => {
73
+ // West edge east of the east edge: the box wraps the antimeridian,
74
+ // the natural way to frame a Pacific query around the seam
75
+ const box = { bbox: [170, -20, -175, -10] };
76
+ assert.equal(matchesQuery(note("east", -15, 179), box), true);
77
+ assert.equal(matchesQuery(note("west", -15, -179), box), true);
78
+ assert.equal(matchesQuery(note("far", -15, 150), box), false);
79
+ assert.equal(matchesQuery(note("far", -15, -150), box), false);
80
+ });
81
+
72
82
  test("distanceMeters sanity: one degree of latitude", () => {
73
83
  const d = distanceMeters(
74
84
  { latitude: -18, longitude: 174 },