Extract pages into lib/page/ modules; thin down bbs.rb

Each page is now a self-contained module with a configure(tui) class
method. Shared helpers live in TUIHelpers. bbs.rb is reduced to
constants, chrome, and wiring.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-11 22:23:10 +02:00
parent 1cd1eceb1c
commit 1e2b8321fd
10 changed files with 323 additions and 300 deletions

View File

@@ -0,0 +1,22 @@
# frozen_string_literal: true
module WikiListPage
def self.configure(tui, name, category:, title:)
tui.page name do
enter do
@page_title = title
@items = WIKI.list(category)
@item_sel = 0
@scroll = 0
end
render { wiki_list_render }
nav :list, window: -> { cont_h - 3 }
key(:enter) { open_wiki_page(back: name) }
key('r') { reload }
key('q') { go :idle }
key(:escape) { go :idle }
end
end
end