From 35f9b566ce760bf94a8321870fe329f40fd5bb03 Mon Sep 17 00:00:00 2001 From: bboysoul Date: Thu, 24 Sep 2026 14:19:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8A=A8=E6=95=88=E8=A1=A5=E9=BD=90?= =?UTF-8?q?=E5=8A=A8=E6=95=88=E5=AE=A1=E8=AE=A1=E4=BA=94=E5=A4=84=E7=BC=BA?= =?UTF-8?q?=E5=8F=A3=E2=80=94=E2=80=94=E8=A7=86=E5=9B=BE=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E6=B7=A1=E5=85=A5=E4=B8=8A=E7=A7=BB=E3=80=81AppSheet=E6=8A=BD?= =?UTF-8?q?=E5=B1=89=E5=BC=80=E5=90=88=E5=AF=B9=E7=A7=B0=E3=80=81=E6=96=B0?= =?UTF-8?q?=E5=BB=BA=E4=BB=BB=E5=8A=A1=E8=90=BD=E8=A1=8C=E5=8F=8D=E9=A6=88?= =?UTF-8?q?=E3=80=81=E7=BF=BB=E9=A1=B5=E7=BB=93=E6=9E=9C=E6=B7=A1=E5=85=A5?= =?UTF-8?q?=E3=80=81=E6=95=B0=E5=AD=97=E4=B9=A0=E6=83=AF+1=E8=84=89?= =?UTF-8?q?=E5=86=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.vue | 31 ++++++++++++++++++++---- frontend/src/MvpPanel.vue | 10 ++++++-- frontend/src/components/AppSheet.test.ts | 1 + frontend/src/components/AppSheet.vue | 2 +- frontend/src/style.css | 13 ++++++++++ frontend/src/style.test.ts | 20 +++++++++++++++ frontend/tsconfig.app.tsbuildinfo | 2 +- 7 files changed, 70 insertions(+), 9 deletions(-) diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 95ce25a..04e55c8 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -143,6 +143,13 @@ const markTaskJustCompleted = createCompletionPulse( (id) => { justCompletedTaskIds.value = new Set(justCompletedTaskIds.value).add(id) }, (id) => { const next = new Set(justCompletedTaskIds.value); next.delete(id); justCompletedTaskIds.value = next }, ) +const justAddedTaskIds = ref(new Set()) +const markTaskJustAdded = createCompletionPulse( + (id) => { justAddedTaskIds.value = new Set(justAddedTaskIds.value).add(id) }, + (id) => { const next = new Set(justAddedTaskIds.value); next.delete(id); justAddedTaskIds.value = next }, +) +const viewSwap = ref(false) +const listSwap = ref(false) const navigationLoaded = ref(false) const taskSwipeStart = ref<{ id: string; x: number; y: number } | null>(null) const taskPointerStart = ref<{ id: string; x: number; y: number } | null>(null) @@ -325,9 +332,10 @@ async function submitTaskCompose() { description: composeDescription.value, ...recurrencePayload, }) }) as Promise, - () => { + (created) => { if (taskComposeGeneration.value === composeGeneration) taskComposeOpen.value = false toast('任务已添加') + markTaskJustAdded(created.id) }, (reason) => { if (taskComposeGeneration.value !== composeGeneration) return @@ -1658,11 +1666,17 @@ async function scrollToTaskPageStart() { await nextTick() taskListElement.value?.scrollIntoView({ block: 'start' }) } +async function swapListResults() { + listSwap.value = false + await nextTick() + listSwap.value = true +} async function previousPage() { if (page.value <= 1 || loading.value) return page.value -= 1 if (activeView.value === 'trash') await loadTrash() else if (isTaskView(activeView.value)) await loadAll() + await swapListResults() await scrollToTaskPageStart() } async function nextPage() { @@ -1670,6 +1684,7 @@ async function nextPage() { page.value += 1 if (activeView.value === 'trash') await loadTrash() else if (isTaskView(activeView.value)) await loadAll() + await swapListResults() await scrollToTaskPageStart() } @@ -1682,6 +1697,12 @@ function reconcileDesktopPaneWidths() { } watch([selectedTask, habitDetailOpen, calendarDetailOpen, sidebarCollapsed], reconcileDesktopPaneWidths) +watch(activeView, async () => { + listSwap.value = false + viewSwap.value = false + await nextTick() + viewSwap.value = true +}) function handlePaneResizeBlur() { stopPaneResize() } @@ -1802,7 +1823,7 @@ onUnmounted(() => {