| |
|
| |
# Table of Contents
|
| |
|
| - |
1. [Getting Started](#getting-started)
|
| - |
- [Installation](#installation)
|
| - |
- [Usage](#usage)
|
| - |
2. [Application framework](#application-framework)
|
| - |
- [Design](#design)
|
| - |
- [Example](#example)
|
| - |
3. [Roadmap](#roadmap)
|
| - |
4. [Contributing](#contributing)
|
| - |
5. [Contact](#contact)
|
| - |
6. [License](#license)
|
| + |
1. [Getting Started](#Getting-started)
|
| + |
- [Installation](#Installation)
|
| + |
- [Usage](#Usage)
|
| + |
2. [Build with `radicle-tui`](#Build-with-radicle-tui)
|
| + |
- [Example](#Example)
|
| + |
3. [Contributing](#Contributing)
|
| + |
4. [Contact](#Contact)
|
| + |
5. [License](#License)
|
| |
|
| |
## Getting started
|
| |
|
| - |
This crate provides a binary called `rad-tui` which can be used as a drop-in replacement for `rad`. It maps known commands and operations to internal ones, running the corresponding interface, e.g.
|
| - |
|
| - |
```
|
| - |
rad-tui patch
|
| - |
```
|
| - |
|
| - |
runs the patch list interface and calls `rad` with the operation and id selected. Commands or operations not known to `rad-tui` will be forwarded to `rad`, e.g. the following just calls `rad node`:
|
| - |
|
| - |
```
|
| - |
rad-tui node
|
| - |
```
|
| - |
|
| - |
The default forwarding behaviour can be overridden with a flag, e.g.
|
| - |
|
| - |
```
|
| - |
rad-tui help --no-forward
|
| - |
```
|
| - |
runs the internal help command instead of forwarding to `rad help`.
|
| - |
|
| - |
### Using a shell alias
|
| - |
|
| - |
In order to make the CLI integration opaque, a shell alias can be used:
|
| - |
|
| - |
```
|
| - |
alias rad="rad-tui"
|
| - |
```
|
| - |
|
| |
### Installation
|
| |
|
| |
**Requirements**
|
| |
|
| |
### Usage
|
| |
|
| - |
#### List
|
| + |
This crate provides a binary called `rad-tui` which can be used as a drop-in replacement for `rad`. It maps known commands and operations to internal ones, running the corresponding interface, e.g.
|
| |
|
| - |
Select a patch, an issue or a notification and an operation:
|
| + |
```
|
| + |
rad-tui patch
|
| + |
```
|
| + |
|
| + |
runs the patch list interface and calls `rad` with the operation and id selected. Commands or operations not known to `rad-tui` will be forwarded to `rad`, e.g. the following just calls `rad node`:
|
| + |
|
| + |
```
|
| + |
rad-tui node
|
| + |
```
|
| + |
|
| + |
The default forwarding behaviour can be overridden with a flag, e.g.
|
| |
|
| |
```
|
| - |
rad-tui <patch | issue | inbox>
|
| - |
rad-tui <patch | issue | inbox> list
|
| + |
rad-tui help --no-forward
|
| + |
```
|
| + |
runs the internal help command instead of forwarding to `rad help`.
|
| + |
|
| + |
### Using a shell alias
|
| + |
|
| + |
In order to make the CLI integration opaque, a shell alias can be used:
|
| + |
|
| + |
```
|
| + |
alias rad="rad-tui"
|
| |
```
|
| |
|
| |
#### CLI integration via JSON
|
| |
{ "operation": "show", "ids": ["546443226b300484a97a2b2d7c7000af6e8169ba"], args:[] }
|
| |
```
|
| |
|
| - |
## Application framework
|
| - |
|
| - |
The library portion of this crate is a framework that is the foundation for all `radicle-tui` binaries. It supports building concurrent applications with an immediate mode UI. It comes with a widget library that provides low-level widgets such as lists, text fields etc. as well as higher-level application widgets such as windows, pages and various other containers.
|
| - |
|
| - |
> **Note:** The framework is under heavy development and still missing some required concepts / components as well as some common low-level widgets. These will be added where needed by the `radicle-tui` binaries.
|
| - |
|
| - |
### Design
|
| + |
## Build with `radicle-tui`
|
| |
|
| - |
The framework was built first and foremost with developer experience in mind:
|
| + |
The library portion of this crate is a framework that is the foundation for all `radicle-tui` binaries. Although it evolved from the work on Radicle-specific applications and is far from being complete, it can serve as a general purpose framework to build applications on top already.
|
| |
|
| - |
- **easy-to-use**: building new or changing existing applications should be as easy as possible; ready-made widgets should come with defaults for user interactions and rendering
|
| - |
- **extensibility**: extending existing and building new widgets should be straight-forward; custom application logic components should be easy to implement
|
| - |
- **flexibility**: widgets and application logic should be easy to change and compose; it should be all about changing and composing functions and not about writing boilerplate code
|
| + |
Find out more about the [framework](./FRAMEWORK.md).
|
| |
|
| - |
#### Components
|
| - |
|
| - |
The central pieces of the framework are the `Store`, the `Frontend` and a message passing system that let both communicate with each other. The `Store` handles the centralized application state and sends updates to the `Frontend`, whereas the `Frontend` handles user-interactions and sends messages to the `Store`, which updates the state accordingly.
|
| - |
|
| - |
The `Frontend` drives an _immediate mode_ `Ui`. In _immediate mode_, widgets are rendered the moment they're created and events are handled right before the actual drawing happens (in _retained mode_, you'd create stateful widgets once and later modify their properties or handle their events).
|
| - |
|
| - |
> **Note:** The first versions of the framework provided a retained mode UI (rmUI) which was then replaced in favor of an immediate mode UI (imUI). The Retained mode UI is still supported, but it's recommended to use the new immediate mode UI.
|
| + |
> **Note:** The framework is under heavy development and is missing some common low-level widgets. These will be added where needed by the `radicle-tui` binaries.
|
| |
|
| |
### Example
|
| |
|
| |
}
|
| |
```
|
| |
|
| - |
## ROADMAP
|
| - |
|
| - |
The project roadmap is largely defined by the requirements of the [Radicle](https://radicle.xyz) team. If you're missing something or have any suggestions that would make this better, please feel free to [get in touch](#contact).
|
| - |
|
| - |
### Now
|
| - |
|
| - |
- [ ] Patch review
|
| - |
|
| - |
### Next
|
| - |
|
| - |
- [ ] Support for multiple selected list and tree items
|
| - |
- [ ] Read configuration from file
|
| - |
- [ ] Support user-defined keybindings
|
| - |
|
| - |
### Later
|
| - |
|
| - |
- [ ] Read COBs from JSON input
|
| - |
- [ ] Add support for custom themes
|
| - |
|
| |
## Contributing
|
| |
|
| |
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
|