Repository navigation
Add two-step Undo and Redo to the map editor - #316
Conversation
|
Addressed the two previously missed findings from the latest review in a5fb6a3:
The included-scale ordering finding is also fixed, with an inline reply and resolved thread. Validation: 321 PHP tests / 6,291 assertions, 100% required PHP patch coverage (229/229 lines), browser history regression, manifest, translation-template and whitespace checks pass. Fresh automated checks are still needed for this commit. |
|
Resolved the current develop merge conflicts in a557b17. GitHub now reports this PR as MERGEABLE; #311 is also MERGEABLE. #316 should still be merged last. Fresh validation after the merge:
The manual browser environment is an isolated disposable map with Cacti authentication/database stubs. It does not substitute for a final authenticated Cacti deployment smoke test. The latest commit also needs its new GitHub checks/review; previous-head check results should not be treated as results for this head. |
|
Updated in 13d2aeb after #311 and #314 merged:
This remains the final feature PR for the release. Fresh GitHub checks/review are required on this new head; the authenticated Cacti deployment smoke-test limitation noted above still applies. |
|




Description
Accidental map moves and deletions currently require manual repair. Add Undo and Redo tiles at the top right of the editor, with two saved steps backward or forward and action-specific tooltips. A new edit clears Redo; unchanged and failed saves do not consume a step.
Duplicated browser tabs receive separate histories; same-tab reloads preserve history. Ownership uses Web Locks with a SharedWorker fallback for HTTP installations.
History covers nodes, links, notes, via points, map properties, colours and raw object configuration. Undoing a node deletion restores its connected map links. Ctrl/Cmd+Z and Ctrl/Cmd+Shift+Z are supported; text fields retain native Undo, and open dialogs must be saved or cancelled first.
Snapshots use private temporary storage outside the web root, separately from Cacti's concurrently written session rows. Existing directory locks, revision checks, INCLUDE/path identities, managed-image checks and atomic writes protect restores. History expires after four hours and is bounded to eight map/tab histories and 8 MiB per session. Image-library files, map-file deletion, Cacti devices/graphs and personal editor preferences are outside this history. No database migration is required.
Includes editor documentation, translations and a
feature#307changelog entry.How Has This Been Tested?
Local PHP 8.3, browser DOM regressions and a live Safari smoke test:
Related Issue
Fixes #307.
Motivation and Context
Recover from accidental map edits without manually reconstructing deleted objects or editing configuration files.
Types of changes
Checklist
Release notes for this change are consolidated in #314 under Weathermap 2.0 (security fixes, issue fixes, then features). Merge this PR last, after #309–#314. It includes integration commits for those preceding PRs so the combined CSS, translations and editor behaviour are resolved in advance; its diff narrows to Undo/Redo as the preceding PRs merge. The combined release rehearsal passes 329 PHP tests / 6,401 assertions and all 26 browser fixtures. Undo/Redo patch coverage relative to the preceding release stack is 100% (229/229); full-range coverage is 97.8%, with earlier curved-comment fallback paths uncovered.