From e575b8686961a31b629a68996de7324590aa53e6 Mon Sep 17 00:00:00 2001 From: shuki Date: Sat, 7 Mar 2026 07:01:51 +0200 Subject: [PATCH] =?UTF-8?q?Move=20Back=20button=20to=20top-left=20of=20all?= =?UTF-8?q?=20screens=20with=20=E2=86=90=20arrow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace bottom-row Back buttons with a top-left "← Back" button across all screens for consistent navigation. Co-Authored-By: Claude Opus 4.6 --- tui/gniza.tcss | 7 +++++++ tui/screens/backup.py | 2 +- tui/screens/logs.py | 2 +- tui/screens/remotes.py | 2 +- tui/screens/restore.py | 2 +- tui/screens/retention.py | 2 +- tui/screens/running_tasks.py | 4 ++-- tui/screens/schedule.py | 2 +- tui/screens/settings.py | 2 +- tui/screens/snapshots.py | 2 +- tui/screens/targets.py | 2 +- 11 files changed, 18 insertions(+), 11 deletions(-) diff --git a/tui/gniza.tcss b/tui/gniza.tcss index 46e170d..a527b26 100644 --- a/tui/gniza.tcss +++ b/tui/gniza.tcss @@ -168,6 +168,13 @@ SelectionList { margin: 0 0 0 1; } +.back-btn { + width: auto; + min-width: 10; + height: 3; + margin: 0 0 0 0; +} + /* Button rows */ #backup-buttons, #restore-buttons, diff --git a/tui/screens/backup.py b/tui/screens/backup.py index 9d620ce..f7468f7 100644 --- a/tui/screens/backup.py +++ b/tui/screens/backup.py @@ -18,6 +18,7 @@ class BackupScreen(Screen): remotes = list_conf_dir("remotes.d") with Horizontal(classes="screen-with-docs"): with Vertical(id="backup-screen"): + yield Button("← Back", id="btn-back", classes="back-btn") yield Static("Backup", id="screen-title") if not targets: yield Static("No sources configured. Add a source first.") @@ -38,7 +39,6 @@ class BackupScreen(Screen): with Horizontal(id="backup-buttons"): yield Button("Run Backup", variant="primary", id="btn-backup") yield Button("Backup All", variant="warning", id="btn-backup-all") - yield Button("Back", id="btn-back") yield DocsPanel.for_screen("backup-screen") yield Footer() diff --git a/tui/screens/logs.py b/tui/screens/logs.py index 9a0728d..3711715 100644 --- a/tui/screens/logs.py +++ b/tui/screens/logs.py @@ -90,11 +90,11 @@ class LogsScreen(Screen): yield Header(show_clock=True) with Horizontal(classes="screen-with-docs"): with Vertical(id="logs-screen"): + yield Button("← Back", id="btn-back", classes="back-btn") yield Static("Logs", id="screen-title") yield DataTable(id="logs-table") with Horizontal(id="logs-buttons"): yield Button("View", variant="primary", id="btn-view") - yield Button("Back", id="btn-back") with Horizontal(id="log-pager-buttons"): yield Button("◀ Prev", id="btn-prev-page") yield Static("", id="log-page-info") diff --git a/tui/screens/remotes.py b/tui/screens/remotes.py index 8c2c4a4..9eeb610 100644 --- a/tui/screens/remotes.py +++ b/tui/screens/remotes.py @@ -18,6 +18,7 @@ class RemotesScreen(Screen): yield Header(show_clock=True) with Horizontal(classes="screen-with-docs"): with Vertical(id="remotes-screen"): + yield Button("← Back", id="btn-back", classes="back-btn") yield Static("Destinations", id="screen-title") yield DataTable(id="remotes-table") with Horizontal(id="remotes-buttons"): @@ -25,7 +26,6 @@ class RemotesScreen(Screen): yield Button("Edit", id="btn-edit") yield Button("Test", variant="warning", id="btn-test") yield Button("Delete", variant="error", id="btn-delete") - yield Button("Back", id="btn-back") yield DocsPanel.for_screen("remotes-screen") yield Footer() diff --git a/tui/screens/restore.py b/tui/screens/restore.py index 79ba2d8..67c449b 100644 --- a/tui/screens/restore.py +++ b/tui/screens/restore.py @@ -21,6 +21,7 @@ class RestoreScreen(Screen): remotes = list_conf_dir("remotes.d") with Horizontal(classes="screen-with-docs"): with Vertical(id="restore-screen"): + yield Button("← Back", id="btn-back", classes="back-btn") yield Static("Restore", id="screen-title") if not targets or not remotes: yield Static("Both sources and destinations must be configured for restore.") @@ -43,7 +44,6 @@ class RestoreScreen(Screen): yield Switch(value=True, id="restore-mysql-switch") with Horizontal(id="restore-buttons"): yield Button("Restore", variant="primary", id="btn-restore") - yield Button("Back", id="btn-back") yield DocsPanel.for_screen("restore-screen") yield Footer() diff --git a/tui/screens/retention.py b/tui/screens/retention.py index 3dff990..e14f530 100644 --- a/tui/screens/retention.py +++ b/tui/screens/retention.py @@ -21,6 +21,7 @@ class RetentionScreen(Screen): current_count = conf.get("RETENTION_COUNT", "30") with Horizontal(classes="screen-with-docs"): with Vertical(id="retention-screen"): + yield Button("← Back", id="btn-back", classes="back-btn") yield Static("Retention Cleanup", id="screen-title") if not targets: yield Static("No sources configured.") @@ -39,7 +40,6 @@ class RetentionScreen(Screen): with Horizontal(): yield Input(value=current_count, id="ret-count", placeholder="30") yield Button("Save", id="btn-save-count") - yield Button("Back", id="btn-back") yield DocsPanel.for_screen("retention-screen") yield Footer() diff --git a/tui/screens/running_tasks.py b/tui/screens/running_tasks.py index d8359b9..01c9c57 100644 --- a/tui/screens/running_tasks.py +++ b/tui/screens/running_tasks.py @@ -34,13 +34,13 @@ class RunningTasksScreen(Screen): yield Header(show_clock=True) with Horizontal(classes="screen-with-docs"): with Vertical(id="running-tasks-screen"): + yield Button("← Back", id="btn-back", classes="back-btn") yield Static("Running Tasks", id="screen-title") yield DataTable(id="rt-table") with Horizontal(id="rt-buttons"): yield Button("View Log", variant="primary", id="btn-rt-view") yield Button("Kill Job", variant="error", id="btn-rt-kill") yield Button("Clear Finished", variant="warning", id="btn-rt-clear") - yield Button("Back", id="btn-rt-back") yield Static("", id="rt-progress-label") yield ProgressBar(id="rt-progress", total=100, show_eta=False) yield _SafeRichLog(id="rt-log-viewer", wrap=True, highlight=True) @@ -98,7 +98,7 @@ class RunningTasksScreen(Screen): table.move_cursor(row=min(old_row, table.row_count - 1)) def on_button_pressed(self, event: Button.Pressed) -> None: - if event.button.id == "btn-rt-back": + if event.button.id == "btn-back": self.app.pop_screen() elif event.button.id == "btn-rt-clear": job_manager.remove_finished() diff --git a/tui/screens/schedule.py b/tui/screens/schedule.py index 6032808..f2c5c81 100644 --- a/tui/screens/schedule.py +++ b/tui/screens/schedule.py @@ -21,6 +21,7 @@ class ScheduleScreen(Screen): yield Header(show_clock=True) with Horizontal(classes="screen-with-docs"): with Vertical(id="schedule-screen"): + yield Button("← Back", id="btn-back", classes="back-btn") yield Static("Schedules", id="screen-title") yield DataTable(id="sched-table") with Horizontal(id="sched-buttons"): @@ -29,7 +30,6 @@ class ScheduleScreen(Screen): yield Button("Toggle Active", variant="warning", id="btn-toggle") yield Button("Delete", variant="error", id="btn-delete") yield Button("Show crontab", id="btn-show") - yield Button("Back", id="btn-back") yield DocsPanel.for_screen("schedule-screen") yield Footer() diff --git a/tui/screens/settings.py b/tui/screens/settings.py index 0ecfc46..3b46d3b 100644 --- a/tui/screens/settings.py +++ b/tui/screens/settings.py @@ -21,6 +21,7 @@ class SettingsScreen(Screen): settings = AppSettings.from_conf(conf) with Horizontal(classes="screen-with-docs"): with Vertical(id="settings-screen"): + yield Button("← Back", id="btn-back", classes="back-btn") yield Static("Settings", id="screen-title") with Vertical(classes="settings-section", id="section-general"): yield Static("Log Level:") @@ -79,7 +80,6 @@ class SettingsScreen(Screen): with Horizontal(id="set-buttons"): yield Button("Save", variant="primary", id="btn-save") yield Button("Send Test Email", id="btn-test-email") - yield Button("Back", id="btn-back") yield DocsPanel.for_screen("settings-screen") yield Footer() diff --git a/tui/screens/snapshots.py b/tui/screens/snapshots.py index 512711f..717fea4 100644 --- a/tui/screens/snapshots.py +++ b/tui/screens/snapshots.py @@ -32,6 +32,7 @@ class SnapshotsScreen(Screen): remotes = list_conf_dir("remotes.d") with Horizontal(classes="screen-with-docs"): with Vertical(id="snapshots-screen"): + yield Button("← Back", id="btn-back", classes="back-btn") yield Static("Snapshots Browser", id="screen-title") if not targets or not remotes: yield Static("Sources and destinations must be configured to browse snapshots.") @@ -44,7 +45,6 @@ class SnapshotsScreen(Screen): yield DataTable(id="snap-table") with Horizontal(id="snapshots-buttons"): yield Button("Browse Files", id="btn-browse") - yield Button("Back", id="btn-back") yield DocsPanel.for_screen("snapshots-screen") yield Footer() diff --git a/tui/screens/targets.py b/tui/screens/targets.py index 8ed97ff..2d003da 100644 --- a/tui/screens/targets.py +++ b/tui/screens/targets.py @@ -16,13 +16,13 @@ class TargetsScreen(Screen): yield Header(show_clock=True) with Horizontal(classes="screen-with-docs"): with Vertical(id="targets-screen"): + yield Button("← Back", id="btn-back", classes="back-btn") yield Static("Sources", id="screen-title") yield DataTable(id="targets-table") with Horizontal(id="targets-buttons"): yield Button("Add", variant="primary", id="btn-add") yield Button("Edit", id="btn-edit") yield Button("Delete", variant="error", id="btn-delete") - yield Button("Back", id="btn-back") yield DocsPanel.for_screen("targets-screen") yield Footer()