Skip to content

fix: show Inspect UI5 element only when UI5 panel is active - #389

Merged
NakataCode merged 4 commits into
masterfrom
context-menu-visibility
Oct 26, 2026
Merged

NakataCode merged 4 commits into
masterfrom
context-menu-visibility

Conversation

@NakataCode

@NakataCode NakataCode commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The "Inspect UI5 element" right-click option was always visible on UI5 pages, but silently did nothing unless the UI5 Inspector panel was actively open in DevTools.

Solution

Establish a persistent port from the DevTools page to the background service worker. When DevTools close, the port disconnects and the context menu is removed. Combined with the existing panel show/hide logic, the option now only appears while the UI5 Inspector panel is active.

The panel state is persisted in chrome.storage.session so it survives MV3 service-worker eviction/respawn, and a startup reconciliation step removes any orphaned context menu left behind by a previous worker generation.

Additional Fix: Highlight Overlay Clearing

The blue highlight overlay (shown when hovering a control in the tree / elements registry) could get stuck on the page. The overlay's original self-clear — hiding itself on mouseover — stopped working once the wrapper was given pointer-events: none, so it no longer received page hovers.

The overlay is now cleared in all the cases where the inspector stops being the focus:

  • Moving the cursor out of the panel onto the page — a mouseleave listener on the panel root broadcasts a hide message.
  • Switching away from the UI5 panel (including via keyboard) and closing DevTools entirely — handled by the panel-hide and port-disconnect paths, which also clear highlights in all frames.

@kgogov
kgogov force-pushed the context-menu-visibility branch from e300eb6 to a8563fb Compare October 26, 2026 14:43
@NakataCode
NakataCode merged commit a26a859 into master Oct 26, 2026
2 checks passed
@NakataCode
NakataCode deleted the context-menu-visibility branch October 26, 2026 15:00
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