-
Notifications
You must be signed in to change notification settings - Fork 192
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
Better UI for command line launch #829
Conversation
* Use ansi colours for the default values and filled values in the group select view of params (nf-core#816) * Add to group select prompt a warning that a value is required, if not yet filled and no default
Codecov Report
@@ Coverage Diff @@
## dev #829 +/- ##
==========================================
- Coverage 78.34% 78.00% -0.35%
==========================================
Files 22 22
Lines 2480 2491 +11
==========================================
Hits 1943 1943
- Misses 537 548 +11
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, couldn't find anything suspicious 👍
# Show error messages if we have any | ||
for msg in error_msgs: | ||
question["choices"].append( | ||
questionary.Choice( | ||
[("bg:ansiblack fg:ansired bold", " error "), ("fg:ansired", f" - {msg}")], disabled=True | ||
) | ||
) | ||
error_msgs = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't that make more sense after line 491, where you check for errors?
Or does it require a 'fresh' question object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the logic is a bit funny here. If there are errors then the question is asked again. So in lines 491 we collect error messages, then the loop fires again. Here we are printing the errors if there are any from the last time we went around and then clearing them once shown (so that they don't persist forever).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I get it, makes sense like that :D thanks!
Refined UI around the Questionary prompts:
Screenshots of cli interface before and after changes in this PR:
Implementation of #816 and with help from tmbo/questionary#107
PR checklist
CHANGELOG.md
is updateddocs
is updated