[FEATURE](table): equivalent of Grafana absolute thresholds to cellSettings - #808
Open
colivi wants to merge 1 commit into
Open
[FEATURE](table): equivalent of Grafana absolute thresholds to cellSettings#808colivi wants to merge 1 commit into
colivi wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Threshold migration loses field-override scope and mishandles base ranges for negative values.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds Grafana absolute-threshold migration to Perses Table conditional cell formatting.
Changes:
- Converts threshold steps into ordered
Rangecell settings. - Maps threshold colors to text or background colors.
- Adds an Uptime migration fixture.
File summaries
| File | Description |
|---|---|
table/schemas/migrate/migrate.cue |
Implements threshold conversion. |
table/schemas/migrate/tests/thresholds-color-text-absolute/input.json |
Provides Grafana input coverage. |
table/schemas/migrate/tests/thresholds-color-text-absolute/expected.json |
Defines expected Perses output. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+312
to
+316
| _hasColorTextOverride: len([ | ||
| for o in (*#panel.fieldConfig.overrides | []) | ||
| for p in (*o.properties | []) | ||
| if p.id == "custom.cellOptions" if (*p.value.type | "") == "color-text" {true}, | ||
| ]) > 0 |
| [for b in _thresholdBaseColors { | ||
| condition: { | ||
| kind: "Range" | ||
| spec: min: 0 |
shahrokni
self-requested a review
September 11, 2026 11:11
colivi
force-pushed
the
feat/table-migrate-thresholds-color-text
branch
from
September 12, 2026 14:50
de015f2 to
f3e0aba
Compare
Map fieldConfig.defaults.thresholds (absolute) to Range cellSettings when color.mode is thresholds and cellOptions is color-text (or color-background). - Highest min first (Perses first-match evaluation) - textColor for color-text; backgroundColor for color-background - Named Grafana colors via shared migrate color map; pass through hex - Skip base-only green@null ladders and plain auto cellOptions - Field-scoped color-text/color-background overrides attach the ladder on columnSettings[].cellSettings; global only for default cell style - Base threshold covers values below the lowest numeric step (incl. negatives) - Fix empty list.Min when no numeric steps; Range max always paired with min Test fixture mirrors network Uptime Max (blue/green/yellow/red seconds). Signed-off-by: colivi <charles.olivi@gmail.com>
colivi
force-pushed
the
feat/table-migrate-thresholds-color-text
branch
from
September 12, 2026 14:51
f3e0aba to
e340365
Compare
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
Equivalent of Grafana table "fieldConfig.defaults.thresholds" (absolute mode) into Perses Table "cellSettings" with "Range" conditions.
When
How
Test
Screenshots
N/A — migrate schema only (no UI change).
Checklist
following "catalog_entry" values: "FEATURE", "ENHANCEMENT", "BUGFIX", "BREAKINGCHANGE", "DOC","IGNORE".
UI Changes