diff --git a/frontend/src/views/TaskEditorView.vue b/frontend/src/views/TaskEditorView.vue index 41ceffa..751a94f 100644 --- a/frontend/src/views/TaskEditorView.vue +++ b/frontend/src/views/TaskEditorView.vue @@ -98,7 +98,7 @@ async function toggleSubTask(sub: SubTask) { toast.show("Failed to update sub-task", "error"); } } -const showPreview = ref(true); +const showPreview = ref(false); const sidebarOpen = ref(true); const editorRef = ref | null>(null); const titleRef = ref(null); @@ -266,6 +266,8 @@ onMounted(async () => { savedProjectId = projectId.value; savedMilestoneId = milestoneId.value; savedParentId = parentId.value; + // Start in preview mode only if the task already has body content + showPreview.value = body.value.trim().length > 0; } loadSubTasks(); } else { @@ -304,6 +306,7 @@ async function save() { savedParentId = parentId.value; dirty.value = false; toast.show("Task saved"); + window.location.reload(); } else { const task = await store.createTask(data); dirty.value = false; diff --git a/frontend/src/views/TaskViewerView.vue b/frontend/src/views/TaskViewerView.vue index 4810b5e..5cee4b6 100644 --- a/frontend/src/views/TaskViewerView.vue +++ b/frontend/src/views/TaskViewerView.vue @@ -111,6 +111,26 @@ function cycleStatus() { ); } +const forwardStatus: Record = { + todo: "in_progress", + in_progress: "done", + done: null, +}; + +const advanceLabel = computed(() => { + const s = store.currentTask?.status as TaskStatus | undefined; + if (!s) return null; + const next = forwardStatus[s]; + if (!next) return null; + return next === "in_progress" ? "→ In Progress" : "→ Done"; +}); + +function advanceStatus() { + if (!store.currentTask) return; + const next = forwardStatus[store.currentTask.status as TaskStatus]; + if (next) store.patchStatus(store.currentTask.id, next); +} + function isOverdue(): boolean { if (!store.currentTask?.due_date || store.currentTask.status === "done") return false; @@ -192,6 +212,13 @@ const subTaskProgress = computed(() => { > Edit +