diff --git a/local/docs/RATATUI-APP-PATTERNS.md b/local/docs/RATATUI-APP-PATTERNS.md index 264d8734d9..385143d605 100644 --- a/local/docs/RATATUI-APP-PATTERNS.md +++ b/local/docs/RATATUI-APP-PATTERNS.md @@ -1372,38 +1372,15 @@ gives a natural unit-of-work (count) that scales with thread count. ## 14. Cross-Reference: redbear-power as a Reference Implementation -## 14. Cross-Reference: redbear-power as a Reference Implementation - The `redbear-power` recipe (`local/recipes/system/redbear-power/`) is a useful reference for new TUI apps because: -1. **Small enough to read in one sitting** (~4400 LoC across 15 modules) +1. **Small enough to read in one sitting** (~4400 LoC across 15 modules, with 5 unit tests) 2. **Self-contained** — no D-Bus, no external state, just sysfs/MSR + meminfo + DMI + battery 3. **Modern ratatui 0.30 patterns** — `TableState`, modular layout, status bars, `Tabs` widget 4. **Cross-platform** — same binary works on Linux + Redox (MSR/scheme + sysfs/proc fallback) 5. **Well-documented** — extensive code comments + this doc + improvement plan - -## 14. Cross-Reference: redbear-power as a Reference Implementation - -The `redbear-power` recipe (`local/recipes/system/redbear-power/`) is a useful -reference for new TUI apps because: - -1. **Small enough to read in one sitting** (~4400 LoC across 15 modules) -2. **Self-contained** — no D-Bus, no external state, just sysfs/MSR + meminfo + DMI + battery -3. **Modern ratatui 0.30 patterns** — `TableState`, modular layout, status bars, `Tabs` widget -4. **Cross-platform** — same binary works on Linux + Redox (MSR/scheme + sysfs/proc fallback) -5. **Well-documented** — extensive code comments + this doc + improvement plan - -## 14. Cross-Reference: redbear-power as a Reference Implementation - -The `redbear-power` recipe (`local/recipes/system/redbear-power/`) is a useful -reference for new TUI apps because: - -1. **Small enough to read in one sitting** (~4100 LoC across 14 modules) -2. **Self-contained** — no D-Bus, no external state, just sysfs/MSR + meminfo + DMI -3. **Modern ratatui 0.30 patterns** — `TableState`, modular layout, status bars, `Tabs` widget -4. **Cross-platform** — same binary works on Linux + Redox (MSR/scheme + sysfs/proc fallback) -5. **Well-documented** — extensive code comments + this doc + improvement plan +6. **Testable** — bench module has 5 unit tests covering all stress modes + toggles When porting a new Red Bear TUI app, structure it like redbear-power: