From feca81842b6eceebdd15018e9ad78913d8464a70 Mon Sep 17 00:00:00 2001 From: qinglong Date: Sat, 13 Jun 2026 12:17:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9B=9E=E5=88=B0=20grid=20=E5=B8=83?= =?UTF-8?q?=E5=B1=80=20+=20=E9=A1=B6=E9=83=A8=E7=95=99=E7=A9=BA=E8=A1=8C?= =?UTF-8?q?=20=E2=80=94=205=E8=A1=8C:=20=E7=A9=BA/=E6=A0=87=E9=A2=98/?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=A0=8F/=E4=B8=BB=E5=8C=BA/=E8=BE=93?= =?UTF-8?q?=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit grid-rows: 1 1 auto 1fr 3 - Row 1: 空白行 - Row 2: 标题栏 (Static, bold) - Row 3: 状态栏 (auto 高度) - Row 4: 主显示区 (1fr 填满剩余) - Row 5: 输入栏 (固定3行) Co-Authored-By: Claude --- services/tui_service.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/services/tui_service.py b/services/tui_service.py index f434d10..e3f1962 100644 --- a/services/tui_service.py +++ b/services/tui_service.py @@ -552,11 +552,15 @@ class TUIFramework(App): def _generate_css(self): - """动态生成 CSS — dock 布局:标题 + 状态栏 + 主内容 + 底部输入""" + """动态生成 CSS — grid 布局:空行 + 标题 + 状态栏 + 主内容 + 底部输入""" return """ + Screen { + layout: grid; + grid-size: 1 5; + grid-rows: 1 1 auto 1fr 3; + } + #title-bar { - dock: top; - height: 1; padding: 0 1; background: $panel; color: $text; @@ -564,18 +568,9 @@ class TUIFramework(App): } #monitor-area { - dock: top; - padding: 1 1 0 1; + padding: 0 1; background: $panel; color: $text; - height: auto; - } - - #input-area { - dock: bottom; - padding: 0 1; - height: 3; - align: center bottom; } #main-area { @@ -584,6 +579,10 @@ class TUIFramework(App): border: solid $primary; } + #input-area { + padding: 0 1; + } + ScrollableContainer { scrollbar-color: #666 #222; scrollbar-color-hover: #888 #333; @@ -596,14 +595,15 @@ class TUIFramework(App): """ def compose(self): - """组合界面 — 标题 + 状态栏 / 主显示区 / 底部输入栏""" - yield self.title_bar - yield Container( + """组合界面 — 空行 + 标题 + 状态栏 + 主显示区 + 底部输入""" + yield Static("") # Row 1: blank + yield self.title_bar # Row 2: title + yield Container( # Row 3: monitor self.system_monitor, self.plugin_panel, id="monitor-area", ) - yield ScrollableContainer( + yield ScrollableContainer( # Row 4: main (1fr) self.log_display, id="main-area", ) @@ -613,7 +613,7 @@ class TUIFramework(App): suggester=self.command_suggester, id="command-input", ) - yield Container( + yield Container( # Row 5: input (3 rows) self.command_input, id="input-area", )