Extraction Roadmap
The current framework baseline covers reusable primitives for items, key/value rows, editable options, actions, typed events, commands, selection, panel titles, keybars, line numbers, viewport mapping, scroll policy, list/tree/text view models, shell state, and modal flows.
Tree views flatten semantic nodes into visible items and render through the same line-number and viewport layers as lists. Textual adapters exist for keybars, lists, trees, text views, shell panel synchronization, and modal overlays.
Still Missing
Section titled “Still Missing”Ergonomic API layers
Section titled “Ergonomic API layers”The primitive layer exists, but the demo still exposes too much manual wiring. The next framework layer should add reusable builders and presets for common TUI shapes:
- option fields that derive rows, typed modal editing, formatting, validation, and immutable updates
- action/key declarations that derive keybar hints, help text, binding registries, Textual bindings, and dispatch handlers
- shell/app composition helpers that derive panel specs, content specs, focus graph defaults, runtime wiring, and keybars for common lazygit-style layouts
See API Layers for the intended shape.
Textual adapters
Section titled “Textual adapters”Keybar, list, tree, text, modal, and shell view adapters exist as the first thin Textual layer. They render pure models, apply panel/tab state, and emit typed messages upward.
Remaining adapter work is mostly refinement:
- shared scrollbar styling utilities
- richer modal layout options
- stronger smoke tests around Textual lifecycle behavior
Adapters should translate Textual events into lazy-cuh events and commands. They should not own domain state.
Tree model
Section titled “Tree model”TreeItem, flatten_visible_tree, and TreeViewModel now cover the first pure
tree layer. Expand/collapse updates are modeled immutably on the tree helpers
and view model. Remaining work is mostly selection state:
- range and visual-mode selection
- parent/partial selection state
- conversion helpers from app data into tree items
Viewport and scroll policy
Section titled “Viewport and scroll policy”The current ViewportMap maps visual lines, and ScrollPolicy / ScrollState
cover cursor margins and line visibility. Remaining work:
- horizontal-scroll policy
- solid scrollbar styling hooks
Solid scrollbar styling should be a Textual adapter utility, not a pure model.
Modal API
Section titled “Modal API”Input, confirm, and info modal flows are represented by ModalState and modal
specs at the pure state transition layer. ModalWidget and ModalHost provide
the first Textual overlay adapter. Remaining work is mostly layout polish,
additional modal variants, and integration examples.
App shell
Section titled “App shell”ShellState and FocusGraph now cover the pure state layer for:
- active panel tracking
- spatial pane focus
- tab cycling
ContextualKeybar covers per-panel keybar hints and help text.
ShellCommandState covers the first global shell command key-handling piece.
ShellController combines shell state, shell command handling, tab cycling,
and line-number mode so Textual apps can keep orchestration logic out of
widgets.
ShellViewAdapter covers the first Textual adapter layer for panel titles, tab
content visibility, focus, and keybar refresh.
Extraction Order
Section titled “Extraction Order”- Clean up the demo imports and split the showcase from smaller examples.
- Add higher-level option presets that reduce app-side refresh and details wiring.
- Add action/key builder helpers that reduce duplicate app wiring.
- Add shell/app composition helpers for common panel layouts.
- Tree range selection and parent/partial selection state.
- Solid scrollbar adapter utilities.
- Richer modal layout variants and examples.