Skip to content

Commit 4705557

Browse files
committed
healthCheckIndicatorWidget: go back to more common version with more space
1 parent 9be10b1 commit 4705557

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

app/Sauron/HealthCheck/Stop.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ gatherAndClearHealthCheckThread someNode@(SomeNode node) = do
9999
_ -> return "Unknown"
100100

101101
healthCheckIndicatorWidget :: Maybe (Async (), Int) -> Widget n
102-
healthCheckIndicatorWidget healthCheckThreadData =
103-
case healthCheckThreadData of
104-
Just (_, periodMicroseconds) ->
105-
let diffTime = fromIntegral periodMicroseconds / 1_000_000 :: NominalDiffTime
106-
in str (" ⭮[" <> show diffTime <> "]")
107-
Nothing -> str ""
102+
healthCheckIndicatorWidget Nothing = str ""
103+
healthCheckIndicatorWidget (Just (_, periodMicroseconds)) =
104+
-- Reserve a fixed 2-cell slot for the refresh glyph. Common terminal fonts
105+
-- draw ↻ wider than 1 cell (not reflected in our Unicode width table).
106+
hBox [str " ", hLimit 2 (padRight Max (str "")), str [i|[#{diffTime}]|]]
107+
where diffTime = fromIntegral periodMicroseconds / 1_000_000 :: NominalDiffTime

0 commit comments

Comments
 (0)