Skip to content

Clarify link workflows and add node display-name positioning - #311

Merged
TheWitness merged 21 commits into
Cacti:developfrom
alcatron:feat/properties-workflow-20261016
Oct 17, 2026
Merged

TheWitness merged 21 commits into
Cacti:developfrom
alcatron:feat/properties-workflow-20261016

Conversation

@alcatron

@alcatron alcatron commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Description

Make primary interface assignment, additional hover previews and expert traffic sources distinct. Keep bandwidth, via style, width and comments in the main form; put optional controls in mutually exclusive Additional hover graphs and Advanced settings panels. Primary-interface changes retain extras, and source controls add/remove extra measured interfaces without changing hover/click destinations.

The form permits two hover graphs total (main + one extra), displays selected graph names and RRD filenames, and retains manual source/URL editing. Existing configurations with more previews must be reduced before saving through this form; raw configuration remains available. Combining sources changes map totals and does not create an aggregate Cacti graph.

Add Top/Middle/Bottom display-name positions over node icons, preserve custom offsets until changed, label coordinates Map position (X, Y), move Link Comment Colour into Manage Colours, standardise buttons and update help. Rename raw-edit actions explicitly.

Related work

Follow-up to #276, #294, #300, #303 and #304. Independent of the separate curved-comment renderer and 1000M default.

Validation

PHP 8.3 isolated Cacti-layout fixture: 295 tests / 5,901 assertions; workflow/source-picker/pagination/name-position browser checks and PHP colour/RRD/position regressions. PHP/JavaScript syntax, whitespace and release manifest checks pass.

Coverage was not measured in this local run; current CI and review results must be checked separately.

Source promotion/addition compare effective RRD identities using map default data-source names/path and scaling modifiers. Opening properties preserves existing hover URL options; promoting the main traffic preview refreshes extra-graph metadata while retaining newer user selections. Focused submission, workflow, source-picker and context-menu DOM fixtures pass. Picker inputs have accessible labels; colour rows use row headers. PHP metadata fixtures load real declarations directly.

Source matching follows the effective Cacti RRA directory. Editor label presets are bounded within small icons and explicitly marked, preserving the geometry of existing raw offsets until a new preset is selected.

Release notes for this change are consolidated in #314 under Weathermap 2.0 (security fixes, issue fixes, then features). This branch includes #309 to resolve the shared Map Style/comment-curve integration; merge #309 before this PR.

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

Opening link properties can insert an unwanted third preview and block unrelated saves.

1 open finding
What changed in this PR

Refines Cacti’s Weathermap editor by separating traffic sources from hover previews and adding node display-name positioning.

Changes:

  • Separates primary interfaces, additional sources and hover previews.
  • Adds Top/Middle/Bottom name positions while preserving custom offsets.
  • Moves comment colours to Manage Colours and updates help, translations and regressions.
File Description
weathermap-cacti-plugin-editor.php Updates controls, labels and help.
tests/​Unit/​PropertiesWorkflowRegressionTest.php Adds workflow regression coverage.
tests/​Unit/​MapStyleDefaultsTest.php Updates colour-control expectations.
tests/​Support/​NodeLabelPositionRegression.php Checks rendering and position persistence.
tests/​Support/​HoverGraphFilesRegression.php Checks permitted graph filenames.
tests/​Support/​CommentColourLocationRegression.php Checks colour persistence and isolation.
tests/​Browser/​PickerPaginationTest.cjs Covers independent hover selection.
tests/​Browser/​NodeLabelPositionTest.cjs Checks position selector initialization.
tests/​Browser/​LinkSourcePickerTest.cjs Covers additional-source controls.
tests/​Browser/​EditorWorkflowTest.cjs Expands editor workflow coverage.
tests/​Browser/​EditorContextMenuTest.cjs Adapts submission test setup.
locales/​po/​cacti.pot Adds translated editor strings.
lib/​WeatherMapNode.class.php Exposes label-offset metadata.
lib/​editor.inc.php Adds graph filenames and UI strings.
lib/​editor.comment-style.php Removes the Map Style colour control.
lib/​editor.colours.php Loads and saves comment colours.
lib/​editor.actions.php Saves supported node positions.
js/​editor.js Implements revised editor workflows.
css/​editor.css Styles panels and action controls.
CHANGELOG.md Documents the editor changes.

🧠 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 Outdated

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

Unresolved issues affect traffic totals, hover-setting preservation, graph metadata restoration and an isolated submission regression.

2 open findings
1 resolved since last review
Previously missed (2)

In code that hasn't changed since last review

Medium severity Preserve existing hover URL dimensions and legend settings

js/​editor.js:1475

Opening Link Properties adds fixed 300×100 dimensions and graph_nolegend=true to existing Cacti hover URLs that omit those parameters. Saving an unrelated property then overrides the Map Style dimensions and plugin legend preference supplied by WeatherMap::ProcessString(). Preserve existing URLs when splitting the fields; apply compact defaults only when explicitly choosing a graph.

Medium severity Refresh metadata after promoting the additional graph

js/​editor.js:1505

For an existing link whose CPU preview precedes its traffic preview, opening properties starts a metadata lookup for the traffic graph. This promotion then makes the CPU graph the extra. The lookup is discarded if still pending, or leaves the picker on the former extra if already completed. No CPU lookup follows, so the additional graph lacks its name/RRD filenames and the picker is empty or stale. Refresh metadata for the new extra after promotion, while preserving any newer user selection.

🧠 Review effort: Balanced

Comment thread js/editor.js
Comment thread js/editor.js Outdated
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability 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

Comment thread tests/Support/HoverGraphFilesRegression.php Fixed
@alcatron

alcatron commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Rechecked the current PR and pushed the review repairs. Source promotion/addition compare effective RRD identities using map default data-source names/path and scaling modifiers. Opening properties preserves existing hover URL options; promoting the main traffic preview refreshes extra-graph metadata while retaining newer user selections. Focused submission, workflow, source-picker and context-menu DOM fixtures pass. Picker inputs have accessible labels; colour rows use row headers. PHP metadata fixtures load real declarations directly.

Validation: 295 tests / 5,899 assertions, plus the focused checks described above. New regression cases reproduce the relevant defects against the preceding code. These PR changes have not been installed on the live server. CI results are still separate from local validation.

Follow-up ceb4fe8 replaces ambiguous numeric repetition in scaling identity parsing. Signed/fractional modifiers, long invalid input and non-finite values are covered; the workflow fixture passes again.

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

Source identity matching still permits equivalent multiplier-prefixed sources to double reported traffic.

1 open issue
1 previously missed issue

In code that hasn't changed since last review

Low severity Generated graph picker inputs lack accessible labels

js/​editor.js:181

The new PHP aria-label attributes stay on #link_picker and #link_target_picker, which graphPicker() hides. The visible generated _input controls receive neither these labels nor associated <label> elements, so screen readers cannot identify the two search fields by their intended labels. Copy each original input's accessible label onto its generated search input.

2 resolved since last review

Review effort: Balanced

Comment thread js/editor.js Outdated
@alcatron

Copy link
Copy Markdown
Contributor Author

Fixed in cb4db22: the identity parser applies the outer sign/multiplier before RRD modifiers and compares their combined effective scale. Addition and promotion regressions cover 1* equivalents; signed/combined scales preserve genuinely distinct contributions. The previously duplicated addition now stays unchanged, and promotion leaves exactly one equivalent source. The 295-test PHP suite and workflow/source-picker/submission fixtures pass. Visible generated search controls also inherit their accessible labels.

These repairs update the PR branch only; the live server has not been changed. New GitHub checks are separate from the passing local validation.

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

Unresolved source-identity and label-positioning defects accompany extensive asynchronous editor changes that still need human integration review.

No open issues 🎉

2 previously missed issues

In code that hasn't changed since last review

Medium severity Normalize RRA paths to prevent duplicate interfaces

js/​editor.js:1548

When rrd_default_path is unset, backup.rrd and /var/lib/cacti/rra/backup.rrd compare as different sources even when Cacti's RRA directory is /var/lib/cacti/rra. The reader resolves the relative path under $config['rra_path'] (lib/datasources/WeatherMapDataSource_rrd.php:711–713), while the interface picker returns relative paths. Adding that interface or promoting it from an absolute-path extra can therefore retain both entries and double its traffic and utilisation. Export the effective Cacti RRA directory and mirror the reader's path-resolution rules here; add addition and promotion regressions with no map-specific path default.

Medium severity Clamp label presets within small icon bounds

weathermap-cacti-plugin-editor.php:446

The fixed N60/S60 presets can put display names partly outside smaller icons, contrary to the advertised over-icon positioning. WeatherMapNode::pre_render() passes icon height plus label-box height to calc_offset(), so a 32px icon with a 16px label box gets a 14.4px displacement and extends 6.4px beyond the icon. Use the available interior height (icon height minus label-box height) to calculate or clamp these editor positions, without changing existing raw offset semantics. Add a small or scaled icon to the rendering regression; the current test covers only the large bundled icon.

1 resolved since last review

Review effort: Balanced

@alcatron

Copy link
Copy Markdown
Contributor Author

Addressed both latest summary findings in 66c92e3. Source identities now apply the map path default followed by Cacti’s actual RRA directory and normalize repeated separators/dot components; additions and promotions no longer duplicate an absolute-path extra through a relative picker entry. The effective directory is exported safely from Cacti configuration. Top/Middle/Bottom editor presets use the available interior icon space. A dedicated editor hint distinguishes these presets from existing raw offsets, whose geometry is retained until a new preset is chosen. Real rendering covers 96px and 32px icons, persistence and unchanged legacy raw offsets. Full PHP suite: 295 tests / 5,901 assertions; focused workflow, source-picker, node-position and icon-picker DOM fixtures pass.

These changes update the PR branch only; the live server is unchanged. GitHub CI results remain separate from local validation.

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

Coupled asynchronous editor and rendering changes warrant human review with current CI and compatible Cacti integration confirmation.

No open issues 🎉

Review effort: Balanced

TheWitness
TheWitness previously approved these changes Oct 17, 2026
@alcatron

Copy link
Copy Markdown
Contributor Author

Resolved the new develop conflicts in 777edb3 after #309/#310/#312/#313 merged. The Map Style handler retains COMMENTCURVE while leaving comment colours in Manage Colours; translation entries from both branches are retained. No feature behaviour was intentionally changed. Validation: 300 PHP tests / 6,004 assertions and eight targeted browser fixtures pass; manifest, translation-template and whitespace checks pass. Fresh upstream checks are required for this merge commit.

@sonarqubecloud

Copy link
Copy Markdown

@TheWitness
TheWitness merged commit 6866eaf into Cacti:develop Oct 17, 2026
2 checks passed
TheWitness pushed a commit that referenced this pull request Oct 17, 2026
* Allow link comments to follow link curves

* Use 1000M as the inherited link bandwidth default

* Clarify link workflows and add node display-name positioning

* Make hover graphs clickable and sharper on high-density displays

* Bundle additional 96px network-device node icons

* Prepare Weathermap 2.0 identification and release notes

* Reference PR #309 in changelog

* Reference PR #310 in changelog

* Reference PR #311 in changelog

* Reference PR #312 in changelog

* Reference PR #313 in changelog

* Reference PR #314 in changelog

* Preserve translation template project metadata

* Preserve translation template project metadata

* Preserve translation template project metadata

* Preserve translation template project metadata

* Preserve translation template project metadata

* Use established changelog categories throughout 2.0-dev

* Preserve Cacti graph layout after Weathermap navigation

* Fix traffic glow masking around transparent node icons

* Preserve curved comment alignment and nudge direction

* Set plugin working directory in bandwidth regression test

* Preserve configured hover previews when opening properties

* Fix hover density caching and keyboard interaction

* Preserve curved glyph kerning and reject reversed offset text

* Add the required license notice to bandwidth regression

* Preserve traffic identity and hover settings in link properties

* Keep mixed-input previews open and protect sharp note text

* Parse traffic scaling without ambiguous numeric repetition

* Fall back before inward curvature compresses glyph spacing

* Honor outer source multipliers and label visible graph pickers

* Complete tooltip blur dismissal and keyboard re-entry

* Share quarter-circle geometry in rendering regressions

* Use the Cacti request helper for the curve checkbox

* Resolve Cacti RRA identities and bound editor label presets

* Ignore stale tooltip events and quoted zoom text

* Add two-step Undo and Redo to the map editor

* Use PHP-generated sessions in editor history tests

* Isolate duplicated tabs and enforce undo history expiry and quota

* Cancel pending hover opens and recognize RRDtool continuations

* Import the history worker directly in browser regression tests

* Preserve history for unchanged forms and enforce JSON storage quota

* Keep undo history when raw configuration dialogs are unchanged

* Preserve untouched colour history and validate included restore assets

* Gate startup saves and preserve scale order and restored title cache

* Cover both graph-picker JSON request signatures in the fixture
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.

4 participants