This repository was archived by the owner on May 11, 2023. It is now read-only.
Open
Conversation
Open
91e415a to
d158b0c
Compare
Contributor
|
Nice, makes sense! |
Closed
f41b1e1 to
d843f4a
Compare
cloudhead
reviewed
Oct 7, 2022
terminal-tui/src/lib.rs
Outdated
| { | ||
| /// Returns the tui-realm application held by this tui-application. | ||
| /// Used to poll new events in main loop. | ||
| fn app(&mut self) -> &mut Application<Id, Message, NoUserEvent>; |
Contributor
Author
There was a problem hiding this comment.
I've now added wrapper functions to the base App such that client applications do not need to know about the tuirealm::Applicaiton anymore.
cloudhead
reviewed
Oct 7, 2022
terminal-tui/src/components.rs
Outdated
| /// aligned and separated by a divider. | ||
| pub struct Tabs { | ||
| props: Props, | ||
| pub states: TabsState, |
Contributor
There was a problem hiding this comment.
selected: usize
len: usize
cloudhead
reviewed
Oct 7, 2022
| self.tabs = Tabs::default().spans(&titles); | ||
| self | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
tabbed_ui
.child("comments", CommentComponent::new())
.child("issues", IssueComponent::new())
Contributor
Author
There was a problem hiding this comment.
Took this into account in the rework.
cloudhead
reviewed
Oct 7, 2022
terminal-tui/examples/demo/app.rs
Outdated
| pub enum TabId { | ||
| Welcome, | ||
| List, | ||
| } |
Contributor
There was a problem hiding this comment.
TabContainer::child(title: impl ToString, ...)
impl Display for TabId
container.child(TabId::Welcome, WelcomeScreen::new())
cloudhead
reviewed
Oct 7, 2022
terminal-tui/examples/demo/app.rs
Outdated
| .borders(Borders::default().sides(BorderSides::NONE)) | ||
| .text_rows(&welcome), | ||
| ), | ||
| ), |
Contributor
There was a problem hiding this comment.
child(child: impl MockComponent) { Box::new(child) }
cloudhead
reviewed
Oct 7, 2022
| }) => return Some(Message::Quit), | ||
| _ => CmdResult::None, | ||
| }; | ||
| Some(Message::None) |
cloudhead
reviewed
Oct 7, 2022
terminal-tui/src/state.rs
Outdated
| /// List of items that keeps track of the selection. | ||
| pub struct Items<T> { | ||
| values: Vec<T>, | ||
| index: usize, |
3e056dc to
076d15c
Compare
Signed-off-by: Erik Kundt <erik@zirkular.io>
Signed-off-by: Erik Kundt <erik@zirkular.io>
Signed-off-by: Erik Kundt <erik@zirkular.io>
Signed-off-by: Erik Kundt <erik@zirkular.io>
Signed-off-by: Erik Kundt <erik@zirkular.io>
Signed-off-by: Erik Kundt <erik@zirkular.io>
Signed-off-by: Erik Kundt <erik@zirkular.io>
Signed-off-by: Erik Kundt <erik@zirkular.io>
076d15c to
e98c353
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces a thin layer on top of tui-realm and provides some common components that can be re-used across multiple TUI applications in the Radicle project.
It's meant to be an alternative implementation of #151, providing the same functionality, but being based on an exising library instead of an own solution / library.
Motivation
After building a few smaller prototypes (e.g. #147) based on #151, it turned out to have some shortcomings:
Some research on how to solve these shortcomings led to the discovery of
tui-realm. Sincetui-realmmakes use of some concepts that were also considered (or even partially used) while developing the initial TUI library (input subscriptions), it seemed to make sense to usetui-realminstead in order to save the effort of implementing and maintaining our own library.tui-realm
The library follows an Elm / React inspired design approach that solves the shortcomings mentioned above:
What should be added next?