diff --git a/hydra-tui/src/Hydra/TUI/Drawing.hs b/hydra-tui/src/Hydra/TUI/Drawing.hs index aede12b4cdc..7cf0c026675 100644 --- a/hydra-tui/src/Hydra/TUI/Drawing.hs +++ b/hydra-tui/src/Hydra/TUI/Drawing.hs @@ -133,7 +133,7 @@ drawRemainingContestationPeriod :: UTCTime -> UTCTime -> Widget Name drawRemainingContestationPeriod deadline now = let remaining = diffUTCTime deadline now in if remaining > 0 - then padLeftRight 1 $ txt "Remaining time to contest: " <+> str (renderTime remaining) + then padLeftRight 1 $ vBox [txt "Remaining time to contest: ", str (renderTime remaining)] else txt "Contestation period passed, ready to fan out soon." drawTotalCommitted :: UTxO -> Widget n diff --git a/hydra-tui/src/Hydra/TUI/Handlers.hs b/hydra-tui/src/Hydra/TUI/Handlers.hs index f014fddee7e..e5c7c516af3 100644 --- a/hydra-tui/src/Hydra/TUI/Handlers.hs +++ b/hydra-tui/src/Hydra/TUI/Handlers.hs @@ -45,12 +45,18 @@ handleEvent :: EventM Name RootState () handleEvent cardanoClient client e = do handleGlobalEvents e + handleAppEventVia handleTick () e zoom connectedStateL $ do handleAppEventVia handleHydraEventsConnectedState () e zoom connectionL $ handleBrickEventsConnection cardanoClient client e zoom (logStateL . logMessagesL) $ handleAppEventVia handleHydraEventsInfo () e +handleTick :: HydraEvent Tx -> EventM Name RootState () +handleTick = \case + Tick now -> nowL .= now + _ -> pure () + handleAppEventVia :: (e -> EventM n s a) -> a -> BrickEvent w e -> EventM n s a handleAppEventVia f x = \case AppEvent e -> f e diff --git a/hydra-tui/test/Hydra/TUISpec.hs b/hydra-tui/test/Hydra/TUISpec.hs index 51d523e74da..b4bd82cc65f 100644 --- a/hydra-tui/test/Hydra/TUISpec.hs +++ b/hydra-tui/test/Hydra/TUISpec.hs @@ -271,7 +271,7 @@ withTUITest region action = do as <- newIORef initialAssumedState -- NOTE(SN): The null device should allow using this in CI, while we do -- capture the output via `outputByteBuffer` anyway. - nullFd <- openFd "/dev/null" WriteOnly Nothing defaultFileFlags + nullFd <- openFd "/dev/null" WriteOnly defaultFileFlags realOut <- outputForConfig $ defaultConfig{outputFd = Just nullFd, termName = Just "xterm"} closeFd nullFd let output = testOut realOut as frameBuffer