Skip to content

feature: add status pill column to Tests list - #132

Merged
TheWitness merged 2 commits into
mainfrom
feature/status-pills
Oct 8, 2026
Merged

TheWitness merged 2 commits into
mainfrom
feature/status-pills

Conversation

@TheWitness

Copy link
Copy Markdown
Member

Summary

Adds a Status column to the Tests list (servcheck_test.php → data_list()), placed immediately after the Name column, that renders each service check's current state as a colour-coded pill.

This mirrors the status-pill treatment being added to plugin_thold, giving the Tests list an at-a-glance status indicator that complements the existing subtle row tint and the status legend footer.

Details

  • New Status column inserted right after Name in the data_list() $display_text definition (non-sortable, since the state is derived in PHP rather than from a single DB column).
  • Pill rendering: the per-row state is already computed into $style (servcheck_ok, servcheck_error, servcheck_warning, servcheck_failing, servcheck_duration, servcheck_disabled). The pill reuses that state key to look up its human label from $servcheck_states and renders <span class="servcheck_pill servcheck_<state>">Label</span>.
  • CSS (css/common.css): new .servcheck_pill badge styling that reuses the solid legend colours so the pill stays legible on top of the subtle row tint on every bundled theme. Compound selectors (.servcheck_pill.servcheck_<state>) keep a higher specificity than the per-theme single-class row tints, so the badge colour always wins without needing per-theme overrides.
  • Drive-by fix: corrected a missing closing quote in the Tests-list <tr> tag (class='tableRow selectable $style id='...' → class='tableRow selectable $style' id='...') so the row id attribute (used by row-selection JS) is emitted correctly.

Testing

  • php -l servcheck_test.php — no syntax errors.
  • CSS-only change otherwise; pill labels/colours match the existing status legend.

Add a Status column after Name in data_list() that renders each service check's current state as a colour-coded pill, reusing the status legend's solid colours. Also fixes a missing quote on the row class attribute so the row id is emitted correctly.
@TheWitness
TheWitness requested review from bmfmancini and xmacan and a balanced review from Copilot October 8, 2026 17:59

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 translation template is missing the new label, and the success pill does not meet minimum text contrast.

2 open findings
What changed in this PR

Adds an at-a-glance status pill to the Tests list and corrects row markup.

Changes:

  • Adds a translated Status column and state pills.
  • Adds pill styling using existing state colors.
  • Documents the feature in the changelog.
File Description
servcheck_test.php Renders the Status column and fixes row attributes.
css/​common.css Styles color-coded status pills.
CHANGELOG.md Records the new status column.

🧠 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 css/common.css
Comment thread servcheck_test.php
bmfmancini
bmfmancini previously approved these changes Oct 8, 2026
Darken the Ok state green from #2f8f3a to #2e7d32 so white text meets WCAG AA (~5.1:1) on both the status pill and the matching legend chip. Regenerate locales/po/cacti.pot so the new __('Status') column header is translatable (fixes the i18n template CI gate).
@TheWitness
TheWitness merged commit 1622c88 into main Oct 8, 2026
3 checks passed
@TheWitness
TheWitness deleted the feature/status-pills branch October 8, 2026 18:35
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