Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Default propagation and inherited override markers can break template inheritance and prevent resets from persisting.
2 open issues
What changed in this PR
Exposes existing link layout settings in the Weathermap editor for 2.0.1, addressing #321 with map-wide defaults and per-link controls.
Changes:
- Groups default link width, comment placement and traffic-label positions in Map Style, while retaining capacity in Map Properties.
- Adds per-link overrides, inheritance reset controls and persistence markers.
- Adds regression coverage, translation-template updates and changelog entries.
| File | Description |
|---|---|
| weathermap-cacti-plugin-editor.php | Adds layout controls and reorganizes editor dialogs. |
| tests/Unit/MapStyleDefaultsTest.php | Tests comment-style defaults and validation. |
| tests/Unit/MapStyleConfigRoundTripTest.php | Tests override persistence and inheritance resets. |
| tests/Unit/LinkLayoutControlsTest.php | Runs the editor-action regression fixture. |
| tests/Support/LinkLayoutControlsRegression.php | Exercises layout changes through editor actions. |
| locales/po/cacti.pot | Adds and updates editor translation strings. |
| lib/WeatherMapLink.class.php | Serializes overrides and exposes layout state to JavaScript. |
| lib/editor.inc.php | Updates Advanced settings guidance. |
| lib/editor.comment-style.php | Adds layout fields, validation and update helpers. |
| lib/editor.actions.php | Connects submitted layout settings to map updates. |
| js/editor.js | Populates and groups per-link controls. |
| CHANGELOG.md | Records three 2.0.1 feature entries. |
Review effort: Balanced
Comment on lines
+1161
to
+1162
| $customStyle = !empty($this->hints['editor_commentstyle_override']) || $this->commentstyle !== $base->commentstyle; | ||
| $customPositions = !empty($this->hints['editor_labelpos_override']) || $this->labeloffset_in != $base->labeloffset_in || $this->labeloffset_out != $base->labeloffset_out; |
Comment on lines
+324
to
+325
| if ($name === ':: DEFAULT ::' || ($name !== 'DEFAULT' && ($link->defined_in !== $map->configfile || !empty($link->hints['editor_labelpos_override'])))) continue; | ||
| if ($link->labeloffset_in == $oldIn && $link->labeloffset_out == $oldOut) { |
|
bmfmancini
approved these changes
Oct 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Description
Expose the existing link layout settings in the editor for 2.0.1. Map Style now groups default link width, Edge/Centre comment placement and IN/OUT traffic-label positions under Link Appearance Defaults. Map Properties retains default capacity.
Link Properties adds a comment-style override beside the comments and traffic-label positions under Advanced settings. Use map default restores inheritance from the link's template. Explicit editor overrides remain explicit when saved, including values that currently match the default; included configurations are left alone. Traffic labels retain the standard 75%/25% defaults and move independently of comment text.
Closes #321.
Validation
Includes three feature entries under the upcoming 2.0.1 changelog section. No release version bump.
Companion manual PR: #324. Merge this controls PR first so the manual describes available controls.
Screenshots
Map Style defaults:
Per-link traffic-label override: