Closed huyz closed 1 week ago
Right now if I hit o, new messages come in expanded.
Technically, new steps come in the way they were described client-side, and that part of Moulti defaults to expanded. But I see what you mean. I'll try to think of a smart way to implement that.
New expand/collapse keybindings are available in the devel
branch:
Additionally, the environment variable MOULTI_ENFORCE_COLLAPSIBLE
(possible values: collapse
, expand
) does the same as soon as Moulti starts.
Thanks! I'm trying it out.
I'm thinking that maybe there should always be an exception when there's a prompt, in which case the step should auto-expand regardless of the current collapsed state since there can be no progress unless the user expands the item and inputs some keystroke(s).
My ansible runs start with checking that I have the right ssh key loaded up, and if not yet loaded, it's added to my ssh-agent, which prompts for a passphrase. Since I prefer to start off with all steps as collapsed, then my Ansible runs often start with a collapsed prompt step, which is a bit inconvenient and odd.
I expected that request :) I'll have a look.
Actually, we may have solved this issue from the wrong end.
Since the driver here is Moulti's own Ansible callback plugin, we could simply implement an environment variable named MOULTI_ANSIBLE_COLLAPSE
that describes what to collapse.
By default, nothing would be collapsed and, for instance, export MOULTI_ANSIBLE_COLLAPSE=step
would collapse step
widgets (and only step
widgets) from the very start. Question widgets would naturally remain expanded.
Of course, we can keep the o/x/O/X/Ctrl+o/Ctrl+x keybindings, they do not hurt and can be a good complement to the "Lock scroll" feature.
What do you think?
Sounds good to me
Ok, I have implemented environment variable MOULTI_ANSIBLE_COLLAPSE
.
Later, we could introduce another variable that defines what to do after a question was answered: collapse it (delay), remove it, leave it untouched, etc.
You think step
could also exclude collapsing the PLAY RECAP
at the end?
You think
step
could also exclude collapsing thePLAY RECAP
at the end?
I am going to adjust MOULTI_ANSIBLE_COLLAPSE so it deals with Ansible concepts instead of Moulti widgets.
Done. MOULTI_ANSIBLE_COLLAPSE
now accepts a comma-separated list of Ansible concepts: prompt
, task
, recap
. MOULTI_ANSIBLE_COLLAPSE=task
matches your needs.
By the way, this is not documented, but Moulti's Ansible stdout callback plugin assigns meaningful TCSS classes:
Ansible concept | Moulti Widget | TCSS class |
---|---|---|
Playbook | divider | ansible_playbook |
Play | divider | ansible_play |
Task | step | ansible_task |
Recap | step | ansible_recap |
Prompt | inputquestion question | ansible_prompt |
PS: do not git pull, I have force-pushed :roll_eyes:
Fixed in 1.15.0.
Once I hit
x
oro
to expand or collapse all, it would be nice if incoming messages would obey that preference. Right now if I hito
, new messages come in expanded.