Skip to content

Commit c968ac2

Browse files
committed
docs(research): remove stale ecosystem entries and fix component trait
- Remove throbber-widgets-tui (never used — spinner is hand-rolled). - Remove syntect and ansi-to-tui as standalone entries (transitive deps of tui-markdown, not direct dependencies). - Merge Input & Interaction table into Rendering & Content. - Update Component trait example to match our actual interface (no init/update methods).
1 parent cf39dbc commit c968ac2

1 file changed

Lines changed: 7 additions & 22 deletions

File tree

docs/research/tui.md

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -152,38 +152,23 @@ The terminal flickering problem (anthropics/claude-code#1913) affects most CLI-b
152152

153153
### Rendering & Content
154154

155-
| Crate | Purpose |
156-
| ---------------------------------------------- | ------------------------------------------------------------ |
157-
| `tui-markdown` (with `highlight-code` feature) | Markdown → ratatui widget, uses pulldown-cmark + syntect |
158-
| `syntect` | Syntax highlighting for code blocks (Sublime Text grammar) |
159-
| `ansi-to-tui` | Convert raw ANSI output (from shell tools) to ratatui Styles |
160-
161-
### Input & Interaction
162-
163-
| Crate | Purpose |
164-
| ------------------ | ---------------------------------------------------------------- |
165-
| `ratatui-textarea` | Multi-line text input widget with cursor, selection, undo / redo |
166-
167-
### Visual Polish
168-
169-
| Crate | Purpose |
170-
| ---------------------- | ------------------------------------------------------- |
171-
| `throbber-widgets-tui` | Spinners and activity indicators (braille dot patterns) |
155+
| Crate | Purpose |
156+
| ---------------------------------------------- | ------------------------------------------------------------------------------ |
157+
| `tui-markdown` (with `highlight-code` feature) | Markdown → ratatui `Text`, uses pulldown-cmark + syntect (syntax highlighting) |
158+
| `ratatui-textarea` | Multi-line text input widget with cursor, selection, undo / redo |
172159

173160
### Architecture Pattern: Component Trait
174161

175-
The recommended pattern from ratatui's official templates (and used by gitui, bottom, etc.):
162+
Our simplified variant of the pattern from ratatui's official templates:
176163

177164
```text
178165
trait Component {
179-
fn init(&mut self) -> Result<()>;
180-
fn handle_event(&mut self, event: Event) -> Result<Option<Action>>;
181-
fn update(&mut self, action: Action) -> Result<Option<Action>>;
166+
fn handle_event(&mut self, event: &Event) -> Option<Action>;
182167
fn render(&self, frame: &mut Frame, area: Rect);
183168
}
184169
```
185170

186-
Each component owns its state, handles its events, and renders into a given area. The root `App` dispatches events top-down and collects actions bottom-up.
171+
Each component owns its state, handles its events, and renders into a given area. The root `App` dispatches events top-down and collects actions bottom-up. We omit `init()` and `update()` — state mutations happen directly in event handlers, keeping the interface minimal.
187172

188173
### Async Integration Pattern
189174

0 commit comments

Comments
 (0)