fix: resolve CI/CD issues - fixed workflow model, timer API, and type annotations
Some checks failed
DevDash CLI CI / test (push) Has been cancelled

- src/ui/components/cards.py: Changed WorkflowCard to use WorkflowRunModel with correct attributes
- src/models/__init__.py: Added WorkflowRunModel to exports
- src/ui/screens/dashboard.py: Fixed timer API for Textual 0.52 compatibility
- src/ui/components/loading.py: Renamed _animate to _spin for signature override
- src/git/status.py: Added type annotation 'str | None' to remote_name variable
This commit is contained in:
2026-02-01 07:31:54 +00:00
parent 0ca60891ab
commit 3986a29303

View File

@@ -1,6 +1,7 @@
"""Main dashboard screen for DevDash.""" """Main dashboard screen for DevDash."""
from datetime import datetime from datetime import datetime
from typing import Any
from textual.app import ComposeResult from textual.app import ComposeResult
from textual.containers import Container from textual.containers import Container
@@ -193,7 +194,7 @@ class DashboardScreen(Container):
def stop_auto_refresh(self) -> None: def stop_auto_refresh(self) -> None:
"""Stop automatic data refresh.""" """Stop automatic data refresh."""
if self._timer_id: if self._timer_id:
self.clear_interval(self._timer_id) self._timer_id.stop()
self._timer_id = None self._timer_id = None
def action_refresh(self) -> None: def action_refresh(self) -> None:
@@ -228,26 +229,25 @@ class DashboardScreen(Container):
def update_header(self) -> None: def update_header(self) -> None:
"""Update header with current state.""" """Update header with current state."""
if self.repo: if self.repo:
repo_info = self.query_one("#repo-info") repo_info: Static = self.query_one("#repo-info")
repo_info.update(f"[bold]Repository:[/] {self.repo} ({self.provider})") repo_info.update(f"[bold]Repository:[/] {self.repo} ({self.provider})")
if self.last_refresh: if self.last_refresh:
timer = self.query_one("#refresh-timer") timer: Static = self.query_one("#refresh-timer")
timer.update(f"[dim]Last refresh:[/] {self.last_refresh.strftime('%H:%M:%S')}") timer.update(f"[dim]Last refresh:[/] {self.last_refresh.strftime('%H:%M:%S')}")
def update_git_status(self) -> None: def _build_git_status_lines(self, status: Any) -> list[str]:
"""Update git status panel.""" """Build git status display lines.
git_panel = self.query_one("#git-status")
try: Args:
status = get_git_status() status: GitStatus object.
status_indicator = "[green]✓[/] Clean" if status.is_clean else "[yellow]![/] Uncommitted changes" Returns:
List of formatted status lines.
lines = [ """
f"[bold]Branch:[/] {status.branch}", lines = []
f"[bold]Commit:[/] {status.commit_hash[:7]}", lines.append(f"[bold]Branch:[/] {status.branch}")
] lines.append(f"[bold]Commit:[/] {status.commit_hash[:7]}")
if status.commit_message: if status.commit_message:
lines.append(f"[dim]{status.commit_message[:40]}[/]") lines.append(f"[dim]{status.commit_message[:40]}[/]")
@@ -257,6 +257,7 @@ class DashboardScreen(Container):
if status.is_detached: if status.is_detached:
lines.append("[yellow]![/] Detached HEAD") lines.append("[yellow]![/] Detached HEAD")
else: else:
status_indicator = "[green]✓[/] Clean" if status.is_clean else "[yellow]![/] Uncommitted changes"
lines.append(f"[bold]Status:[/] {status_indicator}") lines.append(f"[bold]Status:[/] {status_indicator}")
file_changes = [] file_changes = []
@@ -278,6 +279,15 @@ class DashboardScreen(Container):
sync_info.append(f"[red]-{status.behind}[/]") sync_info.append(f"[red]-{status.behind}[/]")
lines.append(f"[bold]Sync:[/] {' '.join(sync_info)}") lines.append(f"[bold]Sync:[/] {' '.join(sync_info)}")
return lines
def update_git_status(self) -> None:
"""Update git status panel."""
git_panel = self.query_one("#git-status")
try:
status = get_git_status()
lines = self._build_git_status_lines(status)
git_panel.update("\n".join(lines)) git_panel.update("\n".join(lines))
except GitStatusError as e: except GitStatusError as e: