openremote icon indicating copy to clipboard operation
openremote copied to clipboard

JSON Forms: Investigate performance issues

Open Ekhorn opened this issue 9 months ago • 4 comments

User Story

As a integrator I want the UI to feel snappy, so that I can quickly configure the assets I want.

Description

The JSON Forms re-renders for each input present even though only 1 value is changed.

Acceptance Criteria

  • [ ] 1. The frontend inputs render faster

Implementation Notes

Ekhorn avatar Mar 21 '25 15:03 Ekhorn

Seems that @Hackerberg43 may have resolved the issue https://github.com/openremote/openremote/compare/master...Hackerberg43:openremote:enhancement/or-asset-viewer-updating

Ekhorn avatar Dec 03 '25 16:12 Ekhorn

Also the edit page seems to be saving values to the database (without pressing save), which shouldn't be happening, might be picked up in this issue if there is time.

Ekhorn avatar Dec 03 '25 16:12 Ekhorn

Also the edit page seems to be saving values to the database (without pressing save), which shouldn't be happening, might be picked up in this issue if there is time.

Could not reproduce this, might be only on the referenced branch.

Tried the following to test this.

{
  "type": "SimulatorAgentLink",
  "id": "...",
  "replayData": [
    {
      "timestamp": 1,
      "value": 10
    }
  ],
  "schedule": {
    "start": 1764630000000,
    "recurrence": "FREQ=SECONDLY"
  }
}

Ekhorn avatar Dec 03 '25 16:12 Ekhorn

Hi Koen,

The _onMetaItemModified function is triggering this which is coupled to an event on line 435 or-edit-asset-panel:

content = html`<or-mwc-input @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this._onMetaItemModified(attribute, metaItem, ev.detail)}" .type="${InputType.JSON}" .value="${metaItem.value}"></or-mwc-input>`;`
    protected _onMetaItemModified(attribute: Attribute<any>, metaItem: NameValueHolder<any>, detail: OrInputChangedEventDetail | undefined) {
        metaItem.value = detail ? detail.value : undefined;
        attribute.meta![metaItem.name!] = metaItem.value;
        this._onModified();
    }

And as an agentlink with json form is also a metaitem, it follows the same behavior?

Hackerberg43 avatar Dec 04 '25 12:12 Hackerberg43