Skip to content

Commit

Permalink
TUI: Add recipient address entry (#1607)
Browse files Browse the repository at this point in the history
* Adds a new option when selecting the recipient to allow for a "manual
entry"
* Validates entered addresses to be valid bech32
* Fixes event handling to a point where copy & paste works
- Before the event handlers for quitting and showing/disabling logs were
interfering
  - Only display and handle log controls when no modal open
  • Loading branch information
ch1bo authored Sep 8, 2024
1 parent 6d40870 commit 20ceaa7
Show file tree
Hide file tree
Showing 6 changed files with 257 additions and 214 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
As a minor extension, we also keep a semantic version for the `UNRELEASED`
changes.

## [0.18.2] - UNRELEASED

- Adds a manual recipient address entry to `hydra-tui` and fixes event handling. [#1607](https://github.com/cardano-scaling/hydra/pull/1607)

## [0.18.1] - 2024-08-15

- New landing page and updated documentation style. [#1560](https://github.com/cardano-scaling/hydra/pull/1560)
Expand Down
3 changes: 1 addition & 2 deletions hydra-tui/hydra-tui.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.2
name: hydra-tui
version: 0.18.1
version: 0.18.2
synopsis: TUI for managing a Hydra node
description: TUI for managing a Hydra node
author: IOG
Expand Down Expand Up @@ -46,7 +46,6 @@ library
Hydra.TUI.Drawing.Utils
Hydra.TUI.Forms
Hydra.TUI.Handlers
Hydra.TUI.Handlers.Global
Hydra.TUI.Logging.Handlers
Hydra.TUI.Logging.Types
Hydra.TUI.Model
Expand Down
16 changes: 11 additions & 5 deletions hydra-tui/src/Hydra/TUI/Drawing.hs
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,16 @@ drawScreenShortLog CardanoClient{networkId} Client{sk} s =

drawCommandPanel :: RootState -> Widget n
drawCommandPanel s =
vBox
[ drawCommandList s
, hBorder
, drawLogCommandList (s ^. logStateL . logVerbosityL)
]
drawCommandList s
<=> maybeDrawLogCommandList
where
maybeDrawLogCommandList
| not (isModalOpen s) =
vBox
[ hBorder
, drawLogCommandList (s ^. logStateL . logVerbosityL)
]
| otherwise = emptyWidget

drawScreenFullLog :: RootState -> [Widget Name]
drawScreenFullLog s =
Expand Down Expand Up @@ -143,6 +148,7 @@ drawFocusPanelOpen networkId vk utxo pendingUTxOToDecommit = \case
SelectingUTxOToDecommit x -> renderForm x
EnteringAmount _ x -> renderForm x
SelectingRecipient _ _ x -> renderForm x
EnteringRecipientAddress _ _ x -> renderForm x
ConfirmingClose x -> vBox [txt "Confirm Close action:", renderForm x]
where
ownAddress = mkVkAddress networkId vk
Expand Down
Loading

0 comments on commit 20ceaa7

Please sign in to comment.