From b578d2f9a6068caf3c290bff500e187600206073 Mon Sep 17 00:00:00 2001 From: shuki Date: Sat, 7 Mar 2026 01:30:26 +0200 Subject: [PATCH] Fix docs panel on mobile: lower hide threshold to 45 cols The auto-hide threshold (100 cols) was hiding the panel before the vertical layout logic could apply. Now: - >= 80 cols: panel on the right (horizontal) - 45-79 cols: panel at the bottom (vertical, max 40% height) - < 45 cols: panel hidden Co-Authored-By: Claude Opus 4.6 --- tui/app.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/tui/app.py b/tui/app.py index 88d8f4e..bc174bf 100644 --- a/tui/app.py +++ b/tui/app.py @@ -63,8 +63,9 @@ class GnizaApp(App): else: self.notify(f"{job.label} failed (exit code {message.return_code})", severity="error") - # Width threshold for auto-hiding the docs panel - DOCS_AUTO_HIDE_WIDTH = 100 + # Width thresholds for docs panel + DOCS_VERTICAL_WIDTH = 80 # Below: panel moves to bottom + DOCS_HIDE_WIDTH = 45 # Below: panel hidden entirely def action_toggle_docs(self) -> None: try: @@ -74,9 +75,6 @@ class GnizaApp(App): except NoMatches: pass - # Width threshold for switching docs panel to bottom - DOCS_VERTICAL_WIDTH = 80 - def on_resize(self, event: Resize) -> None: self._update_docs_layout(event.size.width) @@ -87,15 +85,13 @@ class GnizaApp(App): def _update_docs_layout(self, width: int) -> None: try: panel = self.screen.query_one("#docs-panel") - except NoMatches: - return - if not getattr(panel, "_user_toggled", False): - panel.display = width >= self.DOCS_AUTO_HIDE_WIDTH - # Switch layout direction based on width - try: container = self.screen.query_one(".screen-with-docs") except NoMatches: return + # Auto-hide only on very narrow screens (unless user toggled) + if not getattr(panel, "_user_toggled", False): + panel.display = width >= self.DOCS_HIDE_WIDTH + # Switch layout direction if width < self.DOCS_VERTICAL_WIDTH: container.styles.layout = "vertical" panel.styles.width = "100%"