Skip to content

Commit cd6d2aa

Browse files
committed
feat: add loading indicator for saving state in TaskTimelineItem component
1 parent b2b8f57 commit cd6d2aa

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

frontend/src/components/tasks/TaskTimelineItem.vue

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
>
2323
<h3 class="font-medium flex items-center gap-2">
2424
{{ title }}
25+
<Loader2
26+
v-if="isSaving"
27+
class="w-3 h-3 animate-spin text-muted-foreground"
28+
/>
2529
</h3>
2630
<div class="flex items-center gap-2">
2731
<div @click.stop>
@@ -36,7 +40,9 @@
3640
</div>
3741
</div>
3842
<CollapsibleContent class="mt-4">
39-
<slot />
43+
<div :class="{ 'pointer-events-none opacity-50': isSaving }">
44+
<slot />
45+
</div>
4046
</CollapsibleContent>
4147
</Card>
4248
</Collapsible>
@@ -54,7 +60,9 @@ import {
5460
StepperIndicator,
5561
StepperSeparator,
5662
} from "@/components/ui/stepper";
57-
import { ChevronDown } from "lucide-vue-next";
63+
import { ChevronDown, Loader2 } from "lucide-vue-next";
64+
import { inject } from "vue";
65+
import { TASKS_SAVING_KEY } from "@/composables/useTasksSaving";
5866
5967
interface Props {
6068
stepNumber: number;
@@ -67,6 +75,9 @@ const props = withDefaults(defineProps<Props>(), {
6775
isLast: false,
6876
});
6977
78+
// Injected from Tasks.vue — undefined outside the tasks context
79+
const isSaving = inject(TASKS_SAVING_KEY);
80+
7081
// Start collapsed if complete, open if incomplete
7182
const isOpen = ref(!props.isComplete);
7283
</script>

0 commit comments

Comments
 (0)