Skip to content

tui: add more interactions#7484

Closed
Alizter wants to merge 8 commits intoocaml:mainfrom
Alizter:ps/branch/wip_more_interactions_with_tui
Closed

tui: add more interactions#7484
Alizter wants to merge 8 commits intoocaml:mainfrom
Alizter:ps/branch/wip_more_interactions_with_tui

Conversation

@Alizter
Copy link
Copy Markdown
Collaborator

@Alizter Alizter commented Apr 4, 2023

We add some more features to the --display tui mode.

Waiting for #7663

Features:

  • Messages to the user a separated with a rule and include a numbering together with total number of messages.
  • Horizontal and vertical scroll bars which can be controlled using the arrow keys, j and k or by interacting with the mouse including scrolling and clicking. (Horizontal scrolling is done with Meta (alt) + Scroll.
  • Help screen activated with h or ? explaining what keys do what.
  • Debug features:
    • Pressing 'd' will output some debug info about the state of the UI.
    • Pressing Meta + l will make dune output a lorem ipsum, allowing to quickly test any issues with scrolling. (I want to keep this in as it is harmless and out of the way).

How to test:

Just run

./dune.exe build @install
_build/install/bin/dune build @check -w --display tui

Compatibility

  • Linux
    • Alacritty, works fine, this is in the screenshots
    • xterm, works but meta + l is sometimes ignored
    • gnome console, works fine
  • macos
  • windows
    • cmd
    • wsl

Issues

  • Exceptions are not printed when in tui mode. We need to have a fallback display. For example, running two watch mode tui's will cause the second one to crash silently and return to the prompt since Dune will complain about the _build lock. We should probably add a way internal exceptions can be displayed or printed nicely.
  • Needs to look good on light terminals, the colors used are somewhat ad-hoc. We need to make them more configurable and then adapt based on terminal colors chosen.

@Alizter Alizter force-pushed the ps/branch/wip_more_interactions_with_tui branch from 0d916a2 to 2f13484 Compare April 4, 2023 04:11
@rgrinberg

This comment was marked as resolved.

@Alizter

This comment was marked as resolved.

@rgrinberg

This comment was marked as resolved.

@Alizter

This comment was marked as resolved.

@Alizter Alizter force-pushed the ps/branch/wip_more_interactions_with_tui branch from 2f13484 to 5ed64b3 Compare April 21, 2023 18:39
@Alizter Alizter force-pushed the ps/branch/wip_more_interactions_with_tui branch 2 times, most recently from 1cbf96a to 44b02f1 Compare May 1, 2023 20:58
@Alizter

This comment was marked as resolved.

@Alizter Alizter force-pushed the ps/branch/wip_more_interactions_with_tui branch 4 times, most recently from 560db92 to ea0716b Compare May 2, 2023 10:47
@Alizter Alizter changed the title WIP more interactions with tui tui: add more interactions May 2, 2023
@Alizter Alizter force-pushed the ps/branch/wip_more_interactions_with_tui branch 4 times, most recently from f5b0532 to 5df52c2 Compare May 2, 2023 18:16
rgrinberg and others added 8 commits May 2, 2023 20:27
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

<!-- ps-id: 1e29eae2-40a1-4f0e-8ea1-81418eec9b72 -->
Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
The help screen can be toggled on and off.

The scroll bars appear when the main text is cut off in the horizontal
or vertical directions. They can be interacted with using the arrow
keys, j and k and using the mouse. The mouse can scroll and click on
them.

Added a utility to provide debug info, which can be useful determining
the state of the UI. It can be activated using 'd'.

Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
We improve the logic for scroll handling. Notably now the arrow buttons
on the scroll bars work.

We also make many of the used style attrubutes internally configurable
and fix any styles biased to a dark background.

There are various cleanups for the drawing of the top frame, including
making the debug info menu a proper overlay rather than just appending
to the end.

Signed-off-by: Ali Caglayan <alizter@gmail.com>
@Alizter Alizter force-pushed the ps/branch/wip_more_interactions_with_tui branch from 5df52c2 to 7a07c3b Compare May 2, 2023 18:27
@Alizter
Copy link
Copy Markdown
Collaborator Author

Alizter commented Jun 25, 2023

This is being worked on at the moment but will come as a different PR.

@Alizter Alizter closed this Jun 25, 2023
@Alizter Alizter mentioned this pull request Aug 21, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants