Repository navigation
Add theme-appropriate colors for QuickTree graph action glyphs - #34
Merged
Merged
Conversation
The add-to-QuickTree and remove-from-QuickTree action glyphs reused the core deviceUp/deviceDown classes and were only styled via core. Give QuickTree its own .quicktreeAdd/.quicktreeRemove glyph classes with default colors in the base stylesheet and per-theme overrides for each packaged Cacti theme (classic, modern, paw as light; dark, midwinter, sunrise, paper-plane brightened for dark backgrounds). Load the base and theme stylesheets on every page via page_head so the glyph colors also apply on the graph view page where the add glyph is rendered.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The behavior needs automated coverage and a required changelog entry.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds theme-aware colors for QuickTree’s add/remove graph glyphs.
Changes:
- Replaces core glyph classes with QuickTree-specific classes.
- Loads base and selected-theme stylesheets globally.
- Adds light and dark theme color variants.
| File | Description |
|---|---|
setup.php |
Updates add glyph and stylesheet loading. |
quicktree.php |
Updates remove and legend glyph classes. |
css/quicktree.css |
Adds default glyph colors. |
css/classic.css |
Adds light-theme colors. |
css/modern.css |
Adds light-theme colors. |
css/paw.css |
Adds light-theme colors. |
css/dark.css |
Adds dark-theme colors. |
css/midwinter.css |
Adds dark-theme colors. |
css/sunrise.css |
Adds dark-theme colors. |
css/paper-plane.css |
Adds dark-theme colors. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
xmacan
previously approved these changes
Oct 5, 2026
The theme-glyph change touched quicktree_graph_buttons() (setup.php:219) and quicktree_page_head() (setup.php:265-268), which the patch-coverage gate flagged as uncovered. Add QuicktreeGraphButtonsTest and QuicktreePageHeadTest, plus get_md5_include_js/get_md5_include_css/get_selected_theme stubs in the unit bootstrap, to exercise both hooks.
xmacan
approved these changes
Oct 5, 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
QuickTree renders two action glyphs:
graph_buttons/graph_buttons_thumbnailshooks (quicktree_graph_buttons()insetup.php).quicktree.php, plus the matching legend icons in the Information/Directions box.These glyphs reused Cacti's core
deviceUp/deviceDownclasses, so their color was entirely dependent on core and QuickTree had no say in it. This gives QuickTree its own glyph classes with theme-appropriate colors, mirroring the approach used inplugin_thold.Changes
.quicktreeAdd(green, "add") and.quicktreeRemove(red, "remove") replace the use of coredeviceUp/deviceDownin all four markup locations (setup.phpgraph button, thequicktree.phpremove link, and the two legend icons).css/quicktree.cssso any theme (including custom themes that ship no QuickTree stylesheet) still gets a sensible color.classic,modern,paw): add#2e7d32, remove#c62828.dark,midwinter,sunrise,paper-plane): add#4caf50, remove#e06666— brightened so they read against the dark backgrounds (sunriseandpaper-planeare dark themes despite their names).quicktree_page_head()now loads the base stylesheet and the selected theme's stylesheet (when present) on every page, not justquicktree.php. This is required because the add glyph is rendered on the graph view page, where the stylesheet was previously not loaded.Related Issue
Motivation and Context
The add/remove glyphs borrowed their color from core and were not owned or tunable by QuickTree. This gives both glyphs an intentional, theme-matched color in every packaged theme (and a graceful default elsewhere), consistent with how
plugin_tholdthemes its glyphs.Because the glyphs are rendered by the plugin itself and the matching stylesheet is loaded by
quicktree_page_head()viaget_selected_theme(), the change works the same on both Cacti 1.2.x and the develop branch.How Has This Been Tested?
php -lpasses onsetup.phpandquicktree.php.deviceUp/deviceDownreferences remain and that all four glyph sites now use.quicktreeAdd/.quicktreeRemove.bodybackground in Cacti core (include/themes/*/main.css).Screenshots (if appropriate):
Types of changes
Checklist: