rooibos 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. checksums.yaml +4 -4
  2. data/.builds/ruby-3.2.yml +9 -5
  3. data/.builds/ruby-3.3.yml +9 -5
  4. data/.builds/ruby-3.4.yml +9 -5
  5. data/.builds/ruby-4.0.0.yml +9 -5
  6. data/AGENTS.md +1 -1
  7. data/CHANGELOG.md +46 -0
  8. data/README.md +2 -2
  9. data/README.rdoc +374 -0
  10. data/REUSE.toml +5 -0
  11. data/Rakefile +1 -1
  12. data/doc/best_practices/forms_and_validation.md +20 -0
  13. data/doc/best_practices/http_workflows.md +20 -0
  14. data/doc/best_practices/index.md +26 -0
  15. data/doc/best_practices/lists_and_tables.md +20 -0
  16. data/doc/best_practices/modal_dialogs.md +20 -0
  17. data/doc/best_practices/no_stateful_widgets.md +184 -0
  18. data/doc/best_practices/orchestration.md +20 -0
  19. data/doc/best_practices/streaming_data.md +20 -0
  20. data/doc/contributors/design/commands_and_outlets.md +1 -1
  21. data/doc/contributors/documentation_plan.md +616 -0
  22. data/doc/contributors/documentation_stub_audit.md +112 -0
  23. data/doc/contributors/documentation_style.md +275 -0
  24. data/doc/contributors/e2e_pty.md +168 -0
  25. data/doc/contributors/specs/earliest_tutorial_steps_per_story.md +70 -0
  26. data/doc/contributors/specs/file_browser.md +789 -0
  27. data/doc/contributors/specs/file_browser_stories.md +774 -0
  28. data/doc/contributors/specs/tutorials_to_stories.rb +167 -0
  29. data/doc/contributors/todo/scrollbar.md +118 -0
  30. data/doc/contributors/tutorial_old/01_project_setup.md +20 -0
  31. data/doc/contributors/tutorial_old/02_hello_world.md +24 -0
  32. data/doc/contributors/tutorial_old/03_adding_state.md +26 -0
  33. data/doc/contributors/tutorial_old/06_organizing_your_code.md +20 -0
  34. data/doc/contributors/tutorial_old/07_your_first_command.md +21 -0
  35. data/doc/contributors/tutorial_old/08_the_preview_pane.md +20 -0
  36. data/doc/contributors/tutorial_old/09_loading_states.md +20 -0
  37. data/doc/contributors/tutorial_old/10_testing_your_app.md +20 -0
  38. data/doc/contributors/tutorial_old/11_polish_and_refine.md +20 -0
  39. data/doc/contributors/tutorial_old/12_going_further.md +20 -0
  40. data/doc/contributors/tutorial_old/index.md +20 -0
  41. data/doc/essentials/commands.md +20 -0
  42. data/doc/essentials/index.md +31 -0
  43. data/doc/essentials/messages.md +21 -0
  44. data/doc/essentials/models.md +21 -0
  45. data/doc/essentials/shortcuts.md +19 -0
  46. data/doc/essentials/the_elm_architecture.md +24 -0
  47. data/doc/essentials/the_runtime.md +21 -0
  48. data/doc/essentials/update_functions.md +20 -0
  49. data/doc/essentials/views.md +22 -0
  50. data/doc/getting_started/for_go_developers.md +16 -0
  51. data/doc/getting_started/for_python_developers.md +16 -0
  52. data/doc/getting_started/for_react_developers.md +17 -0
  53. data/doc/getting_started/index.md +52 -0
  54. data/doc/getting_started/install.md +20 -0
  55. data/doc/getting_started/quickstart.md +9 -45
  56. data/doc/getting_started/ruby_primer.md +19 -0
  57. data/doc/getting_started/why_rooibos.md +20 -0
  58. data/doc/index.md +79 -11
  59. data/doc/scaling_up/async_patterns.md +20 -0
  60. data/doc/scaling_up/command_composition.md +20 -0
  61. data/doc/scaling_up/custom_commands.md +21 -0
  62. data/doc/scaling_up/fractal_architecture.md +20 -0
  63. data/doc/scaling_up/index.md +30 -0
  64. data/doc/scaling_up/message_routing.md +20 -0
  65. data/doc/scaling_up/ractor_safety.md +20 -0
  66. data/doc/scaling_up/testing.md +21 -0
  67. data/doc/troubleshooting/common_errors.md +20 -0
  68. data/doc/troubleshooting/debugging.md +21 -0
  69. data/doc/troubleshooting/index.md +23 -0
  70. data/doc/troubleshooting/performance.md +20 -0
  71. data/doc/tutorial/01_project_setup.md +44 -0
  72. data/doc/tutorial/02_hello_world.md +45 -0
  73. data/doc/tutorial/03_static_file_list.md +44 -0
  74. data/doc/tutorial/04_arrow_navigation.md +47 -0
  75. data/doc/tutorial/05_real_files.md +45 -0
  76. data/doc/tutorial/06_safe_refactoring.md +21 -0
  77. data/doc/tutorial/07_red_first_tdd.md +26 -0
  78. data/doc/tutorial/08_file_metadata.md +42 -0
  79. data/doc/tutorial/09_text_preview.md +44 -0
  80. data/doc/tutorial/10_directory_tree.md +42 -0
  81. data/doc/tutorial/11_pane_focus.md +40 -0
  82. data/doc/tutorial/12_sorting.md +41 -0
  83. data/doc/tutorial/13_filtering.md +43 -0
  84. data/doc/tutorial/14_toggle_hidden.md +41 -0
  85. data/doc/tutorial/15_text_input_widget.md +43 -0
  86. data/doc/tutorial/16_rename_files.md +42 -0
  87. data/doc/tutorial/17_confirmation_dialogs.md +43 -0
  88. data/doc/tutorial/18_progress_indicators.md +43 -0
  89. data/doc/tutorial/19_atomic_operations.md +42 -0
  90. data/doc/tutorial/20_external_editor.md +42 -0
  91. data/doc/tutorial/21_modal_overlays.md +41 -0
  92. data/doc/tutorial/22_error_handling.md +43 -0
  93. data/doc/tutorial/23_terminal_capabilities.md +53 -0
  94. data/doc/tutorial/24_mouse_events.md +43 -0
  95. data/doc/tutorial/25_resize_events.md +43 -0
  96. data/doc/tutorial/26_loading_states.md +42 -0
  97. data/doc/tutorial/27_performance.md +43 -0
  98. data/doc/tutorial/28_color_schemes.md +47 -0
  99. data/doc/tutorial/29_configuration.md +124 -0
  100. data/doc/tutorial/30_going_further.md +17 -0
  101. data/doc/tutorial/index.md +17 -0
  102. data/examples/app_file_browser/app.rb +40 -0
  103. data/examples/app_fractal_dashboard/dashboard/update_manual.rb +7 -7
  104. data/examples/app_fractal_dashboard/fragments/custom_shell_input.rb +5 -5
  105. data/examples/app_fractal_dashboard/fragments/custom_shell_modal.rb +1 -1
  106. data/examples/app_fractal_dashboard/fragments/disk_usage.rb +2 -2
  107. data/examples/app_fractal_dashboard/fragments/network_panel.rb +4 -4
  108. data/examples/app_fractal_dashboard/fragments/ping.rb +2 -2
  109. data/examples/app_fractal_dashboard/fragments/stats_panel.rb +4 -4
  110. data/examples/app_fractal_dashboard/fragments/system_info.rb +2 -2
  111. data/examples/app_fractal_dashboard/fragments/uptime.rb +2 -2
  112. data/examples/verify_website_first_app/app.rb +85 -0
  113. data/examples/verify_website_hello_mvu/app.rb +31 -0
  114. data/examples/widget_command_system/app.rb +15 -13
  115. data/exe/rooibos +10 -0
  116. data/generate_tutorial_stubs.rb +126 -0
  117. data/lib/rooibos/cli/commands/new.rb +373 -0
  118. data/lib/rooibos/cli/commands/run.rb +98 -0
  119. data/lib/rooibos/cli.rb +78 -0
  120. data/lib/rooibos/command/all.rb +25 -20
  121. data/lib/rooibos/command/batch.rb +26 -25
  122. data/lib/rooibos/command/custom.rb +84 -1
  123. data/lib/rooibos/command/http.rb +59 -55
  124. data/lib/rooibos/command/lifecycle.rb +5 -5
  125. data/lib/rooibos/command/open.rb +86 -0
  126. data/lib/rooibos/command/outlet.rb +105 -3
  127. data/lib/rooibos/command/wait.rb +5 -5
  128. data/lib/rooibos/command.rb +57 -74
  129. data/lib/rooibos/message/batch.rb +39 -0
  130. data/lib/rooibos/message/canceled.rb +51 -0
  131. data/lib/rooibos/message/error.rb +48 -0
  132. data/lib/rooibos/message/open.rb +30 -0
  133. data/lib/rooibos/message.rb +84 -4
  134. data/lib/rooibos/router.rb +11 -14
  135. data/lib/rooibos/runtime.rb +40 -43
  136. data/lib/rooibos/shortcuts.rb +47 -0
  137. data/lib/rooibos/test_helper.rb +71 -6
  138. data/lib/rooibos/version.rb +1 -1
  139. data/lib/rooibos/welcome.rb +237 -0
  140. data/lib/rooibos.rb +4 -3
  141. data/mise.toml +1 -1
  142. data/rbs_collection.lock.yaml +2 -2
  143. data/sig/concurrent.rbs +3 -0
  144. data/sig/gem.rbs +20 -0
  145. data/sig/rooibos/cli.rbs +42 -0
  146. data/sig/rooibos/command.rbs +48 -0
  147. data/sig/rooibos/message.rbs +60 -0
  148. data/sig/rooibos/shortcuts.rbs +14 -0
  149. data/sig/rooibos/test_helper.rbs +6 -2
  150. data/sig/rooibos/welcome.rbs +75 -0
  151. data/tasks/install.rake +29 -0
  152. data/tasks/resources/build.yml.erb +2 -0
  153. metadata +272 -38
  154. data/doc/concepts/application_architecture.md +0 -197
  155. data/doc/concepts/application_testing.md +0 -49
  156. data/doc/concepts/async_work.md +0 -164
  157. data/doc/concepts/commands.md +0 -530
  158. data/doc/concepts/message_processing.md +0 -51
  159. data/doc/contributors/WIP/decomposition_strategies_analysis.md +0 -258
  160. data/doc/contributors/WIP/implementation_plan.md +0 -409
  161. data/doc/contributors/WIP/init_callable_proposal.md +0 -344
  162. data/doc/contributors/WIP/runtime_refactoring_status.md +0 -47
  163. data/doc/contributors/WIP/task.md +0 -36
  164. data/doc/contributors/WIP/v0.4.0_todo.md +0 -468
  165. data/doc/contributors/kit-no-outlet.md +0 -238
  166. data/doc/contributors/priorities.md +0 -38
  167. data/doc/images/.gitkeep +0 -0
  168. data/exe/.gitkeep +0 -0
  169. /data/doc/contributors/{WIP → design}/mvu_tea_implementations_research.md +0 -0
@@ -0,0 +1,616 @@
1
+ <!--
2
+ SPDX-FileCopyrightText: 2026 Kerrick Long <me@kerricklong.com>
3
+ SPDX-License-Identifier: CC-BY-SA-4.0
4
+ -->
5
+
6
+ # Rooibos Documentation Complete Overhaul Proposal
7
+
8
+ ## Executive Summary
9
+
10
+ **Goal**: Defeat BubbleTea in the marketplace for TUI frameworks. Make Ruby the language people learn to build TUIs.
11
+
12
+ Rooibos has **excellent** contributor-facing design documentation but **incomplete** user-facing guides. This proposal restructures the `doc/` directory into a Rails Guides–style information architecture—comprehensive enough to onboard developers who have never written Ruby.
13
+
14
+ ---
15
+
16
+ ## Strategic Context
17
+
18
+ ### The Competitive Landscape
19
+
20
+ | Framework | Language | Docs Scale | Target Audience |
21
+ |-----------|----------|------------|------------------|
22
+ | **BubbleTea** | Go | ~50KB + examples | Go developers |
23
+ | **Iced** | Rust | ~30KB + examples | Rust developers |
24
+ | **textual** | Python | ~200KB | Python developers |
25
+ | **Rooibos** | Ruby | **~370KB (target)** | **Everyone** |
26
+
27
+ Rooibos should be the Rails of TUI frameworks: the one that makes people *want* to learn Ruby.
28
+
29
+ ### Target Audiences
30
+
31
+ Unlike Ember/Vue (JS-only), Rooibos targets **three distinct audiences**:
32
+
33
+ #### 1. Rubyists
34
+ - **Know**: Ruby syntax, OOP, Rails/Hanami patterns
35
+ - **Don't know**: Functional programming, long-lived stateful apps (Rails is request/response)
36
+ - **Need**: Conceptual bridge from stateless web to stateful TUI, MVU mental model
37
+
38
+ #### 2. Front-End Developers
39
+ - **Know**: JavaScript, React (passive MVU exposure via Redux), have used TUIs (lazygit, etc.)
40
+ - **Don't know**: Ruby, terminal programming, architecture
41
+ - **Need**: Ruby crash course, explicit connection to React/Redux patterns they already know
42
+
43
+ #### 3. Polyglots / Newcomers
44
+ - **Know**: Varies—could be Go, Rust, Python, or nothing
45
+ - **Don't know**: Potentially everything
46
+ - **Need**: Complete onboarding from zero, language-agnostic conceptual explanations
47
+
48
+ ### Implications for Documentation
49
+
50
+ | Audience | Rails does this | Rooibos should do this |
51
+ |----------|-----------------|------------------------|
52
+ | Rubyists | Assumes Ruby knowledge | Same |
53
+ | Non-Rubyists | "Learn Ruby first" | **Teach Ruby inline** (like Rails' Getting Started) |
54
+ | Architecture-naive | Explains MVC from scratch | **Explain MVU from scratch** |
55
+ | Polyglots | Links to Ruby docs | **Provide comparison tables** ("If you know Go...") |
56
+
57
+ ### Documentation Scope: Rooibos vs. RatatuiRuby
58
+
59
+ Rooibos and RatatuiRuby have **complementary responsibilities**. Avoid duplicating widget/rendering docs.
60
+
61
+ | Topic | Rooibos docs teach | RatatuiRuby docs (link to) |
62
+ |-------|-------------------|----------------------------|
63
+ | **Architecture** | MVU loop, functional runtime | — |
64
+ | **State management** | Model design, Data.define | — |
65
+ | **Messages** | Types, predicates, routing | *Event handling* (predicates) |
66
+ | **Commands** | Built-in + custom commands, async | — |
67
+ | **Views** | *What a view function is*, returning layouts | Widgets, styling, layout APIs |
68
+ | **Widgets** | — | Paragraph, Table, List, Block, etc. |
69
+ | **Layouts** | — | Rect, Constraint, Layout engine |
70
+ | **Testing** | TestHelper, update testing | Buffer assertions, view testing |
71
+ | **Debugging** | Runtime debug mode | Terminal debugging, buffer inspection |
72
+
73
+ **Strategy**: Rooibos `views.md` explains the *contract* (what a view function returns) and links out to RatatuiRuby for the actual widget catalog. The tutorial teaches *just enough* widgets to build the app, with "See RatatuiRuby docs for more" links.
74
+
75
+ ---
76
+
77
+
78
+ ## Current State Analysis
79
+
80
+ ### RatatuiRuby Documentation (The Gold Standard)
81
+
82
+ | Section | Files | Total Size | Quality |
83
+ |---------|-------|------------|---------|
84
+ | **Getting Started** | 2 | ~18KB | Complete tutorials with screenshots |
85
+ | **Concepts** | 7 | ~49KB | Full C-P-S pattern, comprehensive examples |
86
+ | **Troubleshooting** | 3 | ~11KB | Dedicated problem-solving guides |
87
+ | **Index** | 1 | ~1.4KB | Clear navigation with section headers |
88
+
89
+ **Structure:**
90
+ ```
91
+ doc/
92
+ ├── index.md # Navigation hub
93
+ ├── getting_started/
94
+ │ ├── why.md # Philosophy and comparisons
95
+ │ └── quickstart.md # 292 lines, 3 tutorials, examples gallery
96
+ ├── concepts/
97
+ │ ├── application_architecture.md # 322 lines, lifecycle patterns
98
+ │ ├── application_testing.md # 194 lines, test helpers
99
+ │ ├── async.md # 191 lines, background work
100
+ │ ├── custom_widgets.md # 248 lines, escape hatch
101
+ │ ├── debugging.md # 402 lines, remote debugging
102
+ │ ├── event_handling.md # 163 lines, predicates + patterns
103
+ │ └── interactive_design.md # 147 lines, cached layout
104
+ ├── troubleshooting/
105
+ │ ├── async.md
106
+ │ ├── terminal_limitations.md
107
+ │ └── tui_output.md
108
+ └── contributors/
109
+ └── ... (15 files)
110
+ ```
111
+
112
+ ### Rooibos Documentation (Current State)
113
+
114
+ | Section | Files | Total Size | Quality |
115
+ |---------|-------|------------|---------|
116
+ | **Getting Started** | 1 | ~2KB | Placeholder stubs |
117
+ | **Concepts** | 5 | ~27KB | Mixed: 2 good, 3 incomplete |
118
+ | **Troubleshooting** | 0 | 0 | Missing entirely |
119
+ | **Index** | 1 | ~0.8KB | Minimal navigation |
120
+
121
+ **Structure:**
122
+ ```
123
+ doc/
124
+ ├── index.md # Minimal, links 2 concept docs
125
+ ├── getting_started/
126
+ │ └── quickstart.md # 57 lines, ALL placeholders
127
+ ├── concepts/
128
+ │ ├── application_architecture.md # 198 lines, incomplete Core Concepts
129
+ │ ├── application_testing.md # 50 lines, placeholder
130
+ │ ├── async_work.md # 165 lines, solid C-P-S
131
+ │ ├── commands.md # 531 lines, EXCELLENT
132
+ │ └── message_processing.md # 52 lines, minimal
133
+ └── contributors/
134
+ ├── design/
135
+ │ ├── commands_and_outlets.md # 215 lines, rich pattern lineage
136
+ │ └── mvu_tea_implementations_research.md # 374 lines, thorough
137
+ └── WIP/
138
+ └── ...
139
+ ```
140
+
141
+ ### The Inversion Problem
142
+
143
+ Rooibos has **inverted documentation priority**:
144
+
145
+ - **User concepts**: 5 docs, 3 incomplete, ~27KB
146
+ - **Contributor design**: 2 docs, both thorough, ~20KB
147
+
148
+ Users hit `doc/concepts/` first. They don't discover the rich pattern documentation until they're already contributors.
149
+
150
+ ---
151
+
152
+ ## Proposed Information Architecture
153
+
154
+ ### Research: Rails Guides, Vue.js Docs, and Ember Guides
155
+
156
+ I examined the actual source files for all three frameworks. Here's what I found:
157
+
158
+ ---
159
+
160
+ #### Rails Guides (`~/Developer/rails/guides/source/`)
161
+
162
+ **Scale**: 80 markdown files, ~2.5MB total
163
+
164
+ **ToC Structure** (`documents.yaml`):
165
+ ```
166
+ Start Here
167
+ └── Getting Started with Rails (100KB, 3221 lines!)
168
+ └── Install Ruby on Rails
169
+ Models (7 guides)
170
+ └── Active Record Basics
171
+ └── Migrations, Validations, Callbacks, Associations, Querying, Active Model
172
+ Views (4 guides)
173
+ Controllers (3 guides)
174
+ Other Components (7 guides)
175
+ Digging Deeper (11 guides)
176
+ Going to Production (4 guides)
177
+ Advanced Active Record (4 guides)
178
+ Extending Rails (5 guides)
179
+ Contributing (4 guides)
180
+ Policies
181
+ Release Notes (19 versions!)
182
+ ```
183
+
184
+ **Key Patterns**:
185
+ 1. **Massive "Getting Started"**: 3221 lines, covers everything from install to deployment
186
+ 2. **Each guide has a header**: "After reading this guide, you will know:" (learning objectives)
187
+ 3. **Progressive complexity**: Models → Views → Controllers → Other → Digging Deeper → Production
188
+ 4. **Real-world project**: Builds "store" e-commerce app throughout
189
+
190
+ ---
191
+
192
+ #### Vue.js Docs (`~/Developer/docs/src/guide/`)
193
+
194
+ **Scale**: 8 subdirectories, ~70 files
195
+
196
+ **Directory Structure**:
197
+ ```
198
+ introduction.md (12KB)
199
+ quick-start.md (15KB)
200
+ essentials/ (13 files, ~144KB)
201
+ └── reactivity-fundamentals.md (20KB)
202
+ └── template-syntax.md, computed.md, class-and-style.md...
203
+ components/ (9 files, ~103KB)
204
+ └── props.md (20KB), slots.md (24KB), v-model.md (19KB)...
205
+ reusability/ (4 files)
206
+ built-ins/ (18 files)
207
+ scaling-up/ (6 files)
208
+ typescript/ (3 files)
209
+ best-practices/ (4 files)
210
+ extras/ (15 files)
211
+ ```
212
+
213
+ **Key Patterns**:
214
+ 1. **API Preference Toggle**: Every page has Options API vs Composition API versions
215
+ 2. **Deep outline**: Uses `outline: deep` frontmatter for rich ToC
216
+ 3. **Interactive examples**: "Try it in the Playground" links throughout
217
+ 4. **Progressive disclosure**: essentials → components → reusability → scaling-up → best-practices
218
+ 5. **"Why" sections**: "Why Refs?" explains design decisions
219
+
220
+ ---
221
+
222
+ #### Ember Guides (`~/Developer/guides-source/guides/release/`)
223
+
224
+ **Scale**: 23 sections, ~150 files, `pages.yml` defines structure
225
+
226
+ **ToC Structure** (`pages.yml`):
227
+ ```yaml
228
+ Introduction
229
+ └── Guides and Tutorials
230
+ Getting Started (7 pages)
231
+ └── How To Use The Guides, Quick Start, Anatomy of an Ember App
232
+ Tutorial (2 parts, 15 pages)
233
+ └── Part 1: Orientation → Building Pages → Testing → Components
234
+ └── Part 2: Route Params → Service Injection → EmberData
235
+ --- Core Concepts ---
236
+ Components (11 pages)
237
+ Routing (11 pages)
238
+ Services (1 page)
239
+ EmberData (9 pages)
240
+ In-Depth Topics (6 pages)
241
+ --- Application Development ---
242
+ Application Concerns (5 pages, all marked "isAdvanced")
243
+ Accessibility (6 pages)
244
+ Configuration (10 pages)
245
+ Testing (10 pages)
246
+ TypeScript (16 pages)
247
+ --- Developer Tools ---
248
+ Build Tooling, Ember Inspector (12 pages), Code Editors
249
+ --- Additional Resources ---
250
+ Upgrading, Contributing, Glossary
251
+ ```
252
+
253
+ **Key Patterns**:
254
+ 1. **Section headings** in ToC: `is_heading: true` creates visual groupings
255
+ 2. **isAdvanced flag**: Marks optional/advanced content
256
+ 3. **Tutorial-driven**: Full 15-page tutorial building a complete app
257
+ 4. **Component-centric structure**: Components section has 11 deep pages
258
+ 5. **Mascot callouts**: "Zoey says..." and "Tomster says..." for tips
259
+
260
+ ---
261
+
262
+ ### Synthesis: Key Patterns from Deep Research
263
+
264
+ From reading **12 docs** across all three frameworks (Vue's quick-start, watchers, component-basics, props, render-function; Rails' testing, association_basics; Ember's reusable-components tutorial, native-classes-in-depth):
265
+
266
+ #### Content Patterns
267
+
268
+ | Pattern | Example | Apply to Rooibos |
269
+ |---------|---------|------------------|
270
+ | **Learning objectives header** | Rails: "After reading this guide, you will know:" | Top of every doc |
271
+ | **Dual API presentation** | Vue shows Options API + Composition API side-by-side | Show `Data.define` + Struct alternatives |
272
+ | **Massive reference tables** | Rails testing.md: 30+ assertion methods in a table | Commands reference table |
273
+ | **TIP/NOTE/WARNING callouts** | All three use these extensively | Use consistently |
274
+ | **Playground links** | Vue: "Try it in the Playground" after every example | Link to example apps |
275
+ | **Mascot callouts** | Ember: "Zoey says..." tips | Consider a Rooibos mascot |
276
+ | **Version badges** | Vue: `<sup class="vt-badge" data-text="3.5+">` | Mark new v1.0 features |
277
+
278
+ #### Structural Patterns
279
+
280
+ | Pattern | Example | Apply to Rooibos |
281
+ |---------|---------|------------------|
282
+ | **Tutorial builds real app** | Ember: 15-part tutorial building "Super Rentals" | Build a TODO or chat app |
283
+ | **Progressive disclosure** | Vue: essentials → components → extras | essentials → in_depth → patterns |
284
+ | **Exhaustive method lists** | Rails: every association method documented | Every Command method documented |
285
+ | **isAdvanced flags** | Ember: marks optional advanced content | Mark Ractor safety, parallel streaming |
286
+ | **Cross-references** | All: "See also [X]" links throughout | Required in every doc |
287
+
288
+ #### Scale Comparison (Corrected)
289
+
290
+ | Framework | User docs | Total size |
291
+ |-----------|-----------|------------|
292
+ | Rails | 75 files | ~2.5MB |
293
+ | Vue | 52 files | ~400KB |
294
+ | Ember | 125 files | ~500KB |
295
+ | RatatuiRuby | 12 files | ~80KB |
296
+ | **Rooibos (current)** | **6 files** | **~29KB** |
297
+ | **Rooibos (target)** | **40+ files** | **~370KB** |
298
+
299
+ > The target scale is ~13x larger than current, matching Ember-scale ambition.
300
+
301
+ ### Fresh Start: Delete All Current Docs
302
+
303
+ > [!CAUTION]
304
+ > **Delete all existing user-facing documentation** (`doc/` except `doc/contributors/`).
305
+ > We are starting from scratch with a completely new information architecture.
306
+
307
+ ### Proposed Structure (46 files, ~370KB total)
308
+
309
+ ```
310
+ doc/
311
+ ├── index.md # Navigation hub with audience paths (~5KB)
312
+
313
+ ├── getting_started/ # 8 files, ~55KB
314
+ │ ├── index.md # "Choose your path" (audience routing)
315
+ │ ├── why_rooibos.md # Philosophy, BubbleTea comparison
316
+ │ ├── install.md # Ruby + gem installation (for non-Rubyists)
317
+ │ ├── quickstart.md # 500+ lines, Hello World → HTTP app
318
+ │ ├── for_react_developers.md # "If you know Redux..." bridge
319
+ │ ├── for_go_developers.md # BubbleTea → Rooibos translation guide
320
+ │ ├── for_python_developers.md # Textual → Rooibos translation guide
321
+ │ └── ruby_primer.md # Ruby basics for polyglots
322
+
323
+ ├── tutorial/ # 31 files, ~240KB (TDD-first, one concept per step)
324
+ │ ├── index.md # Tutorial overview, what you'll build
325
+ │ ├── 01_project_setup.md # Story -4: Creating project structure
326
+ │ ├── 02_hello_world.md # Story -3: VIEW, UPDATE, quit
327
+ │ ├── 03_static_file_list.md # Story -2: MODEL, INIT, testing intro ⭐
328
+ │ ├── 04_arrow_navigation.md # Story -1: State updates, more tests
329
+ │ ├── 05_real_files.md # Story 0: Tests break, learn mocking ⭐⭐⭐
330
+ │ ├── 06_safe_refactoring.md # Story 4a: Extract fragment, tests protect ⭐
331
+ │ ├── 07_red_first_tdd.md # Story 4b: Build second fragment via TDD ⭐
332
+ │ ├── 08_file_metadata.md # Story 5: Pre-calculation pattern
333
+ │ ├── 09_text_preview.md # Story 6: File reading, scrolling
334
+ │ ├── 10_directory_tree.md # Story 7: Recursive data structures
335
+ │ ├── 11_pane_focus.md # Story 8: Message routing
336
+ │ ├── 12_sorting.md # Story 9: Pre-calculation (sort in UPDATE)
337
+ │ ├── 13_filtering.md # Story 10: Manual text input (cursor state)
338
+ │ ├── 14_toggle_hidden.md # Story 11: Conditional rendering
339
+ │ ├── 15_text_input_widget.md # Story 12: Cancellation tokens ⭐
340
+ │ ├── 16_rename_files.md # Story 13: Pre-populated input
341
+ │ ├── 17_confirmation_dialogs.md # Story 14: Modal UI state
342
+ │ ├── 18_progress_indicators.md # Story 15: Long-running with progress ⭐
343
+ │ ├── 19_atomic_operations.md # Story 16: Fallback strategies
344
+ │ ├── 20_external_editor.md # Story 17: Suspend/resume
345
+ │ ├── 21_modal_overlays.md # Story 18: Help overlay pattern
346
+ │ ├── 22_error_handling.md # Story 19: Auto-dismiss timers
347
+ │ ├── 23_terminal_capabilities.md # Story 23: NO_COLOR, fallbacks ⭐
348
+ │ ├── 24_mouse_events.md # Story 20: Optional input handling
349
+ │ ├── 25_resize_events.md # Story 21: Responsive layouts
350
+ │ ├── 26_loading_states.md # Story 22: Tri-state models
351
+ │ ├── 27_performance.md # Story 24: Profiling, optimization
352
+ │ ├── 28_color_schemes.md # Story 26: Theme system
353
+ │ ├── 29_configuration.md # Story 27: Config files
354
+ │ └── 30_going_further.md # Links to advanced topics
355
+
356
+ ├── essentials/ # 8 files, ~80KB (Vue-style concepts)
357
+ │ ├── the_elm_architecture.md # MVU pattern + "Why MVU?"
358
+ │ ├── models.md # Data.define, state design, immutability
359
+ │ ├── messages.md # Types, predicates, pattern matching
360
+ │ ├── update_functions.md # Pure functions, case expressions
361
+ │ ├── views.md # RatatuiRuby integration, fragments
362
+ │ ├── commands.md # Built-in commands reference
363
+ │ ├── the_runtime.md # The loop, debug mode
364
+ │ └── shortcuts.md # Cmd, Msg module aliases
365
+
366
+ ├── scaling_up/ # 7 files, ~70KB (Vue-inspired)
367
+ │ ├── custom_commands.md # out, token, call signature
368
+ │ ├── command_composition.md # out.source, out.standing, out.last
369
+ │ ├── fractal_architecture.md # Cmd.map, nested fragments
370
+ │ ├── message_routing.md # Router DSL, Rooibos.route
371
+ │ ├── ractor_safety.md # Shareability, freezing, Callable pattern
372
+ │ ├── async_patterns.md # Streaming, polling, websockets
373
+ │ └── testing.md # Comprehensive testing guide
374
+
375
+ ├── best_practices/ # 6 files, ~50KB
376
+ │ ├── modal_dialogs.md # Result routing patterns
377
+ │ ├── forms_and_validation.md # Input handling, error display
378
+ │ ├── lists_and_tables.md # Scrolling, selection, pagination
379
+ │ ├── http_workflows.md # Loading states, retries, caching
380
+ │ ├── streaming_data.md # SSE, websockets, log tailing
381
+ │ └── orchestration.md # Command.all, sequential flows
382
+
383
+ ├── troubleshooting/ # 3 files, ~15KB
384
+ │ ├── common_errors.md # Table of errors → fixes
385
+ │ ├── debugging.md # Logging, inspection, debug: true
386
+ │ └── performance.md # Render optimization
387
+
388
+ └── contributors/ # KEEP existing excellent docs
389
+ └── ...
390
+ ```
391
+
392
+ **File count**: 64 files
393
+ **Target size**: ~510KB (avg ~8KB per file)
394
+
395
+ ---
396
+
397
+ ## Pedagogical Innovation: TDD-First Tutorial
398
+
399
+ ### The Step 3 → Step 5 Teaching Arc
400
+
401
+ Our tutorial introduces a **controlled failure** that teaches professional testing practices:
402
+
403
+ **Step 3: Static File List + Testing Introduction**
404
+ - Introduce `Rooibos::TestHelper`
405
+ - Write first snapshot tests with hardcoded data
406
+ - Tests PASS ✅ - students feel successful
407
+ - **Teaches:** Testing is easy, tests build confidence
408
+
409
+ **Step 4: Arrow Navigation + More Tests**
410
+ - Test state transitions in UPDATE
411
+ - Tests PASS ✅ - confidence grows
412
+ - **Teaches:** Testing UPDATE functions, building test habits
413
+
414
+ **Step 5: Real Files - Tests Break! 💥**
415
+ - Student changes INIT to use `Dir.children(".")`
416
+ - Runs tests → ❌ SNAPSHOT MISMATCH
417
+ - **The Teaching Moment:** "Your tests broke! Why? The filesystem is non-deterministic."
418
+ - Introduce mocking with `Dir.stub`
419
+ - Tests PASS ✅ - relief and understanding
420
+ - **Teaches:** Why mocking matters (determinism, speed, isolation)
421
+
422
+ **Step 6: Safe Refactoring with Tests**
423
+ - Extract first fragment (file list) from monolithic app
424
+ - Run snapshot tests → still pass ✅
425
+ - **Teaches:** Tests enable fearless refactoring, fragments are just modules
426
+
427
+ **Step 7: Red-First TDD**
428
+ - Build second fragment (directory tree) via **red-first TDD**:
429
+ - Write failing test for TreeFragment.view ❌ (red)
430
+ - Implement TreeFragment.view ✅ (green)
431
+ - Write failing test for TreeFragment.update ❌ (red)
432
+ - Implement TreeFragment.update ✅ (green)
433
+ - Refactor both fragments, tests keep passing ✅
434
+ - **Teaches:** Red-Green-Refactor cycle, unit testing fragments, TDD workflow
435
+
436
+ ### Why This Beats the Competition
437
+
438
+ | Framework | Testing in Tutorial? | When? | Approach |
439
+ |-----------|---------------------|-------|----------|
440
+ | **BubbleTea** | ❌ No | N/A | No testing guidance |
441
+ | **Iced** | ❌ No | N/A | No testing guidance |
442
+ | **textual** | ✅ Yes | After features | Testing as afterthought |
443
+ | **Rails** | ✅ Yes | Chapter 10/12 | Testing comes late |
444
+ | **Ember** | ✅ Yes | Throughout | Integrated testing |
445
+ | **Rooibos** | ✅ Yes | **Step 3/25** | **TDD from the start** ⭐ |
446
+
447
+ **Our advantages:**
448
+ 1. **Earlier than Rails** - Testing at Step 3, not Step 10
449
+ 2. **Integrated like Ember** - Every step includes tests
450
+ 3. **Better than BubbleTea/Iced** - They have no testing guidance at all
451
+ 4. **Experiential learning** - Students experience the pain (broken tests) then learn the solution (mocking)
452
+ 5. **Professional practices** - Mocking, snapshot testing, TDD mindset from the beginning
453
+
454
+ ### Alignment with Documentation Style Guide
455
+
456
+ From `documentation_style.md`:
457
+
458
+ > **Do first, explain after** — Show the code, let them run it, then explain
459
+
460
+ Our Step 5 approach:
461
+ 1. **Do:** Change INIT to use real files
462
+ 2. **See:** Tests fail ❌
463
+ 3. **Experience:** "What happened? Why did they break?"
464
+ 4. **Do:** Add Dir.stub mocking
465
+ 5. **See:** Tests pass ✅
466
+ 6. **Understand:** "Why mocking matters for deterministic tests"
467
+
468
+ This is **experiential learning** - the student discovers WHY through controlled failure, not lecture.
469
+
470
+
471
+ ## Detailed Content Plan
472
+
473
+ > All content is **new**. We're starting fresh — no annotations like [NEW]/[REWRITE].
474
+
475
+ ### Getting Started (8 files, ~55KB)
476
+
477
+ | File | Est. KB | Description |
478
+ |------|---------|-------------|
479
+ | `index.md` | 3 | "Choose your path" audience routing |
480
+ | `why_rooibos.md` | 8 | TEA philosophy, BubbleTea comparison table |
481
+ | `install.md` | 5 | Ruby install for non-Rubyists, gem setup |
482
+ | `quickstart.md` | 15 | 500+ lines: Hello World → HTTP app |
483
+ | `for_react_developers.md` | 8 | Redux → MVU mental model bridge |
484
+ | `for_go_developers.md` | 6 | BubbleTea → Rooibos translation |
485
+ | `for_python_developers.md` | 6 | Textual → Rooibos translation |
486
+ | `ruby_primer.md` | 5 | Ruby basics for polyglots |
487
+
488
+ ### Tutorial (31 files, ~240KB)
489
+
490
+ A comprehensive TDD-first tutorial building a **File Browser** using Ruby's `Pathname`/`File`.
491
+
492
+ **Key Innovation:** Testing introduced at Step 3, with controlled failure at Step 5 teaching why mocking matters.
493
+
494
+ | File | Est. KB | Stories | Description |
495
+ |------|---------|---------|-------------|
496
+ | `index.md` | 3 | — | What you'll build, prerequisites |
497
+ | `01_project_setup.md` | 6 | -4 | Gemfile, folder structure |
498
+ | `02_hello_world.md` | 8 | -3 | VIEW, UPDATE, Messages, Command.exit |
499
+ | `03_static_file_list.md` | 10 | -2 | MODEL, INIT, **testing intro** ⭐ |
500
+ | `04_arrow_navigation.md` | 8 | -1 | State updates (.with), more tests |
501
+ | `05_real_files.md` | 12 | 0 | **Tests break, learn mocking** ⭐⭐⭐ |
502
+ | `06_safe_refactoring.md` | 8 | 4a | **Extract fragment, tests protect** ⭐ |
503
+ | `07_red_first_tdd.md` | 10 | 4b | **Build via red-first TDD** ⭐ |
504
+ | `08_file_metadata.md` | 8 | 5 | Pre-calculation pattern (sort in UPDATE) |
505
+ | `09_text_preview.md` | 8 | 6 | File reading, text detection, scrolling |
506
+ | `10_directory_tree.md` | 10 | 7 | Recursive data structures in Model |
507
+ | `11_pane_focus.md` | 8 | 8 | Message routing, context-sensitive keys |
508
+ | `12_sorting.md` | 8 | 9 | **Pre-calculation (no VIEW computation!)** |
509
+ | `13_filtering.md` | 8 | 10 | **Manual text input (cursor state)** |
510
+ | `14_toggle_hidden.md` | 6 | 11 | Conditional rendering, visual styling |
511
+ | `15_text_input_widget.md` | 10 | 12 | **Cancellation tokens, Command.cancel** ⭐ |
512
+ | `16_rename_files.md` | 8 | 13 | Pre-populated input, validation |
513
+ | `17_confirmation_dialogs.md` | 8 | 14 | Modal UI state, Y/N handling |
514
+ | `18_progress_indicators.md` | 8 | 15 | **Long-running with progress** ⭐ |
515
+ | `19_atomic_operations.md` | 8 | 16 | **Fallback strategies, error recovery** |
516
+ | `20_external_editor.md` | 8 | 17 | Suspend/resume, process spawning |
517
+ | `21_modal_overlays.md` | 8 | 18 | Help overlay pattern |
518
+ | `22_error_handling.md` | 8 | 19 | Auto-dismiss timers (Command.wait) |
519
+ | `23_terminal_capabilities.md` | 10 | 23 | **NO_COLOR, ANSI/ASCII fallbacks** ⭐ |
520
+ | `24_mouse_events.md` | 8 | 20 | **Optional input, capability detection** |
521
+ | `25_resize_events.md` | 8 | 21 | **Responsive layouts, degradation** |
522
+ | `26_loading_states.md` | 8 | 22 | Tri-state models, cancellable Commands |
523
+ | `27_performance.md` | 8 | 24 | Profiling, optimization, caching |
524
+ | `28_color_schemes.md` | 8 | 26 | **Theme system, validation** |
525
+ | `29_configuration.md` | 8 | 27 | **YAML parsing, config files** |
526
+ | `30_going_further.md` | 5 | — | Links to scaling_up/ and best_practices/ |
527
+
528
+ **Tutorial Philosophy:**
529
+
530
+ 1. **TDD from Step 3** - Tests are not optional, they're fundamental
531
+ 2. **Controlled failure at Step 5** - Tests break when adding real files, teaching why mocking matters
532
+ 3. **Every step includes tests** - Build confidence through green → green → red → green
533
+ 4. **One pedagogical moment per step** - Each step teaches ONE concept clearly
534
+ 5. **30 steps total** - Comprehensive coverage of all file browser stories
535
+
536
+ ### Essentials (8 files, ~80KB)
537
+
538
+ Vue-style conceptual docs. Each follows **Context-Problem-Solution**.
539
+
540
+ | File | Est. KB | Description |
541
+ |------|---------|-------------|
542
+ | `the_elm_architecture.md` | 12 | MVU pattern + "Why MVU?" |
543
+ | `models.md` | 10 | Data.define, immutability, state design |
544
+ | `messages.md` | 10 | Types, predicates, pattern matching |
545
+ | `update_functions.md` | 8 | Pure functions, case expressions, Command returns |
546
+ | `views.md` | 8 | View function contract, links to RatatuiRuby widgets |
547
+ | `commands.md` | 15 | Built-in commands reference (wait, http, batch, all) |
548
+ | `the_runtime.md` | 10 | The loop, debug mode |
549
+ | `shortcuts.md` | 5 | Cmd, Msg module aliases |
550
+
551
+ ### Scaling Up (7 files, ~70KB)
552
+
553
+ Advanced architecture topics.
554
+
555
+ | File | Est. KB | Description |
556
+ |------|---------|-------------|
557
+ | `custom_commands.md` | 12 | out, token, call signature |
558
+ | `command_composition.md` | 12 | out.source, out.standing, out.last |
559
+ | `fractal_architecture.md` | 12 | Cmd.map, nested fragments, Router DSL |
560
+ | `message_routing.md` | 10 | Rooibos.route, delegate patterns |
561
+ | `ractor_safety.md` | 8 | Shareability, freezing, Callable pattern |
562
+ | `async_patterns.md` | 10 | Streaming, polling, websockets |
563
+ | `testing.md` | 10 | Comprehensive TestHelper guide |
564
+
565
+ ### Best Practices (6 files, ~50KB)
566
+
567
+ Pattern cookbook for common scenarios.
568
+
569
+ | File | Est. KB | Description |
570
+ |------|---------|-------------|
571
+ | `modal_dialogs.md` | 8 | Result routing, dialog patterns |
572
+ | `forms_and_validation.md` | 10 | Input handling, error display |
573
+ | `lists_and_tables.md` | 8 | Scrolling, selection, pagination |
574
+ | `http_workflows.md` | 10 | Loading states, retries, caching |
575
+ | `streaming_data.md` | 8 | SSE, websockets, log tailing |
576
+ | `orchestration.md` | 8 | Command.all, sequential flows |
577
+
578
+ ### Troubleshooting (3 files, ~15KB)
579
+
580
+ | File | Est. KB | Description |
581
+ |------|---------|-------------|
582
+ | `common_errors.md` | 6 | Table: error message → cause → fix |
583
+ | `debugging.md` | 5 | Logging, inspection, debug: true |
584
+ | `performance.md` | 4 | Render optimization |
585
+
586
+ ---
587
+
588
+ ## Style Guide
589
+
590
+ **Concept docs** (Essentials, Scaling Up, Best Practices) follow the [Alexandrian form](file:///Users/kerrick/Developer/ratatui_ruby/doc/contributors/documentation_style.md):
591
+ - **Context-Problem-Solution** structure
592
+ - Active voice, short sentences
593
+ - Comprehensive examples with headers
594
+ - Cross-references to related docs (3+ per file)
595
+ - Links to RatatuiRuby for widget/layout details
596
+
597
+ **Tutorial chapters** follow a **progressive build** pedagogy:
598
+ - Do this → see that → now understand why
599
+ - Hands-on first, explanation after
600
+ - Each chapter builds on the previous
601
+
602
+ ---
603
+
604
+ ## Metrics for Success
605
+
606
+ | Metric | Target |
607
+ |--------|--------|
608
+ | **Total size** | ~510KB |
609
+ | **Files** | 64 |
610
+ | **Avg per file** | ~8KB |
611
+ | **Tutorial steps** | 30 (TDD from Step 3) |
612
+ | **Cross-refs per doc** | 3+ |
613
+ | **Audience coverage** | Rubyists, Front-end devs, Polyglots |
614
+ | **Testing introduced** | Step 3 (earlier than all competitors) |
615
+ | **Pedagogical moments** | One per step (clear, focused learning) |
616
+