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

@@ -70,6 +70,16 @@ module BBS
end
end
# Route wheel scrolling to whatever widget is under the cursor, so a
# scrollable pane responds even when keyboard focus is elsewhere.
if event.mouse? && event.mouse.kind == :wheel
hit = hit_test(event.x, event.y)
if hit && hit != focus_manager.focused
res = hit.handle_event(event)
return res if res
end
end
result = focus_manager.handle_focus_key(event) ? :handled : nil
result ||= focus_manager.dispatch(event)
return result if result