[Feature]: Plugin tools: nested toolbox groups in the Tools pane (QGIS-style module structure)

Aperta Adatta ai principianti
#3,022 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
83/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Leggi il ramo degli strumenti dei plugin in crates/ui-egui/src/panes.rs e confrontalo con la logica annidata di CollapsingHeader del ramo GeoLibre. Controlla come crates/plugins/src/tools.rs aggiunge il prefisso Plugins › , quindi prova percorsi di toolbox annidati e intercalati nel riquadro Tools. Il lavoro è concluso quando i percorsi vengono visualizzati come gruppi annidati, i gruppi duplicati compaiono una sola volta indipendentemente dall’ordine degli strumenti e i percorsi senza › rimangono piatti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Before you start
What problem does this solve?

We port the Isoliner QGIS plugin (79 tools in 10 numbered sections, some with sub-sections) to RustGIS as a process plugin: https://github.com/Valery35/isoliner-rustgis (v0.1.12). We want the Tools pane to show the same tree as QGIS Processing:

    1. Grid and isolines
    • 1.01 2D Kriging
    • 1.05 Declustering (weights)
    • ...
    1. Topography
    • 2.01 DEM download
    • ...
    1. Topography: diagnostics and cleanup

Today plugin tools get only one flat level. In crates/ui-egui/src/panes.rs the plugin_tools branch groups tools by the exact toolbox string with boxes.dedup() and uses b.rsplit(" › ").next() only as the label. A toolbox "Isoliner › 1. Grid and isolines" is shown as one flat 1. Grid and isolines group; it is not nested. The GeoLibre branch right above splits on " › " (level(x, 1), level(x, 2)) and builds nested CollapsingHeaders.

The flat grouping also depends on tool order: boxes.dedup() removes only consecutive duplicates. If tools with the same toolbox are interleaved in plugin.json, the same group is drawn several times. We sort the tools by toolbox in our manifest to work around it, but the UI should not depend on the order.

A second, related blocker: plugin tools cannot take raster layers, so most Isoliner tools (topography, kriging, subsidence) stay as ribbon commands instead of Tools-pane tools. That is tracked separately in #1933.

Proposed solution

Use the same › splitting in the plugin tools branch as in the GeoLibre branch:

  1. Split toolbox on " › " and build nested headers by level, exactly as geolibre_section does with level(x, 1) and level(x, 2) (and deeper if needed).
  2. Keep the Plugins › prefix that crates/plugins/src/tools.rs adds, or strip it before splitting, so a manifest toolbox like "1. Grid and isolines › Variograms" becomes Plugins › 1. Grid and isolines › Variograms.
  3. Replace boxes.dedup() with a sort + dedup (or a BTreeMap/HashSet of paths), so interleaved tools cannot create duplicate groups.
  4. Keep the current behaviour when a toolbox has no ›: one flat group, as now.

Example manifest:

{
  "id": "isoliner",
  "tools": [
    {
      "id": "declustering",
      "name": "1.05 Declustering (weights)",
      "toolbox": "1. Grid and isolines › Variograms",
      "...": "..."
    },
    {
      "id": "examplewells",
      "name": "1.10 Example wells (demo)",
      "toolbox": "1. Grid and isolines › Examples",
      "...": "..."
    },
    {
      "id": "contoursplit",
      "name": "2.08 Split contours for validation",
      "toolbox": "2. Topography",
      "...": "..."
    }
  ]
}

Tools pane:

Plugins
  1. Grid and isolines
    Variograms
      1.05 Declustering (weights)
      1.06 Variogram (experimental)
    Examples
      1.10 Example wells (demo)
  2. Topography
    2.08 Split contours for validation

This mirrors QGIS Processing, where the provider (Isoliner) has numbered groups and sub-groups, and the same › convention is already used by GeoLibre.

Estimated scope

Small: crates/ui-egui/src/panes.rs (the plugin tools branch), maybe a helper shared with the GeoLibre branch. No engine or manifest change: the toolbox string already carries the path.

Alternatives considered
  • One flat level with numbered prefixes. Works today, but does not match QGIS and becomes unreadable with 79 tools.
  • A separate groups array in the manifest. More schema and validation; the › convention is already in use.
  • Rely on tool order and boxes.dedup(). Fragile: it breaks as soon as two tools of the same group are not adjacent.
Additional context

RustGIS 0.8.0. Plugin: https://github.com/Valery35/isoliner-rustgis (process plugin, plugin.json tools section). Raster inputs for plugin tools are tracked in #1933.

Lingua principale
Rust
Stelle
1.9k
Fork
268
Merge medio
8h 21m
PR unite (30g)
936

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di opengeos/RustGIS

Tutte le issue di opengeos/RustGIS

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.