Skip to content

Conversation

opudrovs
Copy link
Contributor

@opudrovs opudrovs commented Oct 24, 2022

Closes #2920

  • Wrapped CLI UI elements of the Git providers table and the main bootstrap wizard screen with a Bubble Tea viewport component. If the terminal height is insufficient, the viewport can be scrolled with up and down arrow buttons or mouse wheel.

  • Removed selecting items in the Git providers table with arrow keys and enter. The git providers table is not focusable now, only the text input is.

  • Slightly reworked message handling, returning Bubble Tea commands, and getting view content in the Update functions.

  • Removed some unneeded comments.

  • Ran npm audit fix because the JS tests were failing because of a critical vulnerability.

Notes:

  • The Bubble Tea programs now run in the CLI alt screen buffer/"fullscreen" (WithAltScreen() Bubble Tea program option). As far as I understood, there are fewer side effects (I saw some text getting duplicated if not in "fullscreen"). So, after the Bubble Tea program is exited and control goes back to the main flow, the user selection and the values they entered will disappear from the screen.

  • WithMouseCellMotion() Bubble Tea program option is used for detecting mouse wheel scroll event for viewports.

  • At present, up and down arrow buttons are used for scrolling the view and Tab and Shift+Tab are used to navigate between text inputs. We can make text input focus on mouse click but in a separate ticket or during UI rework. It requires adding mouse click functionality (adding mouse support it is easy, the main thing is detecting where exactly the click happened, so I found a nice bubblezone library for this).

  • I added a message about scrolling the view with up and down arrows to both viewports. But if the terminal is tall enough, this message is not needed. If you would only like to display the message about scrolling only if terminal height is insufficient to hold the whole view output, additional calculations will be needed.

@opudrovs opudrovs added bug Something isn't working team/denim labels Oct 24, 2022
@opudrovs opudrovs force-pushed the 2920-fix-overlapping-ui-elements-in-bootstrap-wizard branch 4 times, most recently from e10310e to ed7960b Compare October 24, 2022 10:58
@opudrovs opudrovs marked this pull request as ready for review October 24, 2022 12:01
@opudrovs opudrovs requested a review from a team October 24, 2022 12:01
Rework bootstrap wizard message handling.

Remove unneeded comments.

Run `npm audit fix`.
@opudrovs opudrovs force-pushed the 2920-fix-overlapping-ui-elements-in-bootstrap-wizard branch from ed7960b to e5b4428 Compare October 24, 2022 14:24
@opudrovs opudrovs merged commit bc22d00 into main Oct 24, 2022
@opudrovs opudrovs deleted the 2920-fix-overlapping-ui-elements-in-bootstrap-wizard branch October 24, 2022 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix overlapping UI elements in bootstrap wizard if height of terminal window is insufficient
2 participants