Skip to content

SDK: give a panel tree its nodes and choose one (RustGIS #1080) #2

Closed

Description

@jgregoriorincon

Context

opengeos/RustGIS#1080 added a fifth panel widget, tree: nodes the plugin gives (themes and their datasets, say), with an optional search box that RustGIS filters on its own ("search": true). A tree's nodes come in any answer as panel.items.<id>.nodes = [{"id", "label", "count", "children"}], and its value is the chosen node's id, or null. RustGIS documents it in docs/plugins.md › A panel. It isn't in a release yet (it landed after 0.4.0, which refuses a manifest with a tree).

The Rust SDK gets it in opengeos/rustgis-plugins#32: a Node type, Panel::nodes and Request::panel_str.

Problem

The Python SDK (plugin/rustgis_plugin.py) has its own Panel, which doesn't know the tree:

  • there is no way to give a tree its nodes, other than writing panel.items[...]["nodes"] by hand;
  • Panel.value is typed bool | int, so choosing a node (a string) or none (None) goes against its own signature;
  • the README lists the panel's widgets as a slider, a checkbox, texts and buttons.

Reading the chosen node already works (req.panel.get("catalogue") gives the id or None).

Proposal

  1. plugin/rustgis_plugin.py, standard library only, as the rest of the SDK:
    • a Node (id, label, count, children), or a node(...) function returning the dict, matching the Rust SDK's names;
    • Panel.nodes(widget, nodes), which answers items.<widget>.nodes (and leaves out count and children when they are empty);
    • Panel.value typed bool | int | str | None, its docstring saying a tree takes a node's id, or None for none.
  2. tests/test_sdk.py: nodes with counts and children, a chosen node, none chosen, an empty tree.
  3. README.md: the tree among the panel's widgets, and the RustGIS version it needs.

The panel starter can stay as it is.

I'd like to take this one, after opengeos/rustgis-plugins#32, so both SDKs use the same names.

Activity

  1. jgregoriorincon commented on Oct 31, 2026

    @jgregoriorincon
    ContributorAuthor

    opengeos/rustgis-plugins#33 has merged, so this is unblocked. I'm starting on it now, using the same names as the Rust SDK (Node, Panel.nodes).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions