Skip to content

Add link appearance defaults and per-link layout controls for 2.0.1 - #323

Open
alcatron wants to merge 3 commits into
Cacti:developfrom
alcatron:feat/link-appearance-2.0.1
Open

alcatron wants to merge 3 commits into
Cacti:developfrom
alcatron:feat/link-appearance-2.0.1

Conversation

@alcatron

@alcatron alcatron commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

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

  • PHP 8.3: 342 tests, 6,476 assertions pass on this branch independently.
  • Regression coverage includes editor save/reload, defaults, individual overrides, template inheritance and invalid values. It also checks that override markers stay local, resets survive marked-template reloads, equal-to-template explicit choices persist, and changes stop at unchanged included or explicitly overridden template branches.
  • Changed PHP files and editor JavaScript pass syntax checks; gettext format, manifest and whitespace checks pass.
  • Exercised the controls on a disposable example map in Safari. Full PHP/database CI remains to run on GitHub.

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:

Map Style link appearance defaults

Per-link traffic-label override:

Link Properties traffic label positions

Copilot AI balanced review requested due to automatic review settings October 24, 2026 15:57

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

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 thread lib/editor.comment-style.php Outdated
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) {
@alcatron
alcatron requested a balanced review from Copilot October 24, 2026 16:03

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@sonarqubecloud

Copy link
Copy Markdown

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.

Expose link appearance defaults and per-link layout overrides in the editor

3 participants