From 85143b866c93432f7de1a3ae22adadb75d0dd1ff Mon Sep 17 00:00:00 2001 From: Vuong Hoang Date: Wed, 27 May 2026 12:25:16 -0700 Subject: [PATCH] fix(tui): disable RichLog min_width floor so wrap actually applies (v0.14.2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The four right-column panes (tools/debug/thinking/persona) have all carried `wrap=True` since their introduction, but long lines were still horizontally scrolling instead of wrapping. Root cause: Textual's RichLog defaults `min_width=78`, and the App's render path takes `max(renderable_width, min_width)` after the shrink step. The right column is 1fr against the left column's 2fr, so at common terminal widths (≤120 cols) the panes are narrower than 78 cells — the 78-cell floor was forcing content to render at 78 wide and horizontally scroll instead of wrapping at the actual pane width. Set `min_width=0` on all four right-column RichLog instances so shrink-to-widget-width can actually shrink. `wrap=True` now takes effect on long lines as expected. Patch per SemVer discipline: bug fix to a long-standing visible-UX defect; no public API change, no behavior change for callers, every existing caller continues to work — the substrate is more correct. --- pyproject.toml | 2 +- src/ratatoskr/tui.py | 20 ++++++++++++++++---- uv.lock | 2 +- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index cf5fd88..b4e84a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "ratatoskr" -version = "0.14.1" +version = "0.14.2" description = "Worldtree Conversation API debug TUI — multi-pane observability dashboard" readme = "README.md" requires-python = ">=3.12" diff --git a/src/ratatoskr/tui.py b/src/ratatoskr/tui.py index efd41a6..0e8845b 100644 --- a/src/ratatoskr/tui.py +++ b/src/ratatoskr/tui.py @@ -1023,13 +1023,23 @@ class RatatoskrApp(App[int]): yield Input(id="prompt", placeholder="Type a message and press Enter") with Vertical(id="right-column"): with TabbedContent(id="side-panes"): + # v0.14.2: min_width=0 disables Textual's 78-cell floor + # on RichLog. The right column is 1fr against the left + # column's 2fr, so at typical terminal widths the right- + # column panes are narrower than 78 cells — and the + # default min_width=78 was forcing content to render at + # 78 wide and horizontally scroll instead of wrapping at + # the actual widget width. With min_width=0, wrap=True + # finally takes effect on long lines. with TabPane("Tools", id="tools-tab"): yield RichLog( - id="tools-log", wrap=True, markup=False, highlight=False + id="tools-log", wrap=True, markup=False, + highlight=False, min_width=0, ) with TabPane("Debug", id="debug-tab"): yield RichLog( - id="debug-log", wrap=True, markup=False, highlight=False + id="debug-log", wrap=True, markup=False, + highlight=False, min_width=0, ) with TabPane("Thinking", id="thinking-tab"): # v0.6.5: thinking streams directly into this @@ -1039,7 +1049,8 @@ class RatatoskrApp(App[int]): # as content arrives — no more "200-char tail # window scrolling at the bottom". yield RichLog( - id="thinking-log", wrap=True, markup=False, highlight=False + id="thinking-log", wrap=True, markup=False, + highlight=False, min_width=0, ) with TabPane("Persona", id="persona-tab"): # v0.13.0: full persona-snapshot detail (PAD, @@ -1047,7 +1058,8 @@ class RatatoskrApp(App[int]): # appended) on each AffectUpdate(current) — the # snapshot is absolute state, not incremental. yield RichLog( - id="persona-log", wrap=True, markup=False, highlight=False + id="persona-log", wrap=True, markup=False, + highlight=False, min_width=0, ) # INV-002 + INV-003: visible identity + hint widgets (Footer-area). # pane-name widget displays current side-pane name. diff --git a/uv.lock b/uv.lock index 365f074..c0a1dcf 100644 --- a/uv.lock +++ b/uv.lock @@ -968,7 +968,7 @@ wheels = [ [[package]] name = "ratatoskr" -version = "0.14.1" +version = "0.14.2" source = { editable = "." } dependencies = [ { name = "httpx" },