fix(kanban): complete refresh button implementation (#584)

- Destructure onRefresh and isRefreshing props in KanbanBoard
- Add refresh button in kanban header with spinning animation
- Button shows 'Refreshing...' text while loading

Fixes incomplete implementation from PR #548
This commit is contained in:
Michael Ludlow
2026-01-03 06:04:37 -05:00
committed by GitHub
parent 4a833048d1
commit 6c855905cb
@@ -277,7 +277,7 @@ const DroppableColumn = memo(function DroppableColumn({ status, tasks, onTaskCli
);
}, droppableColumnPropsAreEqual);
export function KanbanBoard({ tasks, onTaskClick, onNewTaskClick }: KanbanBoardProps) {
export function KanbanBoard({ tasks, onTaskClick, onNewTaskClick, onRefresh, isRefreshing }: KanbanBoardProps) {
const { t } = useTranslation('tasks');
const [activeTask, setActiveTask] = useState<Task | null>(null);
const [overColumnId, setOverColumnId] = useState<string | null>(null);
@@ -412,6 +412,21 @@ export function KanbanBoard({ tasks, onTaskClick, onNewTaskClick }: KanbanBoardP
return (
<div className="flex h-full flex-col">
{/* Kanban header with refresh button */}
{onRefresh && (
<div className="flex items-center justify-end px-6 pt-4 pb-2">
<Button
variant="ghost"
size="sm"
onClick={onRefresh}
disabled={isRefreshing}
className="gap-2 text-muted-foreground hover:text-foreground"
>
<RefreshCw className={cn("h-4 w-4", isRefreshing && "animate-spin")} />
{isRefreshing ? 'Refreshing...' : 'Refresh Tasks'}
</Button>
</div>
)}
{/* Kanban columns */}
<DndContext
sensors={sensors}