-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDONE.todo
209 lines (187 loc) · 12.2 KB
/
DONE.todo
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
introduce first DSL (JSX-like syntax):
✔ implement `style!` proc macro as first DSL JSX like syntax for TUI @done(22-07-06 15:29)
✔ split `tui_core` from `tui` and move it into `r3bl_rs_utils` @done(22-07-06 15:29)
✔ replace all use of `Style` with this macro @done(22-07-06 16:05)
✔ write DL tutorial on create DSL in Rust @done(22-08-06 20:16)
- based on: https://github.com/r3bl-org/r3bl-rs-utils/blob/main/macro/src/make_style/mod.rs
- create tui category in DL
- make sure to publicize this article on mailchimp, reddit, users.rust-lang.org
documentation, move:
✔ copy some of this content over to the r3bl_rs_utils README @done(22-08-02 13:40)
✔ move `lolcat` module to `r3bl_rs_utils_core::tui` module @done(22-08-02 13:47)
✔ move tests to `r3bl_rs_utils` @done(22-08-02 13:47)
✔ move `tui` module to `r3bl_rs_utils::tui` module @done(22-08-02 15:04)
✔ docs.rs link is missing from crate (on crates.io) @done(22-08-04 10:34)
✔ publish crate *after* r3bl_rs_utils is published @done(22-08-04 10:34)
focus mgmt support:
✔ extend `StateManageFocus` (🔱 statemanagefocus-cursor-support) @done(22-07-27 18:36)
- add methods that allow access to a `HashMap<String, Position>`
- an `id: String` is not enough to store in the `StateManageFocus` trait
- each `id` may have a `Position` associated with it
- this is used to draw the "cursor" (whatever that means to a `RenderComponent`)
- for an editor, it will be the insertion point
- for a text viewer, it will be the cursor position which can be moved around
- add `StateManageFocusData` and fix needless `Hash` trait bound propagation in `r3bl_rs_utils`
✔ what should input handling specificity be? (🔱 input-event-specificity) @done(22-07-28 14:40)
- Currently the `DefaultInputEventHandler` does not consume input events and it peeks at them
- There isn't a way for apps to override any container defaults
- Should this be inverted? Apps get first dibs input event & consume if they handle it?
✔ route input events based on who has focus (🔱 input-event-routing) @done(22-07-31 15:11)
✔ manage a registry of `RenderComponent` after first render pass? @done(22-07-31 15:11)
- pass input events to the id -> `RenderComponent` that has focus?
✔ add method to `RenderComponent` trait to handle input even & return an enum (consumed / not)? @done(22-07-31 15:11)
test 2 col layout:
✔ refactor DEBUG & raw mode & TWCommand @done(22-07-04 20:06)
✔ make sure that the colors work as expected (Color::Red, Color::Rgb, etc) @done(22-07-03 19:43)
✔ row calculation seems wrong (too much space on top of the rendered output) @done(22-07-04 15:10)
✔ clean up decl macros w/ repetitions `tw_command.rs`, `file_logging.rs`, `decl_macros.rs` @done(22-07-04 20:23)
✔ emit clear screen & reset color commands before rendering each frame (artifacts appear on resize) @done(22-07-04 21:00)
✔ does margin (cols) work as expected? (different in vscode terminal vs real terminal) @done(22-07-07 13:41)
✔ make sure that the attributes work as expected (dim, strike through, etc) @done(22-07-29 13:14)
✔ handle situation when cursor is moved PAST the bounds of the window (< 0 or > max) @done(22-07-29 13:14)
- add row and col offset?
- track cursor position?
- Example: https://github.com/nazmulidris/cli-editor/blob/main/src/main.rs
add layout engine:
✔ merge `tw_area_test.rs` + `app_without_layout.rs` -> `app_with_layout.rs` @done(22-07-03 16:47)
✔ make sure to save `app_without_layout.rs` for future use w/ routing below @done(22-07-03 16:26)
✔ rename `tw_area.rs` to `tw_surface` and `TWArea` to `TWSurface` @done(22-07-04 20:27)
✔ paint state & use lolcat @done(22-07-29 13:13)
graphemes:
✔ handle graphemes in truncate @done(22-07-27 11:26)
- currently in `Size`, should be moved into separate module
- add graphemes to tui_core in r3bl_rs_utils
✔ `unicode-width` crate @done(22-07-29 13:12)
✔ Update `tw_surface.rs::print_inside_box()` to support graphemes & text wrapping @done(22-07-29 13:12)
think about containers, containment, and keyboard focus management:
✔ move cursor to relative & absolute (🔱 move-cursor-rel-abs) @done(22-07-17 11:53)
- the pos + size of a box is provided to a *component*
- the *component* paints itself thinking it starts at 0, 0
- the *component* is actually relative to the box when it is rendered
- add TWCommands to handle above:
- `MoveCursorPositionAbs(Position)`
- `MoveCursorPositionRelTo(Position, Position)`
- rename `Render` to `TWApp`
✔ add support for focus management to state (🔱 state-focus-mgmt) @done(22-07-19 11:03)
- need to accommodate handling of focus & what is currently in focus
- introduce trait `StateManageFocus` w/ 2 methods:
- `get_focus_id(): str`
- `set_focus_id(id: str)`
✔ add new trait `RenderComponent` (🔱 better-box-containment) @done(22-07-21 17:45)
- files:
- `tw_surface.rs`,
- `tw_app.rs`,
- `app_with_layout.rs`
- separate the logic of painting from the app
- take box-origin-pos & content-size as input?
- paint things that are relative to box-origin-pos?
- each component should handle its own input event (when it has focus)
✔ clean up old stuff that has been replace by `RenderComponent` @done(22-07-27 11:26)
example handling:
✔ create a simple way of asking user for which ex to run @done(22-07-15 14:11)
✔ use simple readline and then route the request to the correct ex @done(22-07-15 14:11)
✔ separate `sample_app` into: `ex_no_layout` & `ex_with_layout` @done(22-07-15 14:11)
✔ stub out `ex_with_editor` @done(22-07-15 14:11)
impl styling support:
✔ impl `tw_area.rs::paint_inside_box()` to emit `TWCommand::Print` @done(22-06-28 20:40)
✔ clean up `base_units.rs` w/ macro @done(22-06-29 11:07)
✔ clean up `tw_box.rs` and remove needless `Option` wrapper for properties @done(22-06-29 20:23)
✔ fix position calc `tw_area.rs::paint_inside_box()` using origin @done(22-06-29 20:26)
✔ impl `cmd_wrapper.rs::TWCommand::Print(..., style)` -> Attribute @done(22-06-30 19:21)
✔ impl `cmd_wrapper.rs::TWCommand::ApplyStyle(style)` -> Color @done(22-06-30 19:21)
✔ impl `tw_area.rs::paint_inside_box()` to emit styling commands @done(22-06-30 19:21)
✔ update test_tw_area.rs to pretty print `TWCommandQueue` @done(22-06-30 19:22)
✔ use clippy to refactor all of `r3bl_rs_utils` @done(22-07-01 21:20)
✔ add serde support to `TWCommandQueue` & add `test_serde.s` @done(22-07-01 21:20)
✔ update `test_tw_area.rs` w/ real styles (different margins, colors, attributes) @done(22-07-02 18:56)
clean up naming:
✔ rename [Canvas] to [TWArea] @done(22-06-27 19:51)
✔ rename [Layout] to [TWBox] @done(22-06-27 19:51)
✔ update all tests and comments to match @done(22-06-27 19:51)
add lolcat:
✔ figure out lolcat.rs src @done(22-06-26 12:12)
✔ color wheel algo @done(22-06-26 12:12)
✔ draw text w/ different colors (look at lolcat crate) @done(22-06-26 12:12)
✔ integrate `~/github/lolcat_rs` crate into tui project @done(22-06-26 12:12)
render:
✔ figure out how to create VDOM like result -> CommandQueue @done(22-06-19 18:44)
✔ rename Draw -> Render @done(22-06-20 15:35)
✔ accommodate Render returning CommandQueue @done(22-06-20 15:35)
✔ app.rs render the state using CommandQueue (and crossterm commands) @done(22-06-21 17:51)
✔ main_container.rs actually flush CommandQueue in MySubscriber @done(22-06-2118:33)
✔ do initial render in event loop @done(22-06-21 19:04)
✔ fix bug that drops input_events (gh-issues: #1) @done(22-06-22 17:02)
✔ fix bug - resize event does not trigger a redraw (gh-issues: #2) @done(22-06-23 10:05)
✔ main_event_loop.rs - pass in mut vec of keyevents to exit on (gh-issues: #3) @done(22-06-23 13:31)
redux:
✔ create store, state, attach reducer and pass it (create_store.rs) @done(22-06-17 18:04)
✔ in start_event_loop() add subscriber to store @done(22-06-17 18:04)
✔ `main_container.rs`: clean up TODOs & logic @done(22-06-18 09:29)
✔ `app_draw.rs`: dispatch actions on certain keypresses @done(22-06-18 16:35)
✔ `main_container.rs` -> subscriber: state change results in draw() call @done(22-06-18 16:35)
lifecycle & organization:
✔ use electron architecture & terminology as baseline @done(22-06-15 15:40)
✔ figure out how to bootstrap the entire tui framework @done(22-06-15 15:40)
✔ separate concerns (terminal window, app, state, etc) @done(22-06-15 17:36)
✔ integrate Draw trait object @done(22-06-15 17:36)
✔ Draw -> separate draw(store) and handle_event(input_event, store) @done(22-06-16 14:59)
✔ also pass store to the draw trait methods @done(22-06-17 17:30)
publish placeholder on crates.io:
✔ publish r3bl-cmdr crate as placeholder @done(22-06-15 11:15)
✔ move repo from: nazmulidris/rust-scratch/tui-layout-crossterm to: r3bl_org/r3bl-cmdr @done(22-06-15 11:15)
logging:
✔ fix it @done(22-06-11 12:24)
figure out how to use crossterm:
clean up:
✔ rewrite dimens.rs using `From` and `TryFrom` @done(22-06-04 17:53)
✔ log keypress (don't print) @done(22-06-07 15:07)
async vs blocking vs polling:
✔ polling is inefficient and takes up tons of CPU @done(22-06-05 20:09)
✔ try get async crossterm event read working w/ tokio @done(22-06-07 15:07)
https://github.com/crossterm-rs/crossterm/blob/master/examples/event-stream-tokio.rs
generate `output_commands` (in `Canvas`) for crossterm:
✔ reset screen: clear & move cursor to top left @done(22-06-08 16:08)
✔ support queueing commands vs immediate execution w/ macro @done(22-06-08 23:26)
layout & position w/ styling support:
✔ impl positioning of layouts w/ margin @done(22-05-29 11:13)
✔ in test_canvas.rs, @done(22-05-29 11:13)
✔ in layout.rs @done(22-05-29 11:13)
✔ update tests to match above @done(22-05-29 11:13)
styling for layout engine:
✔ create style struct @done(22-05-20 19:06)
✔ impl lazy eval macro (in r3bl_rs_utils), and use it in Style @done(22-05-21 10:40)
✔ impl lazy executor trait for r3bl_rs_utils @done(22-05-21 10:40)
✔ concept of styling for layout (margin, fg color, bg color, focus highlight) @done(22-05-21 10:44)
stylesheets:
✔ extend style to have an id field @done(22-05-22 09:55)
✔ create a stylesheet struct @done(22-05-22 11:27)
✔ write test @done(22-05-22 12:03)
✔ attach it to canvas @done(22-05-23 16:07)
layout.rs:
✔ extend it to have vec of style id's @done(22-05-24 12:50)
canvas.rs: Canvas, LayoutManager & their test:
✔ pass stylesheet in to Canvas @done(22-05-24 13:04)
✔ introduce BoundsProps (for LayoutManager) @done(22-05-24 14:56)
✔ update LayoutProps to handle styles @done(22-05-24 16:08)
✔ use LayoutProps in LayoutManager trait @done(22-05-24 16:08)
✔ pass styles into LayoutManager @done(22-05-24 16:08)
style.rs, test_style.rs, & test_canvas.rs:
✔ impl `Add` trait for `Style` @done(22-05-25 12:26)
✔ update test_style.rs to use `Add` trait @done(22-05-25 14:59)
✔ update test_canvas.rs to use cascading styles @done(22-05-26 13:07)
layout engine in lib:
✔ create `BoxPosition` and `BoxSize` structs @done(22-04-30 11:38)
✔ test `BoxPosition` and `BoxSize` structs @done(22-05-01 19:03)
✔ create `engine.rs` & `Canvas` interface @done(22-05-01 19:09)
✔ create `Canvas` implementation `box_canvas.rs` @done(22-05-04 20:03)
✔ use crate to implement `PerCent` bounded range unsigned integer type @done(22-05-02 11:30)
✔ create `LayoutError` struct and `LayoutErrorType` enum @done(22-05-02 11:44)
✔ implement `LayoutManager` for `Canvas` @done(22-05-04 20:01)
✔ handle root layout @done(22-05-03 17:07)
✔ handle normal layout @done(22-05-04 20:01)
✔ create test for `box_canvas.rs` for a simple 2 column layout @done(22-05-17 16:23)
logging:
✔ find suitable logging crates: `log` and `simple-logging` @done(22-04-25 09:48)
✔ use file logging until layout engine supports debug output in TUI @done(22-04-27 21:16)
fix simplelog crate fail when using Tokio:
✔ https://github.com/r3bl-org/r3bl-rs-utils/commit/1a6308f5effd2504d60db2e896c431a0262db1a1 @done(22-04-30 08:11)