Phosphor::HelpWidget(S)
Inherits Phosphor::Widget < Reference < Object
App-specific widget wrapping ViewportMock for the built-in HelpScreen.
Translates raw terminal Events into Msg values (on_event); has
nothing to resolve from the theme, so sync is a no-op — HelpScreen
sets mock.props directly from app.router once, in on_mount, since
the keybinding text never changes for the lifetime of the screen and
doesn't depend on the app's own state.
Generic over S — ships with the framework, so it must back
HelpScreen(S) for any app's own state type, not just AppState.
Fixed to the framework's own Msg as its Widget message type — this
widget only ever produces Msg::Back/Msg::ScrollUp/Msg::ScrollDown,
not an app-supplied message type.
See DESIGN.md § "Router: your routes.rb".
Constructors
Instance methods
Delegates to the wrapped ViewportMock's handle_cmd — used by
HelpScreen#handle to forward Cmd::ScrollUp/Cmd::ScrollDown.
Maps Key::Escape to Msg::Back (close the help screen) and
Up/k, Down/j to Msg::ScrollUp/Msg::ScrollDown (scroll the
keybinding list). Returns nil for any other event.
No-op: mock.props is set directly by HelpScreen#on_mount from
app.router, not from the app's own state, and never changes
afterward.