Skip to content

feat: expose read-only layer queries to external plugins - #1784

Draft
Jihkk wants to merge 2 commits into
opengeos:mainfrom
Jihkk:feat/external-plugin-query-api
Draft

feat: expose read-only layer queries to external plugins#1784
Jihkk wants to merge 2 commits into
opengeos:mainfrom
Jihkk:feat/external-plugin-query-api

Conversation

@Jihkk

@Jihkk Jihkk commented Aug 8, 2026

Copy link
Copy Markdown

Summary

  • expose optional read-only layer and feature query methods to external plugins
  • expose the selected layer, all selected features, sketch features, and selection-change subscriptions
  • document compatibility and cleanup behavior for plugin authors
  • add focused tests for selection, layer lookup, sketch filtering, missing IDs, and unsubscribe behavior

Why

External plugins can add layers, but they currently cannot inspect GeoLibre's current layer list or feature selection through the public plugin API. Plugins that need to run an analysis for a user-selected feature therefore have no supported read-only path to obtain that context.

The new methods remain optional so existing plugins can continue to run against older GeoLibre hosts. The query surface does not mutate the application store, and subscription callers receive an unsubscribe function for plugin cleanup.

API

  • listLayers()
  • getLayerFeatures(layerId)
  • getSelectedFeatures()
  • getSelectedLayerId()
  • getDrawnFeatures()
  • onSelectionChange(callback)

Validation

  • node --import tsx --test tests/plugin-query-api.test.ts — 7 passed
  • npm run lint — 0 errors (40 existing warnings)
  • npm run build — passed

The API was also exercised from an external hydrology plugin in the Tauri desktop during a synthetic end-to-end workflow.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5d57b2de-3eb7-454e-a187-3d1e93932a8b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

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.

1 participant