v0.1.21 - 우측 요약 패널 실제 데이터 연결
This commit is contained in:
54
src/App.vue
54
src/App.vue
@@ -636,6 +636,56 @@ const bestDay = computed(() => {
|
||||
}
|
||||
})
|
||||
|
||||
const previousRecordedEntry = computed(() => {
|
||||
const selectedKey = toKey(selectedDate.value)
|
||||
|
||||
return [...plannerEntries.value]
|
||||
.filter(([key]) => key < selectedKey)
|
||||
.sort(([leftKey], [rightKey]) => rightKey.localeCompare(leftKey))[0] ?? null
|
||||
})
|
||||
|
||||
const prevSnapshotItems = computed(() => {
|
||||
if (!previousRecordedEntry.value) {
|
||||
return [
|
||||
'이전 기록 없음',
|
||||
'첫 기록을 쌓아보세요.',
|
||||
'오늘부터 흐름을 만들 수 있습니다.',
|
||||
]
|
||||
}
|
||||
|
||||
const [entryKey, entryRecord] = previousRecordedEntry.value
|
||||
const completedCount = entryRecord.tasks.filter((task) => task.title.trim() && task.checked).length
|
||||
const previousComment = entryRecord.comment.trim()
|
||||
const previousTopTask = entryRecord.tasks.find((task) => task.title.trim())
|
||||
|
||||
return [
|
||||
`${createDateLabel(entryKey)} 기록`,
|
||||
`${formatTotalTime(entryRecord)} 집중 / 완료 ${completedCount}개`,
|
||||
previousComment || (previousTopTask ? `주요 작업: ${previousTopTask.title}` : '남겨진 코멘트 없음'),
|
||||
]
|
||||
})
|
||||
|
||||
const readNextItems = computed(() => {
|
||||
const nextDayFirstTask = secondaryPlanner.value.tasks.find((task) => task.title.trim())
|
||||
const incompleteTasks = planner.value.tasks.filter((task) => task.title.trim() && !task.checked)
|
||||
const carryTask = incompleteTasks[0]?.title
|
||||
const todayComment = planner.value.comment.trim()
|
||||
|
||||
return [
|
||||
nextDayFirstTask
|
||||
? `내일 첫 작업: ${nextDayFirstTask.title}`
|
||||
: carryTask
|
||||
? `내일 이어갈 첫 작업: ${carryTask}`
|
||||
: '내일 첫 작업은 아직 비어 있습니다.',
|
||||
incompleteTasks.length > 0
|
||||
? `미완료 ${incompleteTasks.length}개를 이어서 볼 수 있습니다.`
|
||||
: '오늘 미완료 작업은 없습니다.',
|
||||
todayComment
|
||||
? `오늘 코멘트 이어보기: ${todayComment}`
|
||||
: '오늘 코멘트는 아직 비어 있습니다.',
|
||||
]
|
||||
})
|
||||
|
||||
watch(
|
||||
[plannerRecords, selectedDate, calendarViewDate, statsRangeStart, statsRangeEnd],
|
||||
() => {
|
||||
@@ -1493,7 +1543,7 @@ onMounted(() => {
|
||||
<p class="mb-4 text-[11px] font-bold tracking-[0.22em] text-ink">PREV SNAPSHOT</p>
|
||||
<div class="space-y-3">
|
||||
<p
|
||||
v-for="item in planner.prevSummary"
|
||||
v-for="item in prevSnapshotItems"
|
||||
:key="item"
|
||||
class="border-b border-stone-200 pb-3 text-[11px] font-semibold tracking-[0.08em] text-stone-700 last:border-b-0 last:pb-0"
|
||||
>
|
||||
@@ -1528,7 +1578,7 @@ onMounted(() => {
|
||||
<p class="mb-4 text-[11px] font-bold tracking-[0.22em] text-ink">READ NEXT</p>
|
||||
<div class="space-y-3">
|
||||
<p
|
||||
v-for="item in planner.nextFocus"
|
||||
v-for="item in readNextItems"
|
||||
:key="item"
|
||||
class="border-b border-stone-200 pb-3 text-[11px] font-semibold tracking-[0.08em] text-stone-700 last:border-b-0 last:pb-0"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user