miniscruff/changie

Key registration issue in project selection Interface with changie in yarn environment

Closed this issue · 5 comments

Thanks for submitting a bug report, please fill in the following details.

Description
Our project is using yarn as package manager and we installed changie with yarn, when trying to use changie such as yarn changie new, the project selects will not work (arrow keys, space, enter key)

Note: running changie new without yarn would work as expected

yarn version: 1.22.21

Projects is in preview mode and may require breaking changes.
? Projects ›
[•] project1
[ ] project2
[ ] project3

? toggle help • space choose • enter confirm • q quit

Reproduction Steps
Steps to reproduce the behavior:

  1. Run 'yarn install'
  2. Run yarn changie new
  3. Try to select and navigate

What happened
The selection indicator is not moving, and it seems terminal environments that do not properly interpret these keys input

Expected behavior
Arrow key should go up and down in the selection UI, space key should be able to select the project and enter key should confirm the selection and proceed to the next step.

Additional context
Sample repo here

This may be related to your terminal/editor more then changie, especially since changie does not directly handle inputs and instead uses bubbletea prompts. A similar situation was reported here #492 and was resolved by simply using the vs-code terminal.

I will try it out now to see if I can actually reproduce it myself but just bringing this up in the meantime.

Hmm, this is definitely repeatable.
node npm/changie.js new

@TheSpyder was the one who did the node stuff, but it does not seem to be getting my user input.

For context: Arvin is on my team 😆

If changie is not receiving any inputs from running the node script directly, then this is probably my fault 🤔

I tried for so long to have the real changie binary be what node runs instead of that JS wrapper, which is something I've seen done on other projects, but I couldn't get it working. I guess when I switched to the JS wrapper I didn't test it properly. Let me check.

Totally my mistake. It was almost a one-line fix 🙃

For context: Arvin is on my team 😆

I figured 😏, we should be able to come up with a good solution for your team, just need a little more time for me to understand what should happen.