File: guide.md

package info (click to toggle)
rust-taskwarrior-tui 0.26.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,060 kB
  • sloc: sh: 71; makefile: 9
file content (60 lines) | stat: -rw-r--r-- 1,472 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Developer guide

## Running tests

```bash
git clone https://github.com/kdheepak/taskwarrior-tui
cd taskwarrior-tui

git clone https://github.com/kdheepak/taskwarrior-testdata tests/data
source .envrc

cargo test
```

## Running debug build

```bash
cargo run
```

## Running release build

```bash
cargo run --release
```

## Testing individual function

If you want to test the `test_taskwarrior_timing` function in `src/app.rs`:

```bash
cargo test -- app::tests::test_taskwarrior_timing --nocapture
```

## Getting logs

```bash
export TASKWARRIOR_TUI_LOG_LEVEL=debug
taskwarrior-tui

# OR

export TASKWARRIOR_TUI_LOG_LEVEL=trace
cargo run
```

## Contributing to documentation

See `docs/` folder in the repository: <https://github.com/kdheepak/taskwarrior-tui>

When you make a PR to the repository, a preview of the documentation is rendered and a link is posted to the PR.

## Internals of `taskwarrior-tui`

`taskwarrior-tui` is a state driven terminal user interface.
Keyboard events are read asynchronously and is communicated using channels.
Most of the logic is implemented in `src/app.rs`.
The difference between the previous state and the current state of the TUI is rendered every `Tick` by `tui-rs`.
`app.draw_...` functions are responsible for rendering the UI.
Actions for key presses are taken in [`app.handle_input(&mut self, input: Key)`](https://github.com/kdheepak/taskwarrior-tui/blob/f7f89cbff180f81a3b27112d676d6101b0b552d8/src/app.rs#L1893).