Skip to content

Fix editor reloads, Safari hotspots and raw-edit cancellation - #308

Open
alcatron wants to merge 4 commits into
Cacti:developfrom
alcatron:fix/editor-reliability-20261016
Open

alcatron wants to merge 4 commits into
Cacti:developfrom
alcatron:fix/editor-reliability-20261016

Conversation

@alcatron

Copy link
Copy Markdown
Contributor

Description

Saving changes could keep a stale editor snapshot, Safari could miss node/note hotspots after scrolling, and cancelling raw edits closed the properties dialog. Refresh the saved document correctly, resolve Safari hotspots in logical coordinates and return Cancel/close to the originating properties without losing its unsaved fields.

Related work

Follow-up to #300, #301 and #303.

Validation

PHP 8.3 isolated Cacti-layout fixture: 292 tests / 5,894 assertions; editor reload, Safari hotspots, raw Cancel and context-menu browser checks. PHP/JavaScript syntax, whitespace and release manifest checks pass.

Local coverage extensions are unavailable; CI coverage and review results are pending.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Hotspot hover leaves an inline pointer cursor that overrides the crosshair during link placement.

1 open finding
What changed in this PR

This follow-up improves editor refreshes, Safari hotspot selection, and raw-configuration cancellation.

Changes:

  • Reload saved editor snapshots reliably.
  • Resolve image hotspots using logical coordinates.
  • Restore the originating properties dialog and preserve drafts when cancelling raw edits.
File Description
weathermap-cacti-plugin-editor.php Places hotspot data alongside the map image.
tests/​Support/​EditorNotesEngineRegression.php Supplies the map filename for updated markup.
tests/​Browser/​EditorReloadTest.cjs Tests fresh-document reloads and URL cleanup.
tests/​Browser/​EditorHotspotTest.cjs Tests scaled, scrolled hotspot selection.
tests/​Browser/​EditorContextMenuTest.cjs Tests deletion actions and dialog closure.
tests/​Browser/​ConfigCancelTest.cjs Tests cancellation and preserved properties drafts.
js/​editor.js Implements reload, hotspot, and dialog behavior.
CHANGELOG.md Records the editor fixes.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread js/editor.js

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

No blocking defects were identified, but pending CI results and Safari-specific behavior need final confirmation.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
D Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
D Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

}};
const context = {URL, window, $: () => ({val: () => 'map.conf'})};
vm.createContext(context);
vm.runInContext(navigation, context);
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.

3 participants