feat: Add status bar with update status indicator

Status bar implementation:
- Status bar at bottom of main window
- Update status label with emoji support
- set_update_status() method for updates:
  -  Checking for updates
  -  Update available
  -  Downloading update
  -  Update failed
  - Clean status display

Test coverage:
- 8 new tests for status bar
- Test creation and initialization
- Test status updates with/without emoji
- Test all status states (checking, available, downloading, error)
- All 154 tests passing, 86% coverage

Enables visual feedback during update operations
This commit is contained in:
claudi 2026-01-29 08:37:53 +01:00
parent 2896f6ba5c
commit 5b28c931d8
2 changed files with 94 additions and 1 deletions

View file

@ -4,7 +4,7 @@ from pathlib import Path
from typing import Optional
from PySide6.QtCore import QSize, Qt, QUrl, Signal
from PySide6.QtWidgets import QMainWindow, QToolBar, QVBoxLayout, QWidget
from PySide6.QtWidgets import QMainWindow, QToolBar, QVBoxLayout, QWidget, QLabel, QStatusBar
from webdrop_bridge.config import Config
from webdrop_bridge.core.drag_interceptor import DragInterceptor
@ -208,6 +208,9 @@ class MainWindow(QMainWindow):
# Create menu bar
self._create_menu_bar()
# Create status bar
self._create_status_bar()
# Create drag interceptor
self.drag_interceptor = DragInterceptor()
@ -358,6 +361,27 @@ class MainWindow(QMainWindow):
check_updates_action = help_menu.addAction("Check for Updates...")
check_updates_action.triggered.connect(self._on_check_for_updates)
def _create_status_bar(self) -> None:
"""Create status bar with update status indicator."""
self.status_bar = self.statusBar()
# Update status label
self.update_status_label = QLabel("Ready")
self.update_status_label.setStyleSheet("margin-right: 10px;")
self.status_bar.addPermanentWidget(self.update_status_label)
def set_update_status(self, status: str, emoji: str = "") -> None:
"""Update the status bar with update information.
Args:
status: Status text to display
emoji: Optional emoji prefix (🔄, , , )
"""
if emoji:
self.update_status_label.setText(f"{emoji} {status}")
else:
self.update_status_label.setText(status)
def _on_check_for_updates(self) -> None:
"""Handle check for updates menu action.