From 54316d33edd73ffb41d46a481968745f2884ac26 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Mon, 9 Mar 2026 12:45:07 -0400 Subject: [PATCH] polish: profile/maintenance screen improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - maintenance.py: add status icons to format_status, add warning CSS class - profile.py: improve intro text, use ► marker for active profile - pubkey.py: use explicit Binding() for keybindings - relays.py: remove stray `import traceback` in _perform_sync - security.py: clarify backup passphrase label Co-Authored-By: Claude Sonnet 4.6 --- src/seedpass/tui_v3/screens/maintenance.py | 26 ++++++++++++++++++++-- src/seedpass/tui_v3/screens/profile.py | 4 ++-- src/seedpass/tui_v3/screens/pubkey.py | 4 ++-- src/seedpass/tui_v3/screens/relays.py | 2 -- src/seedpass/tui_v3/screens/security.py | 2 +- 5 files changed, 29 insertions(+), 9 deletions(-) diff --git a/src/seedpass/tui_v3/screens/maintenance.py b/src/seedpass/tui_v3/screens/maintenance.py index 07ebd1e6..6deb09b6 100644 --- a/src/seedpass/tui_v3/screens/maintenance.py +++ b/src/seedpass/tui_v3/screens/maintenance.py @@ -71,6 +71,15 @@ MAINTENANCE_CSS = """ min-height: 3; } +.maintenance-status-warning { + background: #4a3800; + color: #ffdd88; + border: solid #aa7700; + padding: 1; + margin-top: 1; + min-height: 3; +} + .maintenance-label { color: #ffffff; text-style: bold; @@ -116,6 +125,19 @@ MAINTENANCE_CSS = """ """ +_STATUS_ICONS: dict[str, str] = { + "ready": "◎", + "working": "⟳", + "success": "✓", + "warning": "⚠", + "error": "✗", + "danger": "⚠", + "info": "ℹ", +} + + def format_status(level: str, message: str) -> str: - prefix = level.strip().capitalize() or "Info" - return f"{prefix}: {message}" + key = level.strip().lower() + icon = _STATUS_ICONS.get(key, "◉") + prefix = key.capitalize() or "Info" + return f"{icon} {prefix}: {message}" diff --git a/src/seedpass/tui_v3/screens/profile.py b/src/seedpass/tui_v3/screens/profile.py index 3066d83a..9b0e1fa2 100644 --- a/src/seedpass/tui_v3/screens/profile.py +++ b/src/seedpass/tui_v3/screens/profile.py @@ -46,7 +46,7 @@ class ProfileManagementScreen(Screen): yield Static("SeedPass ◈ Profile Management", classes="maintenance-title") with Container(id="profile-container", classes="maintenance-panel-dark"): yield Static( - "Switch between profiles or remove unused ones. The active profile is marked with *. Removing a profile requires confirmation.", + "Switch between profiles or remove unused ones. The active profile is marked with ►. Each profile is identified by its fingerprint. Removing a profile is permanent and requires confirmation.", id="profile-intro", classes="maintenance-intro-dark", ) @@ -105,7 +105,7 @@ class ProfileManagementScreen(Screen): for idx, profile in enumerate(profiles, start=1): fingerprint = profile["fingerprint"] label = profile["label"] - marker = "*" if fingerprint == current else " " + marker = "►" if fingerprint == current else " " lines.append(f"{idx}. {marker} {label}") if not profiles: lines.append("(none)") diff --git a/src/seedpass/tui_v3/screens/pubkey.py b/src/seedpass/tui_v3/screens/pubkey.py index 4808ec55..fd637932 100644 --- a/src/seedpass/tui_v3/screens/pubkey.py +++ b/src/seedpass/tui_v3/screens/pubkey.py @@ -12,8 +12,8 @@ class NostrPubkeyScreen(Screen): """Display the active profile npub and its public QR payload.""" BINDINGS = [ - ("escape", "app.pop_screen", "Back"), - ("c", "copy_pubkey", "Copy npub"), + Binding("escape", "app.pop_screen", "Back", show=True), + Binding("c", "copy_pubkey", "Copy npub", show=True), ] CSS = ( diff --git a/src/seedpass/tui_v3/screens/relays.py b/src/seedpass/tui_v3/screens/relays.py index 2dd977d7..da5beaf9 100644 --- a/src/seedpass/tui_v3/screens/relays.py +++ b/src/seedpass/tui_v3/screens/relays.py @@ -196,8 +196,6 @@ class RelaysScreen(Screen): async def _perform_sync(self) -> None: sync_service = self.app.services.get("sync") try: - import traceback - sync_service.sync() self.app.call_from_thread( self.app.notify, "Synchronization complete", severity="information" diff --git a/src/seedpass/tui_v3/screens/security.py b/src/seedpass/tui_v3/screens/security.py index 8bfc5816..79d9100b 100644 --- a/src/seedpass/tui_v3/screens/security.py +++ b/src/seedpass/tui_v3/screens/security.py @@ -114,7 +114,7 @@ class BackupParentSeedScreen(Screen): ) yield Label("Destination Path", classes="maintenance-label") yield Input(placeholder="seed-backup.enc", id="backup-seed-path", classes="maintenance-input") - yield Label("Backup Password (optional)", classes="maintenance-label") + yield Label("Backup Passphrase (optional — encrypts the exported seed bundle)", classes="maintenance-label") yield Input(password=True, id="backup-seed-password", classes="maintenance-input") yield Static( format_status("ready", "Enter the backup destination path to export an encrypted seed bundle."),