Skip to content

feat: add DGGS plugin - #1650

Merged
giswqs merged 24 commits into
opengeos:mainfrom
opengeoshub:feat/dggs-support
Aug 3, 2026
Merged

feat: add DGGS plugin#1650
giswqs merged 24 commits into
opengeos:mainfrom
opengeoshub:feat/dggs-support

Conversation

@thangqd

@thangqd thangqd commented Aug 2, 2026

Copy link
Copy Markdown
Contributor
  • Extend support beyond H3 by adding additional DGGS implementations, including S2, A5, DGGRID, DGGAL, OLC (Google Plus Codes), Geohash, and Tilecode.
  • Add an Automatic resolution option that selects the appropriate DGGS resolution based on the current map zoom.
  • Add Include selected tile parent(s) option.
  • Display mutiple parents (if any) for the selected cell.
  • Replace the current H3 antimeridian splitting approach with an antimeridian shifting approach to eliminate visualization artifacts

Summary by CodeRabbit

  • New Features

    • Added grid tools for S2, A5, DGGRID, DGGAL, OLC, Geohash, and Tilecode.
    • Added a consolidated DGGS menu with navigation, selection, styling, hierarchy, and GeoJSON/CSV export.
    • Enhanced H3 with automatic resolution, parent-cell overlays, and optional icosahedron display.
  • Improvements

    • Added localized controls and labels across grid tools.
    • Viewer mode now prevents project-name edits and adding data.
    • Improved handling of dateline-spanning grid boundaries and localized the view-comments command.
  • Tests

    • Expanded coverage for grid generation, geometry, settings, exports, and edge cases.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR adds seven DGGS MapLibre plugins, extends H3 controls and geometry handling, updates public exports and dependencies, integrates DGGS plugins into the desktop menu, and adds localization, viewer-mode restrictions, and helper tests.

Changes

DGGS plugin expansion

Layer / File(s) Summary
Dependencies and public plugin contracts
packages/plugins/package.json, packages/plugins/src/index.ts, packages/plugins/src/plugins/dggs-group.ts
The plugins package adds grid-system dependencies, DGGS identifiers, public settings APIs, helpers, types, and plugin exports.
Desktop registration and toolbar integration
apps/geolibre-desktop/src/components/layout/toolbar/PluginsMenu.tsx, apps/geolibre-desktop/src/hooks/usePlugins.ts, apps/geolibre-desktop/src/components/layout/TopToolbar.tsx, apps/geolibre-desktop/src/i18n/locales/en.json
The desktop registers and groups DGGS plugins, configures translated labels, localizes commands, and restricts viewer-mode actions.
S2, A5, and H3 grid behavior
packages/plugins/src/plugins/maplibre-s2.ts, packages/plugins/src/plugins/maplibre-a5.ts, packages/plugins/src/plugins/maplibre-h3.ts, tests/s2-plugin.test.ts, tests/a5-plugin.test.ts, tests/h3-plugin.test.ts
S2 and A5 add configurable grids. H3 adds automatic resolution, parent and icosahedron overlays, polygon-only transmeridian geometry, persistence, lifecycle handling, and helper tests.
DGGRID and DGGAL grid plugins
packages/plugins/src/plugins/maplibre-dggrid.ts, packages/plugins/src/plugins/maplibre-dggal.ts, tests/dggrid-plugin.test.ts, tests/dggal-plugin.test.ts
DGGRID and DGGAL add dynamically loaded engines, validated settings, bounded polygon generation, overlays, panels, exports, persistence, cleanup, and coverage tests.
Encoded grid plugins
packages/plugins/src/plugins/maplibre-geohash.ts, packages/plugins/src/plugins/maplibre-olc.ts, packages/plugins/src/plugins/maplibre-tilecode.ts, tests/geohash-plugin.test.ts, tests/olc-plugin.test.ts, tests/tilecode-plugin.test.ts
Geohash, OLC, and Tilecode add configurable encoded grids, hierarchy and neighbor helpers, dateline handling, selection, exports, persistence, and helper tests.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant PluginsMenu
  participant DGGSPlugin
  participant MapLibre
  User->>PluginsMenu: Open the Plugins menu
  PluginsMenu->>DGGSPlugin: Render the grouped DGGS submenu
  User->>DGGSPlugin: Activate a grid or identify a cell
  DGGSPlugin->>MapLibre: Update grid and overlay sources
Loading

Poem

A rabbit hops through grids of light,
H3 and S2 align just right.
A5, OLC, and Tilecode glow,
DGGRID and DGGAL flow.
Geohash paths cross maps anew—
“Merge complete!” the rabbit chews.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 38.91% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding DGGS plugin support.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@giswqs

giswqs commented Aug 2, 2026

Copy link
Copy Markdown
Member

/claude-review

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

I'll stop here and wait — the four background agents reviewing the new plugin files will notify me when finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 18

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/geolibre-desktop/src/components/layout/TopToolbar.tsx (1)

967-994: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Restore the groupId prefill in TopToolbar.

LayerPanel opens dialog-based sources with openAddData(..., { groupId: group.id }), and OpenAddDataDetail.groupId documents that these layers should be scoped to that group. onOpenAddData now ignores detail.groupId and AddDataDialog does not receive/proxy it, so the "Add data to group" entries no longer add the created layer into the selected group. Map the window-event group prefill into a dialog prop and expose it to sources that manage group assignment.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/geolibre-desktop/src/components/layout/TopToolbar.tsx` around lines 967
- 994, Restore groupId propagation in the add-data flow: update TopToolbar’s
onOpenAddData to retain detail.groupId, pass it through the AddDataDialog props,
and expose it to the relevant source components so layer creation remains scoped
to the selected group. Preserve existing PostgreSQL prefill and source-kind
handling.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/plugins/src/plugins/maplibre-dggal.ts`:
- Around line 328-331: Update the dggrsType validation in the candidate
resolution flow to accept only keys owned by DGGAL_TYPES, replacing the
inherited-key-prone in check while preserving the existing string guard and
default fallback. Ensure prototype names such as constructor and toString are
rejected before activeDggrs() uses the value.
- Around line 459-483: Update dggalGridForBounds to handle bounds where east is
less than west by normalizing or splitting the antimeridian-crossing interval,
following the approach used in maplibre-dggrid.ts. Ensure the area estimate and
limit guard use the correct covered width, and pass listZones longitude bounds
in a valid order so crossing views produce a populated grid.

In `@packages/plugins/src/plugins/maplibre-dggrid.ts`:
- Around line 509-541: Update ringIntersectsBounds to normalize the entire ring
once into a consistent longitude frame relative to the bounds window, preserving
continuity for antimeridian-crossing vertices. Reuse that normalized ring for
the vertex checks, pointInRing corner checks, and segmentCrossesLonLatRect calls
instead of independently normalizing vertices or passing the raw ring.
- Line 837: Replace the full renderPanel call in refresh() at
packages/plugins/src/plugins/maplibre-dggrid.ts:837 with targeted updates to the
status text and resolution slider/value, preserving existing controls and user
input. Apply the same narrow-update change in
packages/plugins/src/plugins/maplibre-dggal.ts:618 instead of rebuilding the
panel.
- Around line 216-223: Both loader promises permanently cache failures; update
loadDggrid in packages/plugins/src/plugins/maplibre-dggrid.ts (lines 216-223)
and loadDggal in packages/plugins/src/plugins/maplibre-dggal.ts (lines 205-210)
to append rejection handlers that reset dggsPromise and dggalPromise to null
respectively before rethrowing the original error, preserving retry behavior
after dynamic import or WASM initialization failures.
- Around line 674-700: Replace the queue.shift() operation in the BFS loop with
an index cursor that advances through queue entries, and update the loop
condition to use that cursor instead of queue.length. Preserve the existing
traversal, coverage checks, maxPops guard, and neighbor enqueuing behavior.
- Around line 1214-1232: Prevent async activation from completing after
deactivation by adding a generation token in the activate/deactivate flows of
packages/plugins/src/plugins/maplibre-dggrid.ts (lines 1214-1232) and
packages/plugins/src/plugins/maplibre-dggal.ts (lines 991-1010): capture the
current token before awaiting loadDggrid/loadDggal, return false if the token
changed after the await, and increment the token in each plugin’s deactivate so
stale activations attach no listeners, panels, or layers.

In `@packages/plugins/src/plugins/maplibre-geohash.ts`:
- Around line 188-193: Update wrapLongitude to return the normalized wrapped
calculation directly, removing the redundant ternary checks for -180 and 180
while preserving the existing [-180, 180) range.

In `@packages/plugins/src/plugins/maplibre-h3.ts`:
- Around line 297-310: Extract the shared -130 longitude heuristic into a named
constant such as TRANSMERIDIAN_LONGITUDE_THRESHOLD, then replace the literal in
h3FixTransmeridianBoundary and the corresponding parentCells check with that
constant so both functions use the same threshold.
- Around line 18-26: Update ICOSAHEDRON_GEOJSON_URL to reference a specific
immutable commit SHA or stable release tag for the upstream icosahedron.geojson
resource instead of the mutable main branch, preserving the existing file path
and URL host.
- Around line 545-573: Export the parentCells function so it can be tested
externally, then add unit tests in the existing H3 plugin test suite covering a
non-dateline cell’s canonical parent and any limited overlapping neighbors,
resolution-0 cells returning [], and a dateline-crossing cell exercising the
ringCenterLng adjustment.

In `@packages/plugins/src/plugins/maplibre-olc.ts`:
- Around line 370-384: Update olcGridForBounds to deduplicate generated cells
using a Set keyed by the same `${cell}@${lngOffset}` identifier pattern as
geohashGridForBounds. Skip already-seen OLC/world-copy pairs before pushing the
feature, while preserving the existing limit check for unique features.

In `@packages/plugins/src/plugins/maplibre-s2.ts`:
- Around line 260-300: Update the RegionCoverer creation to set an explicit
maxCells value larger than the viewport cell limit, while retaining the existing
minLevel and maxLevel configuration. Locate the coverer initialization in the
map rendering flow and ensure the configured limit prevents the default S2 cap
from truncating required coverage.

In `@tests/a5-plugin.test.ts`:
- Around line 28-47: Update the A5 test expectations in the resolution-settings
assertion and the a5ResolutionForZoom test to derive the maximum resolution from
MAX_RESOLUTION instead of hardcoding 30. Import or re-export MAX_RESOLUTION
through the plugin module as needed to use the same dependency version as the
implementation, while leaving the fixed S2 level tests unchanged.
- Around line 57-68: Extend the “creates export-ready polygon features” test
around a5CellFeature to assert the polygon ring’s final coordinate equals its
first coordinate, confirming closure rather than only checking coordinate shape.
Add an antimeridian-crossing A5 feature test, following the S2 suite’s
equivalent case, and verify the returned ring remains longitude-contiguous
without requiring longitude unwrapping.

In `@tests/dggal-plugin.test.ts`:
- Around line 47-50: Add a validation assertion alongside the existing
"NotAGrid" case in the grid-type normalization test, using an inherited
Object.prototype key such as "toString" and verifying it falls back to
DEFAULT_DGGAL_GRID_SETTINGS.dggrsType. Keep the test focused on
normalizeDggalGridSettings and preserve the existing invalid-value assertion.

In `@tests/dggrid-plugin.test.ts`:
- Around line 102-106: Strengthen the antimeridian test in the `supports
antimeridian-crossing bounds` case by adding the same ring-span/contiguity
assertion used by the equivalent DGGAL test and asserting a reasonable upper
bound on `grid.features.length`. Keep the existing positive-count check and use
the requested antimeridian bounds to ensure `ringIntersectsBounds` does not
over-collect cells near ±180.

In `@tests/olc-plugin.test.ts`:
- Around line 142-163: Add a test assertion in the existing “finds the single
parent, child count, and neighbors of a cell” case that encodes a
grid-refinement cell at code length 11 and verifies olcParentCell returns its
expected code-length-10 parent, covering the refinement-to-pair transition in
OLC_CODE_LENGTHS.

---

Outside diff comments:
In `@apps/geolibre-desktop/src/components/layout/TopToolbar.tsx`:
- Around line 967-994: Restore groupId propagation in the add-data flow: update
TopToolbar’s onOpenAddData to retain detail.groupId, pass it through the
AddDataDialog props, and expose it to the relevant source components so layer
creation remains scoped to the selected group. Preserve existing PostgreSQL
prefill and source-kind handling.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ddd25891-5bd9-41e4-96f0-7d03142ff6eb

📥 Commits

Reviewing files that changed from the base of the PR and between dc962f9 and d5f95e1.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (23)
  • apps/geolibre-desktop/src/components/layout/TopToolbar.tsx
  • apps/geolibre-desktop/src/components/layout/toolbar/PluginsMenu.tsx
  • apps/geolibre-desktop/src/hooks/usePlugins.ts
  • apps/geolibre-desktop/src/i18n/locales/en.json
  • packages/plugins/package.json
  • packages/plugins/src/index.ts
  • packages/plugins/src/plugins/dggs-group.ts
  • packages/plugins/src/plugins/maplibre-a5.ts
  • packages/plugins/src/plugins/maplibre-dggal.ts
  • packages/plugins/src/plugins/maplibre-dggrid.ts
  • packages/plugins/src/plugins/maplibre-geohash.ts
  • packages/plugins/src/plugins/maplibre-h3.ts
  • packages/plugins/src/plugins/maplibre-olc.ts
  • packages/plugins/src/plugins/maplibre-s2.ts
  • packages/plugins/src/plugins/maplibre-tilecode.ts
  • tests/a5-plugin.test.ts
  • tests/dggal-plugin.test.ts
  • tests/dggrid-plugin.test.ts
  • tests/geohash-plugin.test.ts
  • tests/h3-plugin.test.ts
  • tests/olc-plugin.test.ts
  • tests/s2-plugin.test.ts
  • tests/tilecode-plugin.test.ts

Comment thread packages/plugins/src/plugins/maplibre-dggal.ts
Comment thread packages/plugins/src/plugins/maplibre-dggal.ts
Comment thread packages/plugins/src/plugins/maplibre-dggrid.ts
Comment thread packages/plugins/src/plugins/maplibre-dggrid.ts
Comment thread packages/plugins/src/plugins/maplibre-dggrid.ts
Comment thread tests/a5-plugin.test.ts
Comment thread tests/a5-plugin.test.ts
Comment thread tests/dggal-plugin.test.ts
Comment thread tests/dggrid-plugin.test.ts
Comment thread tests/olc-plugin.test.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
apps/geolibre-desktop/src/components/layout/TopToolbar.tsx (2)

549-786: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Consider extracting a shared label-builder for the DGGS grid plugins.

The blocks for H3, S2, A5, DGGRID, DGGAL, OLC, Geohash, and Tilecode repeat about 20 identical field names (title, getTitle, controlTitle, resolution, cellCount, tooManyCells, fillColor, fillOpacity, lineColor, lineWidth, showLabels, identifyHint, selectedCell, noSelection, copyId, children, neighbors, center, zoomToCell, addAsLayer, exportGeoJson, exportCsv, includeNeighbors). Only a few fields differ per plugin (gridType/cellType, quadkey, includeParent/includeParents).

Extract a helper that builds the common label object from an i18n key prefix, then merge plugin-specific fields before calling the typed setter. This reduces about 200 lines of near-duplicate code and makes future DGGS additions less error-prone.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/geolibre-desktop/src/components/layout/TopToolbar.tsx` around lines 549
- 786, Extract a shared label-builder near the repeated setH3Labels,
setS2Labels, setA5Labels, setDggridLabels, setDggalLabels, setOlcLabels,
setGeohashLabels, and setTilecodeLabels calls that accepts each plugin’s i18n
key prefix and returns the common translated fields, including dynamic
cell-count handlers and getTitle. Replace the duplicated common objects with the
helper, then merge each plugin’s unique fields such as gridType, cellType,
quadkey, and includeParent/includeParents before passing them to the existing
typed setters.

175-179: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Align toolbar viewer gating with the removed TopToolbarProps.viewer prop.

DesktopShell.tsx still passes viewer={layoutOptions.viewer} to TopToolbar, but the prop no longer exists. If TopToolbar should not gate menus/dialogs by viewer mode, remove the prop from both the caller and any viewer-aware toolbar prop types; if it should, add a local read-only flag that flows into the relevant toolbar menus and dialogs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/geolibre-desktop/src/components/layout/TopToolbar.tsx` around lines 175
- 179, Align TopToolbar usage with the removed viewer prop: update
DesktopShell.tsx to stop passing viewer={layoutOptions.viewer}, and remove any
remaining viewer-aware fields or gating from TopToolbar prop types and its
menus/dialogs. Preserve toolbar behavior without viewer-mode checks.
♻️ Duplicate comments (1)
packages/plugins/src/plugins/maplibre-olc.ts (1)

370-384: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Dedupe OLC cells during the viewport walk.

olcGridForBounds steps lng/lat with floating-point accumulation. Two adjacent steps can land inside the same OLC cell, so the same cell and world copy can be pushed twice. Duplicate features share the same id, which double-paints the fill and breaks the uniqueness assertion in tests/olc-plugin.test.ts at line 75. geohashGridForBounds in packages/plugins/src/plugins/maplibre-geohash.ts already guards this with a ${cell}@${lngOffset} key.

🐛 Proposed fix
   const features: Feature<Polygon>[] = [];
+  const seen = new Set<string>();
   for (let lng = startLng; lng < east; lng += lngWidth) {
     for (let lat = startLat; lat < north && lat < 90; lat += latHeight) {
       const centerLng = lng + lngWidth / 2;
       const cell = OpenLocationCode.encode(lat + latHeight / 2, centerLng, codeLength);
       // 360° multiple between the drawn column and the normalized cell.
       const lngOffset =
         Math.round((centerLng - OpenLocationCode.decode(cell).longitudeCenter) / 360) * 360;
+      const key = `${cell}@${lngOffset}`;
+      if (seen.has(key)) continue;
+      seen.add(key);
       features.push(olcCellFeature(cell, lngOffset));
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/plugins/src/plugins/maplibre-olc.ts` around lines 370 - 384, Update
olcGridForBounds to deduplicate generated features using a key combining each
encoded cell and its normalized lngOffset, matching the guard used by
geohashGridForBounds. Check and record the key before pushing via
olcCellFeature, while preserving the existing limit enforcement and viewport
traversal.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/geolibre-desktop/src/i18n/locales/en.json`:
- Around line 2894-2903: Update the S2 locale entries `parent` and
`includeParents` to use the plural “Parent(s)” and “Include selected cell
parent(s)” wording consistent with sibling multi-parent DGGS plugins; only
rename `includeParents` to `includeParent` if the S2 implementation genuinely
supports a single parent level.

In `@packages/plugins/package.json`:
- Line 65: Align the maplibre-gl-vector dependency across
packages/plugins/package.json, apps/geolibre-desktop/package.json, and
package-lock.json by using the ^0.10.7 range where supported. Update the
lockfile’s package entry and resolved metadata to match the declared 0.10.7
range, preserving a consistent dependency version across all manifests.

In `@packages/plugins/src/plugins/maplibre-a5.ts`:
- Around line 281-291: Normalize the longitude values returned by cellToBoundary
in a5CellFeature before assigning them to geometry.coordinates[0], unwrapping
the ring across the antimeridian relative to adjacent points as the S2 helper
does. Ensure fitSelected uses the same normalized boundary coordinates when
computing bounds, so antimeridian-spanning cells render and fit locally rather
than across the globe.

In `@packages/plugins/src/plugins/maplibre-h3.ts`:
- Around line 442-458: Update ensureLayers() so the ICOSAHEDRON_SOURCE_ID source
and ICOSAHEDRON_LINE_LAYER_ID layer are created only when
settings.showIcosahedron is true, preventing the hidden overlay’s GeoJSON
request. Also guard the corresponding setLayoutProperty() and removeLayers()
operations so they run only when the icosahedron layer exists.

In `@tests/dggrid-plugin.test.ts`:
- Around line 138-144: Update the “returns every overlapping direct parent,
canonical first” test to explicitly call setDggs with DGGRID_CONFIG immediately
after loading the shared engine and before performing any parent lookups; import
DGGRID_CONFIG alongside the existing test imports so the test always uses the
default ISEA4H configuration.

---

Outside diff comments:
In `@apps/geolibre-desktop/src/components/layout/TopToolbar.tsx`:
- Around line 549-786: Extract a shared label-builder near the repeated
setH3Labels, setS2Labels, setA5Labels, setDggridLabels, setDggalLabels,
setOlcLabels, setGeohashLabels, and setTilecodeLabels calls that accepts each
plugin’s i18n key prefix and returns the common translated fields, including
dynamic cell-count handlers and getTitle. Replace the duplicated common objects
with the helper, then merge each plugin’s unique fields such as gridType,
cellType, quadkey, and includeParent/includeParents before passing them to the
existing typed setters.
- Around line 175-179: Align TopToolbar usage with the removed viewer prop:
update DesktopShell.tsx to stop passing viewer={layoutOptions.viewer}, and
remove any remaining viewer-aware fields or gating from TopToolbar prop types
and its menus/dialogs. Preserve toolbar behavior without viewer-mode checks.

---

Duplicate comments:
In `@packages/plugins/src/plugins/maplibre-olc.ts`:
- Around line 370-384: Update olcGridForBounds to deduplicate generated features
using a key combining each encoded cell and its normalized lngOffset, matching
the guard used by geohashGridForBounds. Check and record the key before pushing
via olcCellFeature, while preserving the existing limit enforcement and viewport
traversal.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f9f6543c-b88c-4e3d-aae3-7b8739756f25

📥 Commits

Reviewing files that changed from the base of the PR and between dc962f9 and 1357bad.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (23)
  • apps/geolibre-desktop/src/components/layout/TopToolbar.tsx
  • apps/geolibre-desktop/src/components/layout/toolbar/PluginsMenu.tsx
  • apps/geolibre-desktop/src/hooks/usePlugins.ts
  • apps/geolibre-desktop/src/i18n/locales/en.json
  • packages/plugins/package.json
  • packages/plugins/src/index.ts
  • packages/plugins/src/plugins/dggs-group.ts
  • packages/plugins/src/plugins/maplibre-a5.ts
  • packages/plugins/src/plugins/maplibre-dggal.ts
  • packages/plugins/src/plugins/maplibre-dggrid.ts
  • packages/plugins/src/plugins/maplibre-geohash.ts
  • packages/plugins/src/plugins/maplibre-h3.ts
  • packages/plugins/src/plugins/maplibre-olc.ts
  • packages/plugins/src/plugins/maplibre-s2.ts
  • packages/plugins/src/plugins/maplibre-tilecode.ts
  • tests/a5-plugin.test.ts
  • tests/dggal-plugin.test.ts
  • tests/dggrid-plugin.test.ts
  • tests/geohash-plugin.test.ts
  • tests/h3-plugin.test.ts
  • tests/olc-plugin.test.ts
  • tests/s2-plugin.test.ts
  • tests/tilecode-plugin.test.ts

Comment thread apps/geolibre-desktop/src/i18n/locales/en.json Outdated
Comment thread packages/plugins/package.json
Comment thread packages/plugins/src/plugins/maplibre-a5.ts Outdated
Comment thread packages/plugins/src/plugins/maplibre-h3.ts
Comment thread tests/dggrid-plugin.test.ts
thangqd and others added 6 commits August 3, 2026 08:44
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/plugins/src/plugins/maplibre-dggrid.ts`:
- Around line 675-680: Update the BFS traversal surrounding maxPops and the loop
in the viewport collection function to throw a RangeError after the loop when
head remains less than queue.length. Preserve the existing collected return path
when the queue is fully processed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 81e5091f-ad72-4d42-aa0b-5bb17bb34061

📥 Commits

Reviewing files that changed from the base of the PR and between 7be6704 and 885ba68.

📒 Files selected for processing (4)
  • apps/geolibre-desktop/src/i18n/locales/en.json
  • packages/plugins/src/plugins/maplibre-dggrid.ts
  • tests/a5-plugin.test.ts
  • tests/dggal-plugin.test.ts

Comment thread packages/plugins/src/plugins/maplibre-dggrid.ts
thangqd and others added 8 commits August 3, 2026 08:58
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
# Conflicts:
#	package-lock.json
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🔍 Cloudflare PR preview

Item Value
Site https://46372398.geolibre-preview.pages.dev
Demo app https://46372398.geolibre-preview.pages.dev/demo/
Commit 39237e3

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🔍 GitHub Pages PR preview

Item Value
Site Deploy failed. See the job log.
Demo app Unavailable
Commit 39237e3

@giswqs

giswqs commented Aug 3, 2026

Copy link
Copy Markdown
Member

@thangqd Merge is still blocked by CodeRabbit. Could you fix the remaining comments or allow maintainer' edits so that I can fix them? Thanks.

@thangqd

thangqd commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

@giswqs CodeRabbit requested changes have been fixed. Please review when convenient. Thanks!

@giswqs

giswqs commented Aug 3, 2026

Copy link
Copy Markdown
Member

CodeRabbit still blocked it as there are some unresolved comments.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@thangqd Automatic reviews are resumed. I will review pull request #1650.

✅ Action performed

Reviews resumed.


Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
apps/geolibre-desktop/src/components/layout/TopToolbar.tsx (2)

1046-1062: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Block project mutations in viewer mode.

The global OPEN_ADD_DATA_EVENT handler still opens AddDataDialog in viewer mode. The project-name input also remains editable and calls setProjectName. A read-only embed can therefore add layers or modify the project name.

  • apps/geolibre-desktop/src/components/layout/TopToolbar.tsx#L1046-L1062: Return before processing OPEN_ADD_DATA_EVENT when viewer is true. Include viewer in the effect dependencies.
  • apps/geolibre-desktop/src/components/layout/TopToolbar.tsx#L1708-L1728: Make the project-name input read-only, or do not render it, when viewer is true.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/geolibre-desktop/src/components/layout/TopToolbar.tsx` around lines 1046
- 1062, Block project mutations in viewer mode: in the OPEN_ADD_DATA_EVENT
handler within the relevant useEffect, return before processing when viewer is
true and include viewer in the effect dependencies; at
apps/geolibre-desktop/src/components/layout/TopToolbar.tsx lines 1046-1062 apply
this handler change. At lines 1708-1728, make the project-name input read-only
or omit it when viewer is true so it cannot call setProjectName.

1580-1587: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Localize the command title.

"View Comments" is user-facing text. Use t() and add the source key to apps/geolibre-desktop/src/i18n/locales/en.json.

As per coding guidelines, apps/geolibre-desktop/src/**/*.{ts,tsx} must use t() for new user-facing UI strings.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/geolibre-desktop/src/components/layout/TopToolbar.tsx` around lines 1580
- 1587, Update the view.comments command in TopToolbar to obtain its title
through t() instead of the hardcoded “View Comments” string, and add the
corresponding source translation key and English value to the locale definitions
in en.json.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/plugins/src/plugins/maplibre-dggrid.ts`:
- Around line 863-877: Keep the automatic-resolution display synchronized during
status-only refreshes: in packages/plugins/src/plugins/maplibre-dggrid.ts lines
863-877, tag the resolution input and value element in renderPanel and update
both with effectiveResolution() from updatePanelStatus when
settings.autoResolution is enabled; apply the same targeted update in
packages/plugins/src/plugins/maplibre-dggal.ts lines 639-653. Also revise the
refresh comments in maplibre-dggrid.ts lines 1057-1059 and maplibre-dggal.ts
lines 827-829 to no longer claim the panel is fully re-rendered.

---

Outside diff comments:
In `@apps/geolibre-desktop/src/components/layout/TopToolbar.tsx`:
- Around line 1046-1062: Block project mutations in viewer mode: in the
OPEN_ADD_DATA_EVENT handler within the relevant useEffect, return before
processing when viewer is true and include viewer in the effect dependencies; at
apps/geolibre-desktop/src/components/layout/TopToolbar.tsx lines 1046-1062 apply
this handler change. At lines 1708-1728, make the project-name input read-only
or omit it when viewer is true so it cannot call setProjectName.
- Around line 1580-1587: Update the view.comments command in TopToolbar to
obtain its title through t() instead of the hardcoded “View Comments” string,
and add the corresponding source translation key and English value to the locale
definitions in en.json.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f89e75a9-14eb-4f6f-873c-4230957f3d8a

📥 Commits

Reviewing files that changed from the base of the PR and between 885ba68 and 10295bd.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (9)
  • apps/geolibre-desktop/src/components/layout/TopToolbar.tsx
  • packages/plugins/package.json
  • packages/plugins/src/index.ts
  • packages/plugins/src/plugins/maplibre-a5.ts
  • packages/plugins/src/plugins/maplibre-dggal.ts
  • packages/plugins/src/plugins/maplibre-dggrid.ts
  • packages/plugins/src/plugins/maplibre-olc.ts
  • tests/dggrid-plugin.test.ts
  • tests/olc-plugin.test.ts

Comment thread packages/plugins/src/plugins/maplibre-dggrid.ts Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/plugins/src/plugins/maplibre-dggal.ts`:
- Around line 636-654: Update the comment immediately above the
updatePanelStatus() call in the pan/zoom handling logic to state that panel
status is updated without rebuilding the whole panel, preserving open color
pickers and focused inputs during gestures.

In `@packages/plugins/src/plugins/maplibre-dggrid.ts`:
- Around line 1251-1262: Update activate to wrap the loadDggrid() await in a
try/catch. When loading fails, set currentError only if the generation counter
still matches, then return false so activation failures do not reject; preserve
the existing generation guard and failure-panel flow.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f89e75a9-14eb-4f6f-873c-4230957f3d8a

📥 Commits

Reviewing files that changed from the base of the PR and between 885ba68 and 10295bd.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (9)
  • apps/geolibre-desktop/src/components/layout/TopToolbar.tsx
  • packages/plugins/package.json
  • packages/plugins/src/index.ts
  • packages/plugins/src/plugins/maplibre-a5.ts
  • packages/plugins/src/plugins/maplibre-dggal.ts
  • packages/plugins/src/plugins/maplibre-dggrid.ts
  • packages/plugins/src/plugins/maplibre-olc.ts
  • tests/dggrid-plugin.test.ts
  • tests/olc-plugin.test.ts

Comment thread packages/plugins/src/plugins/maplibre-dggal.ts
Comment thread packages/plugins/src/plugins/maplibre-dggrid.ts
thangqd added 3 commits August 4, 2026 01:02
CodeRabbit still requested try/catch around activate loads and comments that matched updatePanelStatus instead of a full rebuild.
@thangqd

thangqd commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@giswqs
giswqs enabled auto-merge (squash) August 3, 2026 18:44
@giswqs
giswqs disabled auto-merge August 3, 2026 18:44

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/geolibre-desktop/src/hooks/usePlugins.ts (1)

39-39: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Restore ArcGIS Hub, CKAN, and Socrata in the desktop plugin load path.

usePlugins.ts no longer imports or registers those plugins, while packages/plugins/src/index.ts still exports them. Either add the consolidated Open Data Catalog plugin here and keep the exports consistent, or document/remove this as intentional deprecation.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/geolibre-desktop/src/hooks/usePlugins.ts` at line 39, Update usePlugins
to import and register the consolidated Open Data Catalog plugin so ArcGIS Hub,
CKAN, and Socrata are restored in the desktop load path, keeping the
registration consistent with the exports in packages/plugins/src/index.ts.
♻️ Duplicate comments (1)
tests/dggrid-plugin.test.ts (1)

145-151: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Pin the DGGS configuration before the parent lookup.

loadDggrid returns one shared engine, and dggridGridForBounds calls engine.setDggs(...). This test depends on the configuration left by the earlier tests. The preceding limit test happens to restore the default DGGRID_CONFIG, so the assertion passes today, but the result depends on test order.

Call setDggs explicitly at the start of this test.

♻️ Proposed fix
   it("returns every overlapping direct parent, canonical first", async () => {
     const engine = await loadDggrid();
+    // Other tests reconfigure the shared engine, so pin the DGGS here.
+    engine.setDggs({ ...DGGRID_CONFIG }, 5);
     const [cell] = engine.geoToSequenceNum([[106.6, 10.8]], 5);

Add DGGRID_CONFIG to the import list at Lines 3-13.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/dggrid-plugin.test.ts` around lines 145 - 151, Update the test “returns
every overlapping direct parent, canonical first” to explicitly call the shared
engine’s setDggs with DGGRID_CONFIG before performing the parent lookup, and add
DGGRID_CONFIG to the existing imports. Keep the current parent assertions
unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/plugins/src/plugins/maplibre-dggal.ts`:
- Around line 464-488: Normalize west and east with the existing normalizeLon
pattern at the start of dggalGridForBounds, before the east < west antimeridian
check and full-world span handling. Ensure refresh inputs outside ±180 produce
longitudes within [-180, 180] before any listZones bounding box is constructed.

In `@packages/plugins/src/plugins/maplibre-dggrid.ts`:
- Around line 1343-1357: Update applyProjectState in
packages/plugins/src/plugins/maplibre-dggrid.ts at lines 1343-1357 to call
renderPanel(panelContainer) after refresh() when panelContainer is set, keeping
restored cell type, projection, aperture, color, and checkbox controls
synchronized. Apply the same change in
packages/plugins/src/plugins/maplibre-dggal.ts at lines 1121-1131 so the DGGS
type select and resolution slider reflect restored settings.

In `@tests/dggal-plugin.test.ts`:
- Around line 113-124: Extend the antimeridian bounds coverage around
dggalGridForBounds with a case using wrapped bounds where east is less than
west, matching the form used by tests/dggrid-plugin.test.ts. Assert the returned
cells are present and remain deduplicated, so the east < west split and merge
behavior are exercised.

---

Outside diff comments:
In `@apps/geolibre-desktop/src/hooks/usePlugins.ts`:
- Line 39: Update usePlugins to import and register the consolidated Open Data
Catalog plugin so ArcGIS Hub, CKAN, and Socrata are restored in the desktop load
path, keeping the registration consistent with the exports in
packages/plugins/src/index.ts.

---

Duplicate comments:
In `@tests/dggrid-plugin.test.ts`:
- Around line 145-151: Update the test “returns every overlapping direct parent,
canonical first” to explicitly call the shared engine’s setDggs with
DGGRID_CONFIG before performing the parent lookup, and add DGGRID_CONFIG to the
existing imports. Keep the current parent assertions unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c0b5a6b7-a7b1-40da-9bf9-477f0ad0a3de

📥 Commits

Reviewing files that changed from the base of the PR and between 483c663 and dac9547.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (23)
  • apps/geolibre-desktop/src/components/layout/TopToolbar.tsx
  • apps/geolibre-desktop/src/components/layout/toolbar/PluginsMenu.tsx
  • apps/geolibre-desktop/src/hooks/usePlugins.ts
  • apps/geolibre-desktop/src/i18n/locales/en.json
  • packages/plugins/package.json
  • packages/plugins/src/index.ts
  • packages/plugins/src/plugins/dggs-group.ts
  • packages/plugins/src/plugins/maplibre-a5.ts
  • packages/plugins/src/plugins/maplibre-dggal.ts
  • packages/plugins/src/plugins/maplibre-dggrid.ts
  • packages/plugins/src/plugins/maplibre-geohash.ts
  • packages/plugins/src/plugins/maplibre-h3.ts
  • packages/plugins/src/plugins/maplibre-olc.ts
  • packages/plugins/src/plugins/maplibre-s2.ts
  • packages/plugins/src/plugins/maplibre-tilecode.ts
  • tests/a5-plugin.test.ts
  • tests/dggal-plugin.test.ts
  • tests/dggrid-plugin.test.ts
  • tests/geohash-plugin.test.ts
  • tests/h3-plugin.test.ts
  • tests/olc-plugin.test.ts
  • tests/s2-plugin.test.ts
  • tests/tilecode-plugin.test.ts

Comment thread packages/plugins/src/plugins/maplibre-dggal.ts Outdated
Comment thread packages/plugins/src/plugins/maplibre-dggrid.ts
Comment thread tests/dggal-plugin.test.ts
Re-register ArcGIS Hub/CKAN/Socrata and fetchVectorUrl, normalize DGGAL longitudes, refresh panels after project restore, and cover wrapped antimeridian bounds.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
packages/plugins/src/plugins/maplibre-dggal.ts (1)

471-497: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Preserve full-world longitude spans before endpoint normalization.

For bounds such as [0, south, 360, north], Lines 472-473 normalize both endpoints to 0. Line 494 then sees a zero-width viewport instead of a full-world viewport. listZones() can return an empty or incomplete grid.

Measure east - west before normalization. If the raw span is at least 360, set the bounds to [-180, 180] before the wrapped-bounds split. Add a test for an unwrapped full-world interval.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/plugins/src/plugins/maplibre-dggal.ts` around lines 471 - 497,
Update dggalGridForBounds to measure the raw longitude span before normalizeLon
modifies west and east. For spans of at least 360 degrees, set the normalized
bounds to -180 and 180 before the east < west split, preserving full-world
coverage. Add a test covering an unwrapped interval such as [0, south, 360,
north].
apps/geolibre-desktop/src/hooks/usePlugins.ts (1)

1336-1352: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Match the client validation to the GitHub proxy contract.

githubRawVectorProxyUrl() accepts a GitHub raw URL with a query string. The Worker rejects that source URL because its /github-raw handler requires upstream.search === "". After native and direct browser fetches fail, the proxy path returns HTTP 400 for otherwise matched URLs.

Reject URLs with url.search !== "" here, or intentionally extend the Worker contract and its validation tests.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/geolibre-desktop/src/hooks/usePlugins.ts` around lines 1336 - 1352,
Update githubRawVectorProxyUrl() to reject GitHub raw URLs when url.search is
non-empty, alongside its existing protocol, hostname, and pathname validation.
Keep queryless URLs flowing to GITHUB_RAW_VECTOR_PROXY so the client matches the
Worker’s /github-raw contract.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@apps/geolibre-desktop/src/hooks/usePlugins.ts`:
- Around line 1336-1352: Update githubRawVectorProxyUrl() to reject GitHub raw
URLs when url.search is non-empty, alongside its existing protocol, hostname,
and pathname validation. Keep queryless URLs flowing to GITHUB_RAW_VECTOR_PROXY
so the client matches the Worker’s /github-raw contract.

In `@packages/plugins/src/plugins/maplibre-dggal.ts`:
- Around line 471-497: Update dggalGridForBounds to measure the raw longitude
span before normalizeLon modifies west and east. For spans of at least 360
degrees, set the normalized bounds to -180 and 180 before the east < west split,
preserving full-world coverage. Add a test covering an unwrapped interval such
as [0, south, 360, north].

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d5352afe-abea-4894-989b-ce10fe750cbb

📥 Commits

Reviewing files that changed from the base of the PR and between dac9547 and 37894b3.

📒 Files selected for processing (5)
  • apps/geolibre-desktop/src/hooks/usePlugins.ts
  • packages/plugins/src/plugins/maplibre-dggal.ts
  • packages/plugins/src/plugins/maplibre-dggrid.ts
  • tests/dggal-plugin.test.ts
  • tests/dggrid-plugin.test.ts

Measure longitude span before normalizing endpoints, and reject raw URLs with query strings so the client matches the Worker contract.
coderabbitai[bot]
coderabbitai Bot previously requested changes Aug 3, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/geolibre-desktop/src/hooks/usePlugins.ts`:
- Around line 1343-1347: Update the URL validation in githubRawVectorProxyUrl to
reject credentials, non-default ports, and fragments before constructing the
public proxy URL; validate that username and password are empty, port is empty
or the HTTPS default, and hash is empty alongside the existing protocol,
hostname, search, and pathname checks.

In `@tests/dggal-plugin.test.ts`:
- Around line 140-142: Update the full-world test around dggalGridForBounds to
collect each returned feature’s zone ID and assert that the IDs are unique, then
retain the comparison between the unique/full-world result count and
dggrs.countZones(4). Ensure the assertions verify both no duplicates and
complete zone coverage.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3aa6e093-8fac-4cb4-9e03-123c46935cb2

📥 Commits

Reviewing files that changed from the base of the PR and between 37894b3 and 77b0cc0.

📒 Files selected for processing (3)
  • apps/geolibre-desktop/src/hooks/usePlugins.ts
  • packages/plugins/src/plugins/maplibre-dggal.ts
  • tests/dggal-plugin.test.ts

Comment thread apps/geolibre-desktop/src/hooks/usePlugins.ts
Comment thread tests/dggal-plugin.test.ts Outdated
… zones.

Reject credentialed, non-default-port, and fragment URLs before proxying, and verify the full-world fill has no duplicate zone IDs.
@thangqd thangqd changed the title Add DGGS plugin feat: add DGGS plugin Aug 3, 2026
@giswqs
giswqs enabled auto-merge (squash) August 3, 2026 20:51
@giswqs

giswqs commented Aug 3, 2026

Copy link
Copy Markdown
Member

The dependency audit CI failed. That's the one last blocker.

@giswqs

giswqs commented Aug 3, 2026

Copy link
Copy Markdown
Member

The dependency audit failure is not caused by your PR. It is being fixed in #1688. You can rebase from main after the PR 1688 is merged.

@giswqs
giswqs dismissed coderabbitai[bot]’s stale review August 3, 2026 21:14

Dismissing to unblock merge: remaining thread is a trivial style nit (wrapLongitude simplification); will follow up separately.

@giswqs
giswqs merged commit f508f65 into opengeos:main Aug 3, 2026
15 of 16 checks passed
@giswqs

giswqs commented Aug 3, 2026

Copy link
Copy Markdown
Member

@thangqd This is an amazing plugin! I really like the automatic resolution feature. Thank you for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants