From 3292575233c4a2f21b3296774dc9b2f96dd9eeb0 Mon Sep 17 00:00:00 2001 From: shuki Date: Sat, 7 Mar 2026 01:08:15 +0200 Subject: [PATCH] Make main menu responsive: vertical layout on narrow screens - Below 100 cols: stack logo on top, menu below (vertical) - Below 48 cols (~290px): hide logo entirely, show only menu - 100+ cols: original side-by-side horizontal layout Co-Authored-By: Claude Opus 4.6 --- tui/screens/main_menu.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tui/screens/main_menu.py b/tui/screens/main_menu.py index b2da370..4f9dd6e 100644 --- a/tui/screens/main_menu.py +++ b/tui/screens/main_menu.py @@ -57,15 +57,21 @@ class MainMenuScreen(Screen): yield Footer() def on_mount(self) -> None: - self._update_logo_visibility() + self._update_layout() self.query_one("#menu-list", OptionList).focus() def on_resize(self) -> None: - self._update_logo_visibility() + self._update_layout() - def _update_logo_visibility(self) -> None: + def _update_layout(self) -> None: + width = self.app.size.width logo = self.query_one("#logo") - logo.display = self.app.size.width >= 80 + layout = self.query_one("#main-layout") + logo.display = width >= 48 + if width < 100: + layout.styles.layout = "vertical" + else: + layout.styles.layout = "horizontal" def on_option_list_option_selected(self, event: OptionList.OptionSelected) -> None: option_id = event.option.id