UptimeRobot: colorize percentage to work with both dark and light bg#2071
Open
huyz wants to merge 3 commits into
Open
UptimeRobot: colorize percentage to work with both dark and light bg#2071huyz wants to merge 3 commits into
huyz wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the UptimeRobot widget so uptime percentages are colorized instead of rendered in gray, aligning that display with the codebase’s other percentage-based widgets and improving readability on different backgrounds.
Changes:
- Added a dedicated
ColorizeUptimePercenthelper with uptime-specific thresholds. - Updated the UptimeRobot widget to render uptime values with inline colors.
- Refactored uptime string formatting to split, parse, and rebuild each uptime segment before display.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
utils/colors.go |
Adds a new utility for colorizing uptime percentages with stricter thresholds near 100%. |
modules/uptimerobot/widget.go |
Switches UptimeRobot uptime rendering from gray text to per-value colored output and rewrites uptime formatting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
The problem is that right now UptimeRobot shows uptime percentages in gray, which actually show up as black
when I have a dark background, making it tough to read.
I figured we might as well color-code the percentages, just as it's done for the
Chargefieldof the Power module, which makes the text readable on light and dark background.