Skip to content

feat(flexibility-registry): add Flexibility Registry tab with change export - #377

Open
MyLittleCrab wants to merge 2 commits into
UI5:masterfrom
MyLittleCrab:flexibility-registry
Open

feat(flexibility-registry): add Flexibility Registry tab with change export#377
MyLittleCrab wants to merge 2 commits into
UI5:masterfrom
MyLittleCrab:flexibility-registry

Conversation

@MyLittleCrab

Copy link
Copy Markdown

Motivation

When a developer changes a control property in the UI5 Inspector's Properties tab, that change currently lives only in the inspected page and is lost as soon as the page reloads. To persist such adjustments in an OpenUI5/SAPUI5 app, the developer had to export them manually into the changes folder of a flexibility/adaptation project — a tedious, error-prone process.

What's new

A new Flexibility Registry tab in the UI5 panel (between Elements Registry and AI Assistant) that automatically records every property change made through the inspector and lets you export the result.

The tab consists of two panes:

  • Master view — a sortable DataGrid listing each registered change with columns for changeType, selector.id, selector.type, content.property and content.newValue, plus Download and Clear toolbar buttons.
  • Detail view — an ACE-based JSON editor that shows the full change-file content of the selected entry, following the light/dark DevTools theme.

How it works

  1. Whenever a control property is edited via the inspector's DataView, the injected script triggers a new do-control-flexibility-property-change action (app/scripts/injected/main.js).
  2. The change is converted into a flexibility change file by the new flexibilityRegistry in app/vendor/ToolsAPI.js, using the same structure that Change.createInitialFileContent produces (fileType: "change", changeType: "propertyChange", layer: "VENDOR", packageName: "$TMP", namespace: "apps/<projectId>/changes/", support.generator: "Change.createInitialFileContent", etc.). The control class is read from the UI5 metadata and used as selector.type; the inspected app's component name is resolved via the sap.ushell AppLifeCycle service and used as reference.
  3. A new stateRegistry keeps the first-observed value per (controlId, changeType, property). Changes are de-duplicated by (selector.id, content.property), and a property restored to its initial value is automatically removed from the list.
  4. Clicking Download zips all registered changes into a single FlexibilityRegistry.zip (sap/ui/core/util/File + JSZip), where every change is a separate id_<timestamp>_<changeType>.change file. The archive can be unpacked directly into the changes folder of a flexibility/adaptation project in the Web IDE / Business Application Studio.

API additions

New public ToolsAPI methods, all backed by unit-tested modules:

  • getFlexibilityInformation() / addFlexibilityInformation(data) / removeFlexibilityInformation(change) — register, read and remove flexibility changes (the registry data is pushed to the panel per frame alongside the existing element registry).
  • downloadFlexibilityInformation() — generate and save the zip archive.
  • isStateExists(key) / setStateValue(key, value) / getStateValue(key) — initial-value tracking used to drop revert-to-initial edits.

Wiring

  • New tab markup and splitter in app/html/panel/ui5/index.html; the panel (app/scripts/devtools/panel/ui5/main.js) caches flexibilityInformation per frame, keeps the grid in sync via a new on-control-flexibility-property-change message, and forwards the download/clear/select actions.
  • A new largeicon-download icon was added to the DataGrid sprite map (app/scripts/modules/ui/datagrid/UIUtils.js).
  • Styles live in app/styles/less/modules/FlexibilityRegistry.less (imported in base.less); the compiled light/dark CSS was regenerated.

Tests

  • tests/modules/ui/FlexibilityRegistryMasterView.spec.js — constructor defaults/overrides, grid rendering, setData (incl. duplicate prevention and undefined/null input), selection handler, clear-button behavior.
  • tests/modules/ui/FlexibilityRegistryDetailView.spec.js — editor creation/configuration, light/dark theme selection, update and clear.
  • Existing grunt test / lint suites stay green.

Authors

  • Denis Chubarov — main functionality, created for the UI5 developer community in Telegram (https://t.me/ui5_js). Version 0.9.10. LinkedIn
  • Roman Nosov — merged the outdated fork sources with the main repository and wrote the tests. LinkedIn

@cla-assistant

cla-assistant Bot commented Aug 15, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@PetyaMarkovaBogdanova

Copy link
Copy Markdown
Contributor

Hi @MyLittleCrab ,
thank you for your interest and contribution in UI5 Inspector.
Our team will start looking at it ASAP.
Regards,
Petya Markova.
UI5 Developer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants