Skip to content

Panel trees: build.py accepts them, the SDK gives their nodes and reads the chosen one - #33

Merged
giswqs merged 1 commit into
opengeos:mainfrom
jgregoriorincon:feat/panel-tree
Oct 29, 2026
Merged

giswqs merged 1 commit into
opengeos:mainfrom
jgregoriorincon:feat/panel-tree

Conversation

@jgregoriorincon

Copy link
Copy Markdown
Contributor

Closes #32.

opengeos/RustGIS#1080 added the tree panel widget. This repository refused it: build.py didn't know the kind, and the SDK couldn't give a tree its nodes or read the chosen one.

Changes

  • scripts/build.py: tree is a panel kind. As PanelDecl::validate in RustGIS, search must be true or false and is for trees only; a tree has no default, min, max, steps or text (the rules the other non-slider kinds already had).
  • SDK: a Node type (id, label, count, children, with new, count, child and children); Panel::nodes(id, nodes); Request::panel_str(id) for the chosen node's id. Panel::value documents choosing a node by id, or none with Value::Null.
  • docs/develop.md › A panel: the tree among the widgets, its limits, that its search box is RustGIS's own (the plugin only hears of the chosen node), an example with Node, and the version it needs.

Verification

  • cargo test -p rustgis-plugin (a new test, panel_trees_take_nodes_and_give_the_chosen_one), clippy for wasm32 with -D warnings, cargo fmt --check, python scripts/build.py --check (the 9 registry plugins still pass).
  • check_panel against 11 manifests (a tree with and without search, search on other kinds or not a boolean, a tree with default, min, steps, text, an unknown command, no id): it accepts and refuses what RustGIS's PanelDecl::validate does.
  • The SDK's answers through RustGIS itself: a scratch crate on this branch's SDK and RustGIS main's rustgis-plugins crate fed Panel::nodes and value to PanelState::apply. Nodes, counts, children, the chosen node in the same answer, choosing none and an empty tree were all taken.
  • RustGIS 0.4.0 refuses a manifest with a tree ("panel item kind 'tree' isn't text, checkbox, slider or button"), hence the minRustgisVersion note.

Not in this PR

  • The Python SDK (rustgis-python-plugin-template, plugin/rustgis_plugin.py) has its own Panel, which can't give nodes either (and types value as bool | int). That is a change in that repository.
  • Refusing a tree in build.py when minRustgisVersion is older than the first release with trees (the open question in Support the panel tree widget (RustGIS #1080) in build.py, the SDK and the docs #32): left until that version is known.

@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 9e815071-0c30-4cda-82aa-2f13378e9592
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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 added the claude-review Ask the Claude Code review to review this pull request label Oct 29, 2026
@github-actions

Copy link
Copy Markdown

Code review

Bugs

  • None found. check_panel_item rejects search on non-trees and non-boolean values, and a tree falls through the non-slider branch, so default, min, max, steps and text are refused as described. (confidence: medium-high)

Security

  • None. The changes are the build check, the SDK's JSON builders and docs. They add no I/O and no new host requests.

Performance

  • None. Node to Value conversion is recursive, but RustGIS caps trees at 5,000 nodes and 8 levels.

Quality

  • Nit (low): Node's public fields and the Node builder methods lack doc comments, unlike the rest of the SDK's public API. The Node struct doc covers the fields only briefly.
  • Nit (low): the SDK doesn't enforce the 5,000-node, 8-level and unique-id limits. It documents them, and RustGIS drops the excess silently. That's acceptable, but a debug assertion or a note in Node's docs would help.
  • Nit (low): build.py doesn't check that a tree has an id or label. The PR says the id rule is already covered elsewhere, and I didn't verify that here.

CLAUDE.md

  • No CLAUDE.md guidelines were violated in the changed files that I could identify.

Scope

  • The PR changes only the SDK, the scripts and the docs. It adds no plugin source.

Checked: the full diff, check_panel_item in context, and the new SDK test (which covers panel_str, nodes with nested children and counts, choosing none, and an empty tree). I did not run the tests.

Change size

The whole PR against main (merge base 61bd755 to PR head 396c5bc).

Metric Value
Files changed 3 (0 added, 3 modified, 0 removed, 0 renamed)
Size before 99.4 KB
Size after 104.0 KB
Total size change +4.6 KB
File Before After Change
sdk/src/lib.rs 28.1 KB 31.6 KB +3.5 KB
docs/develop.md 16.0 KB 16.9 KB +927 B
scripts/build.py 55.3 KB 55.6 KB +242 B

@giswqs
giswqs merged commit fbbd781 into opengeos:main Oct 29, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude-review Ask the Claude Code review to review this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support the panel tree widget (RustGIS #1080) in build.py, the SDK and the docs

2 participants