mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-10-10 03:30:59 +00:00
Spin the in-progress TODO icon in the stage sidebar
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
aa65b79e57
commit
9d1f170908
1 changed files with 4 additions and 4 deletions
|
|
@ -246,22 +246,22 @@ function TodoSection({ todos }: { todos: TodoListProjection | null }) {
|
|||
}
|
||||
|
||||
function TodoRow({ todo }: { todo: TodoProjection }) {
|
||||
const { Icon, color, srLabel } = todoStatusVisual(todo.status);
|
||||
const { Icon, color, srLabel, spin } = todoStatusVisual(todo.status);
|
||||
const muted = todo.status === TodoStatus.COMPLETED;
|
||||
return (
|
||||
<li className="flex items-start gap-1.5">
|
||||
<Icon className={`mt-0.5 size-3.5 shrink-0 ${color}`} aria-label={srLabel} />
|
||||
<Icon className={`mt-0.5 size-3.5 shrink-0 ${color} ${spin ? "animate-spin" : ""}`} aria-label={srLabel} />
|
||||
<span className={`min-w-0 text-xs ${muted ? "text-fg-muted line-through" : "text-fg-2"}`}>{todo.subject}</span>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
|
||||
function todoStatusVisual(status: TodoStatus): { Icon: IconType; color: string; srLabel: string } {
|
||||
function todoStatusVisual(status: TodoStatus): { Icon: IconType; color: string; srLabel: string; spin?: boolean } {
|
||||
switch (status) {
|
||||
case TodoStatus.COMPLETED:
|
||||
return { Icon: CheckCircleIcon, color: "text-mint", srLabel: "Completed" };
|
||||
case TodoStatus.IN_PROGRESS:
|
||||
return { Icon: ArrowPathIcon, color: "text-teal-500", srLabel: "In progress" };
|
||||
return { Icon: ArrowPathIcon, color: "text-teal-500", srLabel: "In progress", spin: true };
|
||||
case TodoStatus.DELETED:
|
||||
return { Icon: XCircleIcon, color: "text-fg-muted", srLabel: "Deleted" };
|
||||
case TodoStatus.PENDING:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue