Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hydra-tui forms to only submit valid values #225

Merged
merged 1 commit into from
Feb 21, 2022

Conversation

ch1bo
Copy link
Collaborator

@ch1bo ch1bo commented Feb 21, 2022

Also shows focus, invalid values and the maximum amount available.

Fixes issue #224

Before:
image
image

After:
image
image

Copy link
Contributor

@abailly-iohk abailly-iohk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit sad we don't have more tests coverage on the TUI, but functional tests are expensive. If we keep adding features here, I would argue to start refactoring towards better testability, perhaps abstracting away the Terminal-based infrastructure and have a separate testable logic layer that only deals with updating some custom State and reacting to users' Actions ?

@github-actions
Copy link

github-actions bot commented Feb 21, 2022

Unit Test Results

    6 files  ±0    71 suites  ±0   4m 45s ⏱️ -17s
203 tests ±0  201 ✔️ ±0  2 💤 ±0  0 ±0 

Results for commit 69d3ec3. ± Comparison against base commit 601b759.

♻️ This comment has been updated with latest results.

@ch1bo
Copy link
Collaborator Author

ch1bo commented Feb 21, 2022

For the State updating part that might actually be working. IIRC the EventM or Next brick data types were impossible to unwrap, but we could factor out another, more introspectable DSL than continue :: s -> EventM (Next s). As for the rendering, we needed the full terminal hijack (hacked) test suite, which we have right now.

Also shows focus, invalid values and the maximum amount available.
Fixes issue #224
@ch1bo ch1bo merged commit b75d17d into master Feb 21, 2022
@ch1bo ch1bo deleted the ch1bo/tui-dialog-fixes branch February 21, 2022 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mismatch between value actually sent and intended to be sent when utxo does not have sufficient fund
2 participants