From 104a284f884fdc4c11778fa6a7d20fef438eb57b Mon Sep 17 00:00:00 2001 From: rambros Date: Sun, 8 Mar 2026 01:58:32 +0530 Subject: [PATCH] minor UI improvements --- src/core/base.py | 8 +++----- src/ui/main_app.py | 2 +- src/ui/mode_screen.py | 22 +++++++++++++--------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/core/base.py b/src/core/base.py index 8a31e78..1fcf0d0 100644 --- a/src/core/base.py +++ b/src/core/base.py @@ -50,7 +50,7 @@ class MigrationContext: self.is_running = False def _find_backup_path(self, server_id: str, base_dir_str: str) -> Path: - """Searches workspace for a DISCORD_BACKUP-{server_id} directory. Creates it if missing.""" + """Searches workspace for a DISCORD_BACKUP-{server_id} directory. Returns the path (does not create).""" base_dir = Path(base_dir_str) if base_dir_str else Path(".") # 1. Search inside the specific workspace directory first @@ -66,11 +66,9 @@ class MigrationContext: logger.info(f"Found backup directory globally: {d}") return d - # If not found anywhere, create it inside the workspace - base_dir.mkdir(exist_ok=True) + # If not found anywhere, return the expected location inside the workspace new_path = base_dir / f"DISCORD_BACKUP-{server_id}" - logger.info(f"No existing backup directory found for {server_id}. Creating new one: {new_path}") - new_path.mkdir(exist_ok=True) + logger.info(f"Using lazy backup path: {new_path}") return new_path async def validate_all(self) -> Dict[str, Any]: diff --git a/src/ui/main_app.py b/src/ui/main_app.py index 5497ad3..70572dc 100644 --- a/src/ui/main_app.py +++ b/src/ui/main_app.py @@ -112,7 +112,7 @@ class ConfigSelectionScreen(Screen): lv = self.query_one("#config_list", ListView) lv.clear() for c in configs: - lv.append(ListItem(Label(f"ReaperFiles-{c}"), name=c)) + lv.append(ListItem(Label(c), name=c)) def on_list_view_selected(self, event: ListView.Selected) -> None: cfg_name = event.item.name diff --git a/src/ui/mode_screen.py b/src/ui/mode_screen.py index b066056..8f051d8 100644 --- a/src/ui/mode_screen.py +++ b/src/ui/mode_screen.py @@ -9,7 +9,7 @@ Shows the appropriate pane(s) based on the mode: from pathlib import Path from textual.app import ComposeResult -from textual.containers import Container, Horizontal, VerticalScroll +from textual.containers import Container, Vertical, Horizontal, VerticalScroll from textual.widgets import Header, Footer, Button, ContentSwitcher, Rule from textual.screen import Screen @@ -35,12 +35,15 @@ class ModeScreen(Screen): padding: 1 2; margin: 2 0; } - #switcher { + #switcher, #pane_backup, #pane_migrate { height: 1fr; } + #mode_footer { + height: auto; + dock: bottom; + } #bottom_actions { height: auto; - dock: bottom; margin: 1 1 0 1; } #bottom_actions Button, #btn_switch { @@ -126,12 +129,13 @@ class ModeScreen(Screen): yield BackupPane(self.cfg_name, self.config_path, id="pane_backup") yield ShuttlePane(self.cfg_name, self.config_path, id="pane_migrate") - yield Rule() - with Horizontal(id="bottom_actions"): - if mode == "backup_transfer": - yield Button("Switch to Migrate ⇄", id="btn_switch", variant="primary", tooltip="Switch between\nBackup & Migrate operations") - yield Button("Configuration", id="btn_config", variant="success", tooltip="Change Bot tokens\nand Reaper Mode") - yield Button("Exit", id="btn_exit", variant="error") + with Vertical(id="mode_footer"): + yield Rule() + with Horizontal(id="bottom_actions"): + if mode == "backup_transfer": + yield Button("Switch to Migrate ⇄", id="btn_switch", variant="primary", tooltip="Switch between\nBackup & Migrate operations") + yield Button("Configuration", id="btn_config", variant="success", tooltip="Change Bot tokens\nand Reaper Mode") + yield Button("Exit", id="btn_exit", variant="error") yield Footer()