Repository navigation
issue: shorten thold VRULE graph drilldown button title - #855
Merged
Merged
Conversation
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
requested review from
bmfmancini and
xmacan
and
a balanced review from Copilot
October 12, 2026 20:31
Contributor
There was a problem hiding this comment.
🟡 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.
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.
xmacan
approved these changes
Oct 13, 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.

Summary
Cacti's graph action (drilldown) menu now renders each registered button's
titleas 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-barglyph is unchanged and already follows the preferrediconLink+ Font Awesome drilldown format. The "Create Threshold" button is already concise and is left untouched.Changes
setup.php—thold_graph_button(): VRULE titleToggle Threshold VRULES %s→Toggle VRULES %s.tests/Unit/TholdGraphButtonTest.php— new unit test exercisingthold_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 byfunction_exists().locales/po/cacti.pot— regenerated for the changed translatable string (required by the i18n gate).CHANGELOG.md— entry underdevelop.Testing
php -l— clean on all changed PHP files.php tests/bin/check-i18n-pot.php origin/develop— OK (pot included).Toggle VRULEStitle is emitted and the old string is gone.