Render GFM tables and enable mouse-wheel scrolling

Markdown.to_lines now detects GFM tables (header + delimiter row) and
renders them as box-drawn, alignment-aware tables that shrink to fit the
pane width, instead of mangling the rows into a single paragraph.

ScrollView now handles mouse-wheel events, and Window routes wheel
events to the widget under the cursor, so a detail/content pane scrolls
even when keyboard focus is on an adjacent list.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-05 19:20:39 +02:00
parent 4fa7ebc54d
commit 6b320318ca
3 changed files with 154 additions and 29 deletions

View File

@@ -459,8 +459,17 @@ module BBS
end
def handle_event(event)
return nil unless event.key?
max = [@lines.size - bounds.height, 0].max
if event.mouse?
return nil unless event.mouse.kind == :wheel
@scroll = if event.mouse.button == :up
[@scroll - 3, 0].max
else
[@scroll + 3, max].min
end
return :handled
end
return nil unless event.key?
case event.key
when :up then @scroll = [@scroll - 1, 0].max
when :down then @scroll = [@scroll + 1, max].min