Commit Graph

3 Commits

Author SHA1 Message Date
4eca9513a8 Add nav DSL to TUI::Page; helpers accumulates across calls
Page#nav sets up up/down key handlers for four common patterns:
  nav :menu,   size:    – wrapping @menu_sel selection
  nav :cycle           – wrapping @item_sel over @items
  nav :list,   window: – @item_sel/@scroll with a visible window
  nav :scroll, content:, window: – @scroll over arbitrary content

size/window accept an integer or a lambda evaluated on the Context
at runtime, so terminal-size-dependent values work naturally.

TUI#helpers now accumulates into one module instead of replacing it,
so configure methods on page classes can each extend helpers without
clobbering previous calls.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 22:17:31 +02:00
cac10176a2 Add page-based TUI DSL
Each screen is now a self-contained `page` block with its own `enter`,
`render`, and `key` handlers. Shared logic lives in a `helpers` block
mixed into the render context. A `chrome` block renders persistent UI
(header, sidebar, footer) before every frame.

New context primitives: `go(page)` for transitions, `reload` to re-run
the current page's `enter` block, `printable` key binding for text input.

`FlowRunner#run_tui` now passes the flow context to TUIRunner so username
and other session data are available without reaching into internals.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 21:30:06 +02:00
4690ade510 Initial commit: extracted from impostor-bbs gems/bbs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-28 22:18:57 +02:00