Skip to content

issue: shorten thold VRULE graph drilldown button title - #855

Merged
TheWitness merged 5 commits into
developfrom
fix/shorten-thold-vrule-graph-button-title
Oct 13, 2026
Merged

TheWitness merged 5 commits into
developfrom
fix/shorten-thold-vrule-graph-button-title

Conversation

@TheWitness

Copy link
Copy Markdown
Member

Summary

Cacti's graph action (drilldown) menu now renders each registered button's title as a visible text label. With that change, this plugin's VRULE toggle button title "Toggle Threshold VRULES %s" reads as an overlong entry in the menu.

This shortens it to Toggle VRULES %s, matching the concise, label-style wording of the other drilldown actions. The existing far fa-chart-bar glyph is unchanged and already follows the preferred iconLink + Font Awesome drilldown format. The "Create Threshold" button is already concise and is left untouched.

Changes

  • setup.php — thold_graph_button(): VRULE title Toggle Threshold VRULES %s → Toggle VRULES %s.
  • tests/Unit/TholdGraphButtonTest.php — new unit test exercising thold_graph_button()'s VRULE branch so the changed line stays covered by the patch-coverage gate.
  • tests/bootstrap-unit.php — add the two request-var stubs (isempty_request_var, set_request_var) the function needs; both guarded by function_exists().
  • locales/po/cacti.pot — regenerated for the changed translatable string (required by the i18n gate).
  • CHANGELOG.md — entry under develop.

Testing

  • php -l — clean on all changed PHP files.
  • php tests/bin/check-i18n-pot.php origin/develop — OK (pot included).
  • New test drives the VRULE branch (threshold present, realm authorised) and asserts the shortened Toggle VRULES title is emitted and the old string is gone.

The graph action menu now renders each drilldown button's title as a visible label, so 'Toggle Threshold VRULES %s' reads as an overlong menu entry. Shorten it to 'Toggle VRULES %s', add a unit test exercising thold_graph_button()'s VRULE branch (with the two missing request-var stubs it needs) so the changed line stays covered, and regenerate locales/po/cacti.pot.
@TheWitness
TheWitness requested review from bmfmancini and xmacan and a balanced review from Copilot October 12, 2026 20:31

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

The new test lacks the required full GPL header, and the POT metadata contains a malformed translator address.

2 open findings
What changed in this PR

Shortens the VRULE graph drilldown label and adds regression coverage.

Changes:

  • Renames the translatable VRULE label.
  • Adds unit-test stubs and coverage.
  • Updates localization metadata and changelog.
File Description
setup.php Shortens the VRULE action title.
tests/​Unit/​TholdGraphButtonTest.php Tests the shortened title.
tests/​bootstrap-unit.php Adds request-variable stubs.
locales/​po/​cacti.pot Updates the translation template.
CHANGELOG.md Records the change.

🧠 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 locales/po/cacti.pot Outdated
Comment thread tests/Unit/TholdGraphButtonTest.php Outdated
TheWitness and others added 4 commits October 13, 2026 08:55
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Resolve the CHANGELOG.md conflict (keep both develop and branch entries).

Per review: restore the Thold-specific 'Threshold' reference and split the
toggle button title into two complete strings, 'Toggle Threshold VRULES On'
and 'Toggle Threshold VRULES Off', chosen by an if block, instead of
appending a translated On/Off fragment to 'Toggle VRULES %s' (sprintf word
order is not grammatical across languages). Regenerate cacti.pot and update
the unit test assertions accordingly.
@TheWitness
TheWitness merged commit 10c9354 into develop Oct 13, 2026
3 checks passed
@TheWitness
TheWitness deleted the fix/shorten-thold-vrule-graph-button-title branch October 13, 2026 16:38
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