Repository navigation
feat(ui): offer a gp.run tool's parameter values by kind in the Script pane - #827
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Shared parameter-kind filtering crates/ui-egui/src/panes.rs, crates/ui-egui/src/modelbuilder.rs |
Shared helpers filter layers and fields by parameter kind and resolve input datasets and tables. Geoprocessing pane choices and Model Builder use the shared layer selection. |
Script parameter value completion crates/ui-egui/src/scriptcomplete.rs, docs/user-guide/analysis.md |
The Script pane offers supported values for gp.run parameters, with matching help and icons. Tests cover filtering, unsupported contexts, and accepting choices. The user guide describes the completion options. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Feature
Sequence Diagram(s)
sequenceDiagram
participant ScriptPane
participant ToolSpec
participant PanesHelpers
participant Session
ScriptPane->>ToolSpec: Resolve the named tool parameter
ScriptPane->>PanesHelpers: Match the parameter kind
PanesHelpers->>Session: Resolve matching layers, fields, or input dataset
Session-->>ScriptPane: Return matching input values
ScriptPane-->>ScriptPane: Offer matching values or parameter choices
Suggested reviewers: giswqs
Merge Risk: 
Minimal · up to 9f642
-
No additional merge-blocking issue is established. The previously reported coordinate-field completion cost remains worth monitoring on large datasets.
Pre-merge checks: 
5
-
Full details: Linked Issues check
-
Explanation
Issue [
#788] is an active direct target. The diff addstool_valuehandling for quoted values in agp.run"params"object. It filters layers with sharedtakes_layerrules, offers compatible fields from the first layer input with sharedtakes_fieldrules, and preserves choice order.value_idsperforms case-insensitive prefix matching.Of::ToolFieldsandOf::Choicesuse the existing value insertion path, and layer, table, and field help and icons are implemented. The diff excludes unsupported kinds andtask.addStepvalues. The refactor updates the tool form and Model Builder to use the shared rules. The added tests cover layer, table, field, choice, unsupported-value, ordering, help, icon, and acceptance behavior.
Full details: Out of Scope Changes check
-
Explanation
The changes stay within issue [
#788]. Thepanes.rshelpers centralize the layer and field rules required by the issue. The Model Builder update consumes that shared layer-parameter rule. The script completion tests and user-guide update document and verify the requested behavior. No unrelated feature or unrelated file change is shown in the reviewed diff.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 95.24% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 21 functions across 3 files. (1 skipped: 1 unsupported.)
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- 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.
A rabbit taps a script with care,
Matching fields and layers there.
Choices hop into the line,
Tables join the list in time.
The closing quote falls into place.
Comment @coderabbitai help to get the list of available commands.
Code reviewI read the whole diff and found nothing that needs fixing before merge. I couldn't build or run the tests here, so this is a read-through only. Bugs
Security
Performance
Quality
AGENTS.md
Change sizeCompared: the whole PR against main (merge base 45b28ec to PR head 9f642a2)
|
Code reviewThe change is a clean refactor plus a useful feature. It moves the form's layer and field filters into shared helpers (
The new tests cover most of the behaviour. Bugs
Security
Performance
Quality
AGENTS.md
Change sizeCompared: the whole PR against main (merge base 45b28ec to PR head 9f642a2)
|
📖 Docs preview
GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the |
Summary
In a
gp.runline's"params", the Script pane now offers the values the tool's parameter takes, by its kind, as the tool's form offers them:Table · N rowsbeside them)."units": "→Kilometers,Meters,Miles,Feet).Nothing is offered for a number, a bool, a path, a text, several layers in one string, or in a
task.addStepline's"params".Two commits:
refactor(ui): one rule for the layers and fields a tool's parameter takes (takes_layer,takes_field,first_layer,input_dataset,input_tableinpanes.rs), used by the tool's form and the Model Builder'ssource_layer. The form behaves as before.feat(ui):tool_valueinscriptcomplete.rsreads the value being typed from the"params"object's{, so the scanner is unchanged;OfgainsToolFields(input)andChoices. The user guide's Script section says so.Known limits, as for a
"field"value today: no fields are offered when the input's name holds escaped quotes; a coordinate field's list reads up to 1000 rows per field each time the offer changes (the form keeps it cached).Testing
cargo xtask ci. Everything passes exceptrustgis-render'sa_curved_labels_halos_go_under_all_its_letters, which fails on main too with thin system fonts (test: fix main CI on macOS and Windows (thin-font halo test, sign-in cancel race) #820).a_tools_values_are_offered_by_kind,a_tools_values_have_help_and_icons,a_tools_choice_is_accepted(kittest, with the accessibility check on)."units": "mi→Miles, accepted with Enter; nothing for"distance": "; the Buffer and Summary Statistics forms and a Model Builder Dissolve node unchanged.Related issue
Closes #788
Summary by CodeRabbit
gp.runcalls, including compatible layers, tables, fields, and predefined choices.