Add numbered shortcuts and filter search to Question select/checkbox - #2446
Add numbered shortcuts and filter search to Question select/checkbox#2446RR5555 wants to merge 24 commits into
Question select/checkbox#2446Conversation
…ilter_search` to `Question` class for selection with number shortcuts or filter Refs: copier-org#2155
…se_shortcuts` & `use_filter_search`
…& `use_filter_search`
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2446 +/- ##
==========================================
- Coverage 97.17% 96.81% -0.37%
==========================================
Files 60 61 +1
Lines 7147 7246 +99
==========================================
+ Hits 6945 7015 +70
- Misses 202 231 +29
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Per reviewer suggestion/request Reviewed-by: sisp Refs: copier-org#2446#discussion_r2678784231
Per reviewer suggestion/request Reviewed-by: sisp Refs: copier-org#2446#discussion_r2678784231
f043dd4 to
08371bf
Compare
…_filter_search` to `use_search_filter` Per reviewer catch to match `questionary` args as intended Reviewed-by: sisp Refs: copier-org#2446#discussion_r2678785014
Per reviewer request Reviewed-by: sisp Refs: copier-org#2446#discussion_r2678786515
Per reviewer suggestion/request Remove development leftovers Reviewed-by: sisp Refs: copier-org#2446#discussion_r2678777344 copier-org#2446#discussion_r2678779566
Per reviewer suggestion/request Reviewed-by: sisp Refs: copier-org#2446#discussion_r2678780560
…_filter` Per reviewer suggestion/request Reviewed-by: sisp Refs: copier-org#2446#pullrequestreview-3647014001
|
Thank you for reviewing another of my PRs ^^ I had a first go at the documentation of the settings (docs(docs/configuring.md): add docs for |
…se_searcg_filter` Per reviewer suggestion/request Reviewed-by: sisp Refs: copier-org#2446#discussion_r2678783429
…pes` change `dict` to `dict[str, Any]`
…al exclusiveness Per reviewer request. Before: `use_search_filter`>`use_shortcuts` After: ValidationError Before: `multiselect`>`use_shortcuts` After: ValidationError Refs: copier-org#2446#pullrequestreview-3687996014
Per reviewer request. Refs: copier-org#2446#pullrequestreview-3687996014
…add ValidationError tests Per reviewer request. Refs: copier-org#2446#discussion_r2718709082
…se_shortcuts` & `use_search_filter` Per reviewer request. Refs: copier-org#2446#pullrequestreview-3687996014
Per reviewer request/suggestion. Refs: copier-org#2446#pullrequestreview-3687996014
|
Thank you for your previous round of review. Sorry for the delay. |
sisp
left a comment
There was a problem hiding this comment.
Looks great, thank you! 👍 Just a minor request and a question, then we're ready to merge. 🎉
…el Validator Per reviewer request. Refs: copier-org#2446#discussion_r2959476896
Per reviewer request. Refs: copier-org#2446#discussion_r2959525263
b75af8f to
ddddbea
Compare
pre-commit hook `rumdl` run by `autofix-ci` would break the output examples contained in the `pre` tags
10ba39b to
38a3954
Compare
Follow-up on the previous commit where two additional `pre` blocks were missed.
PR Description
This PR adds the
questionaryoptionsuse_shortcuts&use_filter_searchto CopierQuestion, to allow the usage of numbered shortcuts forselectquestions, and filter search forselect/checkboxquestions.It addresses Issue #2155
It adds two new attributes to the
Questionclass:use_shortcuts: booluse_filter_search: boolWhich are passed down to
questionary, thus producing the desired effect.Note
use_filter_searchis not compatible withuse_jk_keysquestionaryoption which is activated by default. Thus, whenuse_filter_searchisTruefor aselect/checkboxquestion, we pass and putuse_jk_keystoFalse.Choice
Although, it is possible to pass both
{use_filter_search: True, use_shortcuts: True}forselectquestions, I have decided to makeuse_filter_searchhave precedence overuse_shortcutsto avoid any ambiguity. Thus, if both areTruefor aselectquestion, onlyuse_filter_searchis passed and activated.Usage
use_shortcutscopier.yamlThis will display:
And pressing
3will direct the cursor onto3) three.use_filter_searchcopier.yamlPressing
twill make a field appeared at the bottom left with/ t...while only showing:Next, pressing
wwill change the bottom field to/ tw..while only showing:Pressing Backspace will delete the searched letter one at a time, allowing for correction or new/additional filter search.
Limitation
The two new attributes are only booleans, they are not
str|bool, and not rendered.