[Feature]: Compact plugin panels and default shortcuts for attribute editing

Open
#2,315 4 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
rust, wasm

Research direction

Start with crates/plugins/src/panel.rs and the existing panel declarations, then trace validation in crates/plugins, rendering and shortcut lifecycle in crates/ui-egui, and the SDK/docs schema. The issue proposes several coordinated features and tests, so first agree with maintainers on a smaller starting slice. For that slice, done means preserving old manifests while adding and testing the selected layout or shortcut behavior.

Written by the indexing model from the issue text.

Description

What problem does this solve?

I'm adapting a keyboard-driven attribute editing workflow from QGIS to a Rust WebAssembly plugin. I've tested it in RustGIS 0.7.0 on Windows, including the desktop panel, attribute edits, field locks and rollback after a failed command.

The editing commands work, but the panel ends up looking very different from the workflow it replaces. A small editor needs a layer picker, sorting and filtering, feature navigation, then a compact toolbar and editable fields. With the current panel API, these become a long vertical form and rows of text buttons. Putting a button for every preset on the ribbon makes that worse; the presets are meant to be keyboard actions.

This overlaps with #1260, but forms already provide text entry in the version I tested. The gaps here are compact layout, default shortcuts and keeping internal session state separate from form values.

Proposed solution

Could the Rust plugin API support the following additions? I'd start with layout and shortcuts, rather than trying to add everything at once.

Compact rows and field controls

It would help to have a row/group declaration, host-provided icons on panel buttons, and an optional lock control beside an editable field. For example:

Layer picker
Sort field                                  Ascending
Filter                                      Refresh  Clear
Position                                    First  Previous  Next  Last
Preset settings                             Fields  Undo  Settings
status                                      [value] [lock]
rank                                        [value] [lock]

This should stay declarative and use RustGIS's existing egui widgets, icons, focus handling and themes. I don't need plugins to inject arbitrary drawing code or ship another UI toolkit. Icon-only controls would still need an accessible label and tooltip. Groups should have bounded depth and a total widget limit.

Here is a rough Rust shape for discussion, not a tested patch:

#[derive(Clone, Copy, Debug, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum PanelLayout {
    #[default]
    Vertical,
    Horizontal,
}

#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum ShortcutScope {
    PanelVisible,
    MapFocused,
}

#[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DefaultShortcut {
    pub sequence: String,
    pub scope: ShortcutScope,
}

Optional layout/icon fields could extend the existing panel declarations. A lock could be an ordinary plugin command attached to a form field, not a host-wide lock. Existing manifests should keep their current appearance.

Default shortcuts for plugin commands

The keyboard settings already list plugin commands. Letting a command declare a default such as Alt+1 would make installation much easier than assigning nine preset keys by hand.

User bindings should always win. Conflicts should be reported rather than replacing another shortcut. Defaults should be removed when the plugin is disabled or unloaded, and scoped so they do not interfere with ordinary text entry. This is a request for normal host-managed bindings, not raw keyboard interception.

Bounded, session-only plugin state

At present, I keep a captured selection and its expected values in a hidden form text field. That works for small captures, but the host clips a text field at 4,000 characters. I now reject oversized captures before returning them and test the boundary, including rollback if an edit makes the serialized state too large.

A small host-held state store would avoid using a UI field as storage. It could have per-plugin and global quotas, fail explicitly when full, and be cleared on project replacement and plugin unload. host.settings is useful for preferences, but persisted settings are not the right place for selection snapshots or Undo state. A project/load generation in requests would also let a plugin reliably reject a capture from an earlier project instance.

Layer-scoped save and plugin-scoped Undo could be separate follow-ups. I understand why GeoPackage/PostGIS save operations and traversal of host Undo history are reserved. I am not asking to remove those checks or substitute project saving for saving layer edits. A future save control should be a user-initiated host action with the appropriate source permissions and confirmation.

Implementation and tests

The likely areas are crates/plugins for declarations and validation, crates/ui-egui for panel rendering and shortcut lifecycle, and the SDK/docs/registry validator for the matching public schema. The layout work should not need another dependency or a plugin ABI break.

I'd expect tests for old manifests, layout limits, missing commands, accessible labels, shortcut conflicts and user overrides, disable/reload cleanup, and state quotas/project replacement. Desktop checks should cover light/dark themes, narrow panels, keyboard focus and editing without any preset buttons. Data-sized reads or edits should use the existing background/progress/cancellation paths rather than holding the window.

I checked the issues and the Plugins section of the roadmap before opening this. If a smaller first step fits the project better, rows/icon buttons and default shortcuts are the parts that would help this workflow most.

Estimated scope

Wishlist: plugin interface changes that need maintainer coordination before implementation.

Alternatives considered

I'm using the existing controls and manual shortcut assignment for now. Separate preset buttons were not a good substitute for the keyboard workflow. Forking the desktop app or shipping an external UI would add a maintenance burden I'd rather avoid.

Source references for the version reviewed:

Dominant language
Rust
Stars
1.9k
Forks
268
Avg merge
11h 1m
Merged PRs (30d)
942

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from opengeos/RustGIS

All issues in opengeos/RustGIS

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.