Skip to content

Add theme-appropriate colors for graph-view threshold glyphs - #841

Merged
TheWitness merged 1 commit into
developfrom
feature/glyph-theme-colors
Oct 5, 2026
Merged

TheWitness merged 1 commit into
developfrom
feature/glyph-theme-colors

Conversation

@TheWitness

Copy link
Copy Markdown
Member

Description

When viewing a graph, thold injects two action glyphs through the graph_buttons / graph_buttons_thumbnails hooks (see thold_graph_button() in setup.php):

  • the toggle threshold VRULEs glyph — <i class="tholdVRules far fa-chart-bar">
  • the create threshold glyph — <i class="tholdEdit fas fa-wrench">

Neither .tholdVRules nor .tholdEdit had a color rule in any of the packaged theme stylesheets, so the icons rendered in the inherited default color rather than a deliberate, theme-matched one. This adds a theme-appropriate color for both glyphs to every packaged theme.

While doing so, the pre-existing .tholdGlyph* action colors (used on the thresholds list in thold_graph.php) were found to use a single dark palette (#666666, #990000, #006600, …) across all themes. Those values are too dark to read on the dark themes, so they were brightened for the dark themes only; the light themes keep their existing values.

Changes per theme

  • Light themes (classic, modern, paw): add .tholdVRules (#1b6ca8) and .tholdEdit (#666666, matching the existing edit glyph). Existing glyph colors left unchanged — they already read well on light backgrounds.
  • Dark themes (dark, midwinter, sunrise, paper-plane): add .tholdVRules (#4aa3df) and .tholdEdit (#b3b3b3), and brighten the existing .tholdGlyph* colors (edit #b3b3b3, disable #e06666, enable #4caf50, chart #d6a13a, log #c7c04a, acknowledge #7cb342) so they remain legible against the dark backgrounds (sunrise and paper-plane are dark themes despite their names — both use near-black body backgrounds).

Semantic color coding is preserved across themes (gray = edit/create, red = disable, green = enable, amber = chart, blue = VRULE toggle); only brightness is tuned per theme family.

Related Issue

Motivation and Context

The two graph-view action glyphs had no defined color in any theme, leaving them visually inconsistent with the rest of the themed icons. This gives both glyphs an intentional, theme-matched color in every packaged theme and fixes the low-contrast threshold glyphs on the dark themes.

Because the glyphs are rendered by the plugin itself and the matching stylesheet is loaded by thold_page_head() via get_selected_theme(), the change works the same on both Cacti 1.2.x and the develop branch.

How Has This Been Tested?

  • Verified via thold_graph_button() in setup.php that the injected <i> elements carry the tholdVRules and tholdEdit classes being styled.
  • Confirmed each packaged theme stylesheet now defines .tholdVRules and .tholdEdit exactly once and that all CSS braces balance.
  • Cross-checked light vs. dark classification against each theme's body background in Cacti core (include/themes/*/main.css).

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation repository accordingly.

The toggle-threshold-VRULEs and create-threshold action glyphs rendered on the graph view page had no color defined in any theme. Add a theme-appropriate color for each (.tholdVRules, .tholdEdit) across all packaged themes, and brighten the existing .tholdGlyph* action colors on the dark themes (dark, midwinter, sunrise, paper-plane) where the original values were too dark to read against the dark backgrounds.
Copilot AI balanced review requested due to automatic review settings October 5, 2026 12:06
@TheWitness
TheWitness merged commit 01da1e0 into develop Oct 5, 2026
4 checks passed
@TheWitness
TheWitness deleted the feature/glyph-theme-colors branch October 5, 2026 12:09

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 review overview

🟡 Changes recommended

The duplicated acknowledge selectors leave resume-action glyphs without their intended dark-theme color.

Review effort: Balanced
Findings: 4 Medium severity

Open (4)
What changed in this PR

Adds theme-specific colors for graph-view threshold actions and improves glyph contrast.

Changes:

  • Adds colors for VRULE and create-threshold glyphs across all themes.
  • Brightens threshold action glyphs in dark themes.
File Description
css/​classic.css Adds light-theme graph action colors.
css/​modern.css Adds light-theme graph action colors.
css/​paw.css Adds light-theme graph action colors.
css/​dark.css Adds and brightens dark-theme glyph colors.
css/​midwinter.css Adds and brightens dark-theme glyph colors.
css/​sunrise.css Adds and brightens dark-theme glyph colors.
css/​paper-plane.css Adds and brightens dark-theme glyph colors.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread css/dark.css

.tholdGlyphAcknowledge {
color: #336600;
color: #7cb342;
Comment thread css/midwinter.css

.tholdGlyphAcknowledge {
color: #336600;
color: #7cb342;
Comment thread css/paper-plane.css

.tholdGlyphAcknowledge {
color: #336600;
color: #7cb342;
Comment thread css/sunrise.css

.tholdGlyphAcknowledge {
color: #336600;
color: #7cb342;
TheWitness added a commit that referenced this pull request Oct 5, 2026
Each theme stylesheet carried a duplicated `.tholdGlyphAcknowledge`
selector. thold_graph.php emits three distinct acknowledge action
glyphs - tholdGlyphAcknowledge, tholdGlyphAcknowledgeSuspend, and
tholdGlyphAcknowledgeResume (the "Resume Notifications" action) - so
the second copy was clearly meant to target the Resume glyph, which
was left unstyled. Rename the duplicate to .tholdGlyphAcknowledgeResume
so the resume action receives its intended color in every theme.

Remediates the GitHub Copilot review findings on PR #841 (dark,
midwinter, sunrise, paper-plane) and fixes the identical latent
duplicate in the light themes (classic, modern, paw).
TheWitness added a commit that referenced this pull request Oct 5, 2026
…elector) (#842)

* thold: style tholdGlyphAcknowledgeResume glyph in all themes

Each theme stylesheet carried a duplicated `.tholdGlyphAcknowledge`
selector. thold_graph.php emits three distinct acknowledge action
glyphs - tholdGlyphAcknowledge, tholdGlyphAcknowledgeSuspend, and
tholdGlyphAcknowledgeResume (the "Resume Notifications" action) - so
the second copy was clearly meant to target the Resume glyph, which
was left unstyled. Rename the duplicate to .tholdGlyphAcknowledgeResume
so the resume action receives its intended color in every theme.

Remediates the GitHub Copilot review findings on PR #841 (dark,
midwinter, sunrise, paper-plane) and fixes the identical latent
duplicate in the light themes (classic, modern, paw).

* thold: style tholdGlyphAcknowledgeResume glyph in light themes

Apply the same duplicate-selector fix to the light themes (paper-plane,
classic, modern, paw): rename the second .tholdGlyphAcknowledge copy to
.tholdGlyphAcknowledgeResume so the "Resume Notifications" graph-view
glyph receives its intended color instead of falling through unstyled.
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