mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
feat: add MiniScanner component and git service tests
- Extract session busy indicator to reusable MiniScanner component - Refactor SessionCard to use MiniScanner for cleaner code - Add comprehensive tests for GitBranchService, GitDiffService - Add repo-git route tests
This commit is contained in:
1 parent
7f30a28be9
commit
570a67e7b0
5 files changed
+1259
-9
No files matched your search
@@ -1,9 +1,9 @@
|
||||
import { Card } from "@/components/ui/card";
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
import { MiniScanner } from "@/components/ui/mini-scanner";
|
||||
import { Trash2, Clock } from "lucide-react";
|
||||
import { formatDistanceToNow } from "date-fns";
|
||||
import type { Session } from "@/api/types";
|
||||
import { useSessionStatusForSession } from "@/stores/sessionStatusStore";
|
||||
|
||||
interface SessionCardProps {
|
||||
session: Session;
|
||||
@@ -22,8 +22,6 @@ export const SessionCard = ({
|
||||
onToggleSelection,
|
||||
onDelete,
|
||||
}: SessionCardProps) => {
|
||||
const sessionStatus = useSessionStatusForSession(session.id);
|
||||
const isSessionBusy = sessionStatus.type === 'busy' || sessionStatus.type === 'retry' || sessionStatus.type === 'compact';
|
||||
|
||||
return (
|
||||
<Card
|
||||
@@ -49,12 +47,7 @@ export const SessionCard = ({
|
||||
}}
|
||||
className="w-5 h-5 flex-shrink-0"
|
||||
/>
|
||||
{isSessionBusy && (
|
||||
<span className="relative flex h-2.5 w-2.5 flex-shrink-0">
|
||||
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"></span>
|
||||
<span className="relative inline-flex rounded-full h-2.5 w-2.5 bg-green-500"></span>
|
||||
</span>
|
||||
)}
|
||||
<MiniScanner sessionID={session.id} />
|
||||
</div>
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="flex items-center gap-2">
|
||||
|
||||
Reference in new issue
Block a user