TaskView is a self-hosted project and task management platform focused on clarity, ownership, and control. TaskView is built for teams that want a transparent, self-hosted alternative to SaaS task managers.
TypeScript graphviewkanban-boardnodejsproductivityproject-managementself-hostedtasktask-managementtask-managertodoapp
feat(web): add read-only calendar view
Daniel Barreto01c8f825fe24
diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 3f4ed89..3d9e49f 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -361,6 +361,9 @@ importers:'@dagrejs/dagre':specifier: ^1.1.5version: 1.1.8+ '@fullcalendar/vue3':+ specifier: ^7.1.1'@iconify-json/carbon':specifier: ^1.2.18version: 1.2.18@@ -478,6 +481,9 @@ importers:taskview-api:specifier: workspace:^version: link:../taskview-packages/taskview-api+ temporal-polyfill:+ specifier: ^1.0.5+ version: 1.0.5vue:specifier: ^3.5.27version: 3.5.27([email protected])@@ -1972,6 +1978,23 @@ packages:'@floating-ui/[email protected]':resolution: {integrity: sha512-vdf8f6rHnFPPLRsmL4p12wYl+Ux4mOJOkjzKEMYVnwdf7UFdvBtHlLvQyx8iKG5vhPRbDRgZxdtpmyigDPjzYg==}+ '@full-ui/[email protected]':+ resolution: {integrity: sha512-WaZw5t4K+JlLDw/1ucnjnOznXJJ/86bZWgeNIh8Xac62/+nn0VMO4HqCFKk9ylFnrng4zLy4iAjkFuH6jjS3Ow==}+ peerDependencies:+ temporal-polyfill: ^1.0.1++ '@fullcalendar/[email protected]':+ resolution: {integrity: sha512-QYTmaq52uxvGLk9EX60p+4zYIE+baGDdbYEITW4iovevohlpl1Jg7u3X2hfW1//yk0cs7d1Kd3yOBcaMnObITg==}+ peerDependencies:+ '@full-ui/headless-calendar': 7.1.1+ temporal-polyfill: ^1.0.1++ '@fullcalendar/[email protected]':+ resolution: {integrity: sha512-rasZBEEVZRBvyKtsghpf8iHkFN9Wpu732Kg+1liIYi4erP1730gT8ifYnBt2gjt1LUuIg7H5AEvPMWkfJXTSDQ==}+ peerDependencies:+ temporal-polyfill: ^1.0.1+ vue: ^3.0.11+'@google-cloud/[email protected]':resolution: {integrity: sha512-EW/O8ktzwLfyWBOsNuhRoMi8lrC3clHM5LVFhGvO1HCsLozCOOXRAlHrYBoE6HL42Sc8yYMuCb2XqcnJ4OOEpw==}engines: {node: '>=14.0.0'}@@ -7204,6 +7227,14 @@ packages:resolution: {integrity: sha512-choctRBIV9EMT9WGAZHn3V7t0Z2pMQyl0EZE6pFc/6ml3ssw7Dlf/oAOvFwjm1HVsqfQN8GfeFyJ+d8tRzqueQ==}+ resolution: {integrity: sha512-ej2aVZ+vZ8WO7tvlQWRM9N63A0KzF9q4mWJfDUHgYaIofWY9hu74QdnQrjoPMmZi2/nZ5gN0bJCQF49xQqx09Q==}+ peerDependencies:+ preact-render-to-string: '>=5'+ peerDependenciesMeta:+ preact-render-to-string:+ optional: true+resolution: {integrity: sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==}engines: {node: '>=10'}@@ -7964,6 +7995,15 @@ packages:resolution: {integrity: sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==}engines: {node: '>=8'}+ resolution: {integrity: sha512-+H/mmY74i6wXCMcjIhGuSnODcyZnc4eois2myhOyX0UqRAKNXQY5m9iB1en5jQ/n4SXtjLXo1ElBI5bmn8tZwQ==}++ resolution: {integrity: sha512-wxVoanmDeavXie1vu2JaQ3WIc3JZnWAOYFBsJyATaVsXsycKYUflGsyBmrRSnoCpZJpwPyr38VpgSUlQ8CbFxg==}++ resolution: {integrity: sha512-9jbTSX3HvkOWvDpNpFzwX/d1mkCrgQgwLmVTOEiuocZGKHsrQJtttGZFmybJ2zYP5zCSZuU5ZyeS8+eOEPABiQ==}+resolution: {integrity: sha512-biM9brNqxSc04Ee71hzFbryD11nX7VPhQQY32AdDmjFvodsRFz/3ufeoTZ6uYkRFfGo188tENcASNs3vTdsM0w==}engines: {node: '>=10'}@@ -10547,6 +10587,25 @@ snapshots:- '@vue/composition-api'- vue+ '@full-ui/[email protected]([email protected])':+ dependencies:+ temporal-polyfill: 1.0.5++ '@fullcalendar/[email protected](@full-ui/[email protected]([email protected]))([email protected])':+ dependencies:+ '@full-ui/headless-calendar': 7.1.1([email protected])+ temporal-polyfill: 1.0.5++ dependencies:+ '@full-ui/headless-calendar': 7.1.1([email protected])+ preact: 10.29.8+ temporal-polyfill: 1.0.5+ vue: 3.5.27([email protected])+ transitivePeerDependencies:+ - preact-render-to-string+'@google-cloud/[email protected]':dependencies:'@opentelemetry/api': 1.9.0@@ -16478,6 +16537,8 @@ snapshots:+ [email protected]: {}+dependencies:detect-libc: 2.1.2@@ -17433,6 +17494,15 @@ snapshots:+ dependencies:+ temporal-spec: 1.0.1+ temporal-utils: 1.0.3++ [email protected]: {}++ [email protected]: {}+dependencies:del: 6.1.1diff --git a/web/package.json b/web/package.jsonindex 642a94a..2334c2d 100644--- a/web/package.json+++ b/web/package.json@@ -32,6 +32,7 @@"@capacitor/splash-screen": "^8.0.1","@capgo/capacitor-updater": "^8.43.2","@dagrejs/dagre": "^1.1.5",+ "@fullcalendar/vue3": "^7.1.1","@iconify-json/carbon": "^1.2.18","@iconify-json/lucide": "^1.2.90","@iconify-json/mdi": "^1.2.3",@@ -71,6 +72,7 @@"scule": "^1.3.0","tailwindcss": "^4.1.18","taskview-api": "workspace:^",+ "temporal-polyfill": "^1.0.5","vue": "^3.5.27","vue-chartjs": "^5.3.3","vue-i18n": "^11.2.8",diff --git a/web/src/assets/css/calendar.css b/web/src/assets/css/calendar.cssnew file mode 100644index 0000000..bacb4b0--- /dev/null+++ b/web/src/assets/css/calendar.css@@ -0,0 +1,50 @@+/*+ * FullCalendar "classic" palette mapped to Nuxt UI tokens. Replaces the stock palette.css so+ * light/dark follow the app's `.dark` class instead of FullCalendar's own color scheme.+ * Declared on :root because drag mirrors are appended to <body>, outside the calendar.+ */+:root {+ --fc-classic-button: var(--ui-bg-elevated);+ --fc-classic-button-border: var(--ui-border);+ --fc-classic-button-strong: var(--ui-bg-accented);+ --fc-classic-button-strong-border: var(--ui-border-accented);+ --fc-classic-button-outline: color-mix(in oklab, var(--ui-primary) 50%, transparent);+ --fc-classic-button-foreground: var(--ui-text);++ --fc-classic-primary: var(--ui-primary);+ --fc-classic-primary-foreground: var(--ui-bg);++ --fc-classic-event: var(--ui-primary);+ --fc-classic-event-contrast: var(--ui-bg);+ --fc-classic-background-event: var(--ui-primary);+ --fc-classic-background-event-opacity: 15%;+ --fc-classic-background-event-foreground-opacity: 50%;+ --fc-classic-highlight: color-mix(in oklab, var(--ui-primary) 15%, transparent);+ --fc-classic-today: color-mix(in oklab, var(--ui-primary) 4%, transparent);+ --fc-classic-now: var(--ui-error);+ --fc-classic-small-dot-width: 8px;+ --fc-classic-large-dot-width: 10px;++ --fc-classic-background: var(--ui-bg);+ --fc-classic-faint: var(--ui-bg-muted);+ --fc-classic-muted: var(--ui-bg-elevated);+ --fc-classic-strong: var(--ui-bg-accented);++ --fc-classic-foreground: var(--ui-text);+ --fc-classic-faint-foreground: var(--ui-text-dimmed);+ --fc-classic-muted-foreground: var(--ui-text-muted);++ --fc-classic-border: var(--ui-border);+ --fc-classic-strong-border: var(--ui-border-accented);+}++/* Day headers and day numbers are nav links; the classic theme underlines them on hover */+.tv-calendar [role='link']:hover {+ text-decoration: none;+}++/* Empty weekend days in the week view (see ProjectCalendar's collapsedWeekdays).+ !important because FullCalendar's skeleton sizes columns with !important utilities. */+.tv-calendar .tv-calendar-collapsed {+ flex: 0 0 4.5rem !important;+}diff --git a/web/src/bootstrap.ts b/web/src/bootstrap.tsindex 1ea52cf..27cf11d 100644--- a/web/src/bootstrap.ts+++ b/web/src/bootstrap.ts@@ -64,6 +64,11 @@ function buildRoutes(extensions: TvWebExtension[]): RouteRecordRaw[] {name: 'graph',component: () => import('./pages/user/graph.vue'),},+ {+ path: ':projectId/calendar',+ name: 'calendar',+ component: () => import('./pages/user/calendar.vue'),+ },{path: ':projectId/sprints',name: 'sprints',diff --git a/web/src/components/features/calendar/CalendarTaskCard.vue b/web/src/components/features/calendar/CalendarTaskCard.vuenew file mode 100644index 0000000..3c3b2aa--- /dev/null+++ b/web/src/components/features/calendar/CalendarTaskCard.vue@@ -0,0 +1,100 @@+<template>+ <div+ v-if="dot"+ class="h-1.5 w-full rounded-full"+ :class="{ 'opacity-40': task.complete }"+ :style="{ backgroundColor: tint.solidColor }"+ :title="task.description"+ :data-testid="`calendar-task-${task.id}`"+ />+ <div+ v-else+ class="tv-calendar-card flex w-full min-w-0 items-start gap-1.5 rounded-10 border px-1.5 py-1 text-sm text-default"+ :class="{ 'opacity-60': task.complete }"+ :style="{ backgroundColor: tint.backgroundColor, borderColor: tint.borderColor }"+ :data-testid="`calendar-task-${task.id}`"+ >+ <UAvatarGroup+ v-if="assignees.length"+ size="3xs"+ :max="2"+ class="mt-px shrink-0"+ >+ <UAvatar+ v-for="email in assignees"+ :key="email"+ :alt="email"+ :title="email"+ :text="email.slice(0, 2).toUpperCase()"+ />+ </UAvatarGroup>++ <span+ v-if="timeText"+ class="mt-px shrink-0 text-xs text-muted tabular-nums"+ >{{ timeText }}</span>++ <span+ class="min-w-0 flex-1 leading-snug"+ :class="[compact ? 'truncate' : 'line-clamp-2 break-words', { 'line-through text-muted': task.complete }]"+ :title="task.description"+ >{{ task.description }}</span>++ <span+ v-if="canViewTaskSubtasks && task.subtasks.length"+ class="mt-px flex shrink-0 items-center gap-0.5 text-xs text-muted tabular-nums"+ :title="t('calendar.subtasks', { count: task.subtasks.length })"+ >+ <UIcon+ name="i-lucide-list-tree"+ class="size-3.5"+ />+ {{ task.subtasks.length }}+ </span>+ </div>+</template>++<script setup lang="ts">+import { computed } from 'vue'+import { useI18n } from 'vue-i18n'+import type { TaskItem } from '@/types/tasks.types'+import { useCollaborationStore } from '@/stores/collaboration.store'+import { useGoalPermissions } from '@/composables/useGoalPermissions'++const props = defineProps<{+ task: TaskItem+ timeText?: string+ // Month cells fit a single line; the week columns have room for two+ compact?: boolean+ // Phone-width month: cells are too narrow for text, show a priority-colored bar+ dot?: boolean+}>()++const { t } = useI18n()+const collaborationStore = useCollaborationStore()+const { canViewTaskPriority, canViewAssignedUsersToTask, canViewTaskSubtasks } = useGoalPermissions()++// Same mapping as the priority dot in TaskItem: 3 high, 2 medium, 1 low+const PRIORITY_COLORS: Record<number, string> = {+ 3: 'var(--ui-error)',+ 2: 'var(--ui-warning)',+ 1: 'var(--ui-success)',+}++const tint = computed(() => {+ const color = canViewTaskPriority.value ? PRIORITY_COLORS[props.task.priorityId] : undefined+ const base = color ?? 'var(--ui-text-muted)'+ return {+ backgroundColor: `color-mix(in oklab, ${base} 16%, var(--ui-bg))`,+ borderColor: `color-mix(in oklab, ${base} 30%, transparent)`,+ solidColor: base,+ }+})++const assignees = computed(() => {+ if (!canViewAssignedUsersToTask.value) return []+ return props.task.assignedUsers+ .map((id) => collaborationStore.userMap.get(id)?.email)+ .filter((email): email is string => !!email)+})+</script>diff --git a/web/src/components/features/calendar/CalendarToolbar.vue b/web/src/components/features/calendar/CalendarToolbar.vuenew file mode 100644index 0000000..d6fa71d--- /dev/null+++ b/web/src/components/features/calendar/CalendarToolbar.vue@@ -0,0 +1,86 @@+<template>+ <div class="flex min-w-0 items-center gap-2">+ <UButton+ :label="t('calendar.today')"+ color="neutral"+ variant="soft"+ size="lg"+ data-testid="calendar-today"+ @click="emit('today')"+ />+ <UFieldGroup size="lg">+ <UButton+ icon="i-lucide-chevron-left"+ color="neutral"+ variant="ghost"+ square+ :aria-label="t('calendar.previous')"+ data-testid="calendar-prev"+ @click="emit('prev')"+ />+ <UButton+ icon="i-lucide-chevron-right"+ color="neutral"+ variant="ghost"+ square+ :aria-label="t('calendar.next')"+ data-testid="calendar-next"+ @click="emit('next')"+ />+ </UFieldGroup>++ <h2+ class="min-w-0 truncate text-base font-semibold first-letter:uppercase sm:min-w-40"+ data-testid="calendar-title"+ >+ {{ title }}+ </h2>++ <UFieldGroup+ size="lg"+ class="ml-auto shrink-0"+ >+ <UButton+ v-for="item in viewItems"+ :key="item.value"+ :icon="compact ? item.icon : undefined"+ :label="compact ? undefined : item.label"+ :aria-label="item.label"+ :aria-pressed="view === item.value"+ :color="view === item.value ? 'primary' : 'neutral'"+ :variant="view === item.value ? 'soft' : 'ghost'"+ :square="compact"+ :data-testid="`calendar-view-${item.value}`"+ @click="view = item.value"+ />+ </UFieldGroup>+ </div>+</template>++<script setup lang="ts">+import { computed } from 'vue'+import { useI18n } from 'vue-i18n'+import type { CalendarView } from '@/composables/useCalendarRouteState'++defineProps<{+ title: string+ // Icon-only view switcher for narrow screens+ compact?: boolean+}>()++const emit = defineEmits<{+ today: []+ prev: []+ next: []+}>()++const view = defineModel<CalendarView>('view', { required: true })++const { t } = useI18n()++const viewItems = computed(() => [+ { value: 'month' as const, label: t('calendar.views.month'), icon: 'i-lucide-calendar' },+ { value: 'week' as const, label: t('calendar.views.week'), icon: 'i-lucide-columns-3' },+ { value: 'list' as const, label: t('calendar.views.list'), icon: 'i-lucide-list' },+])+</script>diff --git a/web/src/components/features/calendar/ProjectCalendar.vue b/web/src/components/features/calendar/ProjectCalendar.vuenew file mode 100644index 0000000..627daf6--- /dev/null+++ b/web/src/components/features/calendar/ProjectCalendar.vue@@ -0,0 +1,191 @@+<template>+ <div class="tv-calendar flex h-full min-h-0 flex-col gap-3">+ <CalendarToolbar+ v-model:view="view"+ :title="title"+ :compact="isMobile"+ @today="api()?.today()"+ @prev="api()?.prev()"+ @next="api()?.next()"+ />++ <div+ class="relative min-h-0 flex-1"+ :class="{ 'overflow-x-auto': scrollWeek }"+ >+ <FullCalendar+ ref="calendarRef"+ :options="calendarOptions"+ :class="{ 'min-w-240': scrollWeek }"+ >+ <template #dayHeaderContent="arg">+ <div+ v-if="arg.view.type === FC_VIEWS.week"+ class="flex flex-col items-start gap-0.5 px-1 py-1.5"+ >+ <span class="text-xs font-normal text-muted">{{ arg.weekdayText }}</span>+ <span+ class="rounded-10 px-1.5 text-2xl leading-9 font-semibold tabular-nums"+ :class="arg.isToday ? 'bg-primary text-inverted' : 'text-highlighted'"+ >{{ arg.dayNumberText }}</span>+ </div>+ <span+ v-else+ class="text-xs font-normal text-muted"+ >{{ arg.text }}</span>+ </template>++ <template #dayCellTopContent="arg">+ <span+ class="inline-flex min-w-6 justify-center rounded-md px-1 text-xs tabular-nums"+ :class="arg.isToday ? 'bg-primary font-semibold text-inverted' : 'text-muted'"+ >{{ arg.dayNumberText }}</span>+ </template>++ <template #eventContent="arg">+ <CalendarTaskCard+ :task="arg.event.extendedProps.task"+ :time-text="arg.event.allDay ? undefined : arg.timeText"+ :compact="arg.view.type !== FC_VIEWS.week"+ :dot="isMobile && arg.view.type === FC_VIEWS.month"+ />+ </template>+ </FullCalendar>++ <div+ v-if="showEmptyState"+ class="pointer-events-none absolute inset-0 flex items-center justify-center p-6"+ data-testid="calendar-empty"+ >+ <div class="max-w-xs rounded-14 border border-default bg-elevated/90 p-4 text-center backdrop-blur-sm">+ <UIcon+ name="i-lucide-calendar-days"+ class="mb-2 size-6 text-muted"+ />+ <p class="text-sm font-medium text-highlighted">+ {{ t('calendar.empty.title') }}+ </p>+ <p class="mt-1 text-sm text-muted">+ {{ t('calendar.empty.description') }}+ </p>+ </div>+ </div>+ </div>+ </div>+</template>++<script setup lang="ts">+import { computed, ref, useTemplateRef, watch } from 'vue'+import { addDays, eachDayOfInterval, getDay, isWeekend } from 'date-fns'+import { useI18n } from 'vue-i18n'+import FullCalendar from '@fullcalendar/vue3'+import type { CalendarOptions, DatesSetInfo, EventClickInfo } from '@fullcalendar/vue3'+import dayGridPlugin from '@fullcalendar/vue3/daygrid'+import listPlugin from '@fullcalendar/vue3/list'+import classicThemePlugin from '@fullcalendar/vue3/themes/classic'+import deLocale from '@fullcalendar/vue3/locales/de'+import esLocale from '@fullcalendar/vue3/locales/es'+import ptBrLocale from '@fullcalendar/vue3/locales/pt-br'+import ruLocale from '@fullcalendar/vue3/locales/ru'+import '@fullcalendar/vue3/skeleton.css'+import '@fullcalendar/vue3/themes/classic/theme.css'+import '@/assets/css/calendar.css'+import CalendarToolbar from './CalendarToolbar.vue'+import CalendarTaskCard from './CalendarTaskCard.vue'+import { useCalendarStore } from '@/stores/calendar.store'+import { useTaskDetailPanel } from '@/composables/useTaskDetailPanel'+import { useTaskView } from '@/composables/useTaskView'+import { useWeekStart } from '@/composables/useWeekStart'+import { useCalendarRouteState, type CalendarView } from '@/composables/useCalendarRouteState'+import { isScheduled, occupiesDay, taskToEvent, type TaskCalendarEvent } from '@/helpers/taskCalendarDates'++const props = defineProps<{ goalId: number }>()++const FC_VIEWS: Record<CalendarView, string> = {+ month: 'dayGridMonth',+ week: 'dayGridWeek',+ list: 'listWeek',+}++const { t, locale } = useI18n()+const calendarStore = useCalendarStore()+const { openTask } = useTaskDetailPanel()+const { isMobile } = useTaskView()+const weekStart = useWeekStart()+const { view, date } = useCalendarRouteState(isMobile.value ? 'list' : 'week')++const calendarRef = useTemplateRef<InstanceType<typeof FullCalendar>>('calendarRef')+const api = () => calendarRef.value?.getApi()++const title = ref('')+// Read once: FullCalendar owns navigation after mount and reports it back through datesSet+const initialView = FC_VIEWS[view.value]+const initialDate = date.value++watch(() => props.goalId, (goalId) => calendarStore.fetchTasks(goalId), { immediate: true })++const events = computed(() => calendarStore.tasks+ .map(taskToEvent)+ .filter((event): event is TaskCalendarEvent => event !== null))++// Like Asana, an empty Saturday or Sunday shrinks to a narrow column in the week view.+// Only empty days collapse, so no multi-day bar ever spans a column narrower than the rest.+const visibleRange = ref<{ start: Date; end: Date }>()+const collapsedWeekdays = computed(() => {+ if (!visibleRange.value) return new Set<number>()+ const { start, end } = visibleRange.value+ const emptyWeekendDays = eachDayOfInterval({ start, end: addDays(end, -1) })+ .filter((day) => isWeekend(day) && !events.value.some((event) => occupiesDay(event, day)))+ return new Set(emptyWeekendDays.map((day) => getDay(day)))+})+const weekendClass = (arg: { dow: number }) => (collapsedWeekdays.value.has(arg.dow) ? 'tv-calendar-collapsed' : '')++// Seven readable columns don't fit a phone: let the week scroll sideways instead of squeezing cards+const scrollWeek = computed(() => isMobile.value && view.value === 'week')++const showEmptyState = computed(() => !calendarStore.loading && !calendarStore.tasks.some(isScheduled))++watch(view, (value) => api()?.changeView(FC_VIEWS[value]))++function onDatesSet(info: DatesSetInfo) {+ title.value = info.view.title+ date.value = info.view.currentStart+ visibleRange.value = { start: info.view.activeStart, end: info.view.activeEnd }+}++// Tapping a day number opens that week as a list, the readable view on any screen size+function onNavLinkDayClick(day: Date) {+ view.value = 'list'+ api()?.gotoDate(day)+}++function onEventClick(info: EventClickInfo) {+ info.jsEvent.preventDefault()+ openTask((info.event.extendedProps.task as TaskCalendarEvent['extendedProps']['task']).id)+}++const calendarOptions = computed<CalendarOptions>(() => ({+ plugins: [classicThemePlugin, dayGridPlugin, listPlugin],+ initialView,+ initialDate,+ headerToolbar: false,+ height: '100%',+ locales: [deLocale, esLocale, ptBrLocale, ruLocale],+ locale: locale.value.toLowerCase(),+ // Unset means "follow the locale"+ ...(weekStart.value !== undefined ? { firstDay: weekStart.value } : {}),+ events: events.value,+ eventDisplay: 'block',+ eventClass: 'cursor-pointer',+ eventColor: 'transparent',+ eventContrastColor: 'var(--ui-text)',+ dayMaxEvents: true,+ navLinks: true,+ navLinkDayClick: onNavLinkDayClick,+ views: {+ dayGridWeek: { dayMaxEvents: false, dayHeaderClass: weekendClass, dayCellClass: weekendClass },+ },+ datesSet: onDatesSet,+ eventClick: onEventClick,+}))+</script>diff --git a/web/src/composables/useCalendarRouteState.ts b/web/src/composables/useCalendarRouteState.tsnew file mode 100644index 0000000..5df4d88--- /dev/null+++ b/web/src/composables/useCalendarRouteState.ts@@ -0,0 +1,48 @@+import { computed } from 'vue'+import { useRoute, useRouter, type LocationQuery } from 'vue-router'+import { format, isValid, parseISO } from 'date-fns'++export const CALENDAR_VIEWS = ['month', 'week', 'list'] as const+export type CalendarView = typeof CALENDAR_VIEWS[number]++const DAY_FORMAT = 'yyyy-MM-dd'++function isCalendarView(value: unknown): value is CalendarView {+ return CALENDAR_VIEWS.includes(value as CalendarView)+}++// Keeps the calendar's view and focused date in the query string (?view=week&date=2026-10-08),+// so a reload or a shared link opens the same period+export function useCalendarRouteState(defaultView: CalendarView) {+ const route = useRoute()+ const router = useRouter()++ // route.query only updates once a navigation resolves, so patches made in the same tick+ // (e.g. a view change followed by FullCalendar's datesSet) build on the pending query instead+ let pending: LocationQuery | null = null++ function patchQuery(patch: Record<string, string>) {+ const base = pending ?? route.query+ if (Object.entries(patch).every(([key, value]) => base[key] === value)) return+ const query = { ...base, ...patch }+ pending = query+ router.replace({ query }).finally(() => {+ if (pending === query) pending = null+ })+ }++ const view = computed<CalendarView>({+ get: () => (isCalendarView(route.query.view) ? route.query.view : defaultView),+ set: (value) => patchQuery({ view: value }),+ })++ const date = computed<Date>({+ get: () => {+ const parsed = typeof route.query.date === 'string' ? parseISO(route.query.date) : null+ return parsed && isValid(parsed) ? parsed : new Date()+ },+ set: (value) => patchQuery({ date: format(value, DAY_FORMAT) }),+ })++ return { view, date }+}diff --git a/web/src/composables/useSelectedTaskSync.ts b/web/src/composables/useSelectedTaskSync.tsindex 34b62d8..82b4a41 100644--- a/web/src/composables/useSelectedTaskSync.ts+++ b/web/src/composables/useSelectedTaskSync.ts@@ -3,6 +3,7 @@ import { useTasksStore } from '@/stores/tasks.store'import { useKanbanStore } from '@/stores/kanban.store'import { useGraphStore } from '@/stores/graph.store'import { useBaseScreenStore } from '@/stores/base-screen.store'+import { useCalendarStore } from '@/stores/calendar.store'// If you use it in more than one component, you need to use a shared composable// using import { createSharedComposable } from '@vueuse/core'@@ -11,6 +12,7 @@ export function useSelectedTaskSync() {const kanbanStore = useKanbanStore()const graphStore = useGraphStore()const baseScreenStore = useBaseScreenStore()+ const calendarStore = useCalendarStore()watch(() => tasksStore.selectedTask,@@ -19,6 +21,7 @@ export function useSelectedTaskSync() {kanbanStore.syncTask(task)graphStore.syncTask(task)baseScreenStore.syncTask(task)+ calendarStore.syncTask(task)},{ deep: true },)@@ -27,6 +30,7 @@ export function useSelectedTaskSync() {kanbanStore.removeTask(taskId)graphStore.removeTask(taskId)baseScreenStore.removeTask(taskId)+ calendarStore.removeTask(taskId)}return { broadcastRemoval }diff --git a/web/src/helpers/taskCalendarDates.ts b/web/src/helpers/taskCalendarDates.tsnew file mode 100644index 0000000..62e49bc--- /dev/null+++ b/web/src/helpers/taskCalendarDates.ts@@ -0,0 +1,67 @@+import { addDays, format } from 'date-fns'+import type { Task } from 'taskview-api'++// Which task fields a single-day event was built from, so later writes can target the same field+export type TaskDateShape = 'range' | 'start' | 'end'++export interface TaskCalendarEvent {+ id: string+ title: string+ start: string | Date+ end?: string | Date+ allDay: boolean+ extendedProps: { task: Task; shape: TaskDateShape }+}++const DAY_FORMAT = 'yyyy-MM-dd'++// Dates that carry a time are stored in UTC; date-only values are plain calendar dates+function utcDateTime(date: string, time: string): Date {+ return new Date(`${date}T${time.slice(0, 5)}:00Z`)+}++// The local calendar day a stored date falls on (shifts only when a UTC time comes with it)+function localDay(date: string, time: string | null | undefined): string {+ return time ? format(utcDateTime(date, time), DAY_FORMAT) : date+}++export function isScheduled(task: Pick<Task, 'startDate' | 'endDate'>): boolean {+ return Boolean(task.startDate || task.endDate)+}++export function taskToEvent(task: Task): TaskCalendarEvent | null {+ const { startDate, startTime, endDate, endTime } = task+ if (!startDate && !endDate) return null++ const base = { id: String(task.id), title: task.description }++ if (startDate && endDate) {+ if (startTime && endTime) {+ return { ...base, start: utcDateTime(startDate, startTime), end: utcDateTime(endDate, endTime), allDay: false, extendedProps: { task, shape: 'range' } }+ }+ // Only one side has a time: a timed event can't express that, so show the range as all-day,+ // on the local days the task details show. FullCalendar's all-day end is exclusive.+ const startDay = localDay(startDate, startTime)+ const endExclusive = format(addDays(new Date(`${localDay(endDate, endTime)}T00:00:00`), 1), DAY_FORMAT)+ return { ...base, start: startDay, end: endExclusive, allDay: true, extendedProps: { task, shape: 'range' } }+ }++ const shape: TaskDateShape = startDate ? 'start' : 'end'+ const date = (startDate ?? endDate)!+ const time = startDate ? startTime : endTime+ return time+ ? { ...base, start: utcDateTime(date, time), allDay: false, extendedProps: { task, shape } }+ : { ...base, start: date, allDay: true, extendedProps: { task, shape } }+}++function toLocalDate(value: string | Date): Date {+ return typeof value === 'string' ? new Date(`${value}T00:00:00`) : value+}++/** Whether the event is shown on the given local day (all-day ends are exclusive, like FullCalendar's). */+export function occupiesDay(event: TaskCalendarEvent, day: Date): boolean {+ const start = toLocalDate(event.start)+ const end = event.end ? toLocalDate(event.end) : event.allDay ? addDays(start, 1) : start+ const nextDay = addDays(day, 1)+ return start < nextDay && (end > day || start >= day)+}diff --git a/web/src/locales/de.ts b/web/src/locales/de.tsindex a30f692..5a58960 100644--- a/web/src/locales/de.ts+++ b/web/src/locales/de.ts@@ -99,6 +99,7 @@ export default {tasks: 'Liste',kanban: 'Kanban',graph: 'Graph',+ calendar: 'Kalender',sprints: 'Sprints',collaboration: 'Zusammenarbeit',integrations: 'Integrationen',@@ -283,6 +284,22 @@ export default {deleted: 'Serie gelöscht',},},+ calendar: {+ title: 'Kalender',+ today: 'Heute',+ previous: 'Vorheriger Zeitraum',+ next: 'Nächster Zeitraum',+ views: {+ month: 'Monat',+ week: 'Woche',+ list: 'Liste',+ },+ subtasks: 'Unteraufgaben: {count}',+ empty: {+ title: 'Hier erscheinen Aufgaben mit Datum',+ description: 'Öffnen Sie eine Aufgabe und legen Sie ein Start- oder Enddatum fest, um sie im Kalender zu sehen.',+ },+ },graph: {title: 'Graph',description: 'Graphansicht in Kürze verfügbar',diff --git a/web/src/locales/en.ts b/web/src/locales/en.tsindex 01314d3..5d80c1d 100644--- a/web/src/locales/en.ts+++ b/web/src/locales/en.ts@@ -113,6 +113,7 @@ export default {tasks: 'Tasks',kanban: 'Kanban',graph: 'Graph',+ calendar: 'Calendar',sprints: 'Sprints',collaboration: 'Collaboration',integrations: 'Integrations',@@ -297,6 +298,22 @@ export default {deleted: 'Series deleted',},},+ calendar: {+ title: 'Calendar',+ today: 'Today',+ previous: 'Previous period',+ next: 'Next period',+ views: {+ month: 'Month',+ week: 'Week',+ list: 'List',+ },+ subtasks: 'Subtasks: {count}',+ empty: {+ title: 'Tasks with dates appear here',+ description: 'Open a task and set a start or end date to see it on the calendar.',+ },+ },graph: {title: 'Graph',description: 'Graph view coming soon',diff --git a/web/src/locales/es.ts b/web/src/locales/es.tsindex eca4189..e57281e 100644--- a/web/src/locales/es.ts+++ b/web/src/locales/es.ts@@ -99,6 +99,7 @@ export default {tasks: 'Lista',kanban: 'Kanban',graph: 'Gráfico',+ calendar: 'Calendario',sprints: 'Sprints',collaboration: 'Colaboración',integrations: 'Integraciones',@@ -283,6 +284,22 @@ export default {deleted: 'Serie eliminada',},},+ calendar: {+ title: 'Calendario',+ today: 'Hoy',+ previous: 'Período anterior',+ next: 'Período siguiente',+ views: {+ month: 'Mes',+ week: 'Semana',+ list: 'Lista',+ },+ subtasks: 'Subtareas: {count}',+ empty: {+ title: 'Aquí aparecen las tareas con fecha',+ description: 'Abre una tarea y ponle fecha de inicio o de fin para verla en el calendario.',+ },+ },graph: {title: 'Gráfico',description: 'La vista de gráfico estará disponible pronto',diff --git a/web/src/locales/pt-br.ts b/web/src/locales/pt-br.tsindex ec79171..9962fd7 100644--- a/web/src/locales/pt-br.ts+++ b/web/src/locales/pt-br.ts@@ -112,6 +112,7 @@ export default {tasks: 'Tarefas',kanban: 'Kanban',graph: 'Gráfico',+ calendar: 'Calendário',sprints: 'Sprints',collaboration: 'Colaboração',integrations: 'Integrações',@@ -296,6 +297,22 @@ export default {deleted: 'Série excluída',},},+ calendar: {+ title: 'Calendário',+ today: 'Hoje',+ previous: 'Período anterior',+ next: 'Próximo período',+ views: {+ month: 'Mês',+ week: 'Semana',+ list: 'Lista',+ },+ subtasks: 'Subtarefas: {count}',+ empty: {+ title: 'Aqui aparecem as tarefas com data',+ description: 'Abra uma tarefa e defina uma data de início ou de término para vê-la no calendário.',+ },+ },graph: {title: 'Gráfico',description: 'A visualização em gráfico estará disponível em breve',diff --git a/web/src/locales/ru.ts b/web/src/locales/ru.tsindex e39128b..03439b7 100644--- a/web/src/locales/ru.ts+++ b/web/src/locales/ru.ts@@ -113,6 +113,7 @@ export default {tasks: 'Список',kanban: 'Канбан',graph: 'Граф',+ calendar: 'Календарь',sprints: 'Спринты',collaboration: 'Совместная работа',integrations: 'Интеграции',@@ -297,6 +298,22 @@ export default {deleted: 'Серия удалена',},},+ calendar: {+ title: 'Календарь',+ today: 'Сегодня',+ previous: 'Предыдущий период',+ next: 'Следующий период',+ views: {+ month: 'Месяц',+ week: 'Неделя',+ list: 'Список',+ },+ subtasks: 'Подзадачи: {count}',+ empty: {+ title: 'Здесь появляются задачи с датой',+ description: 'Откройте задачу и укажите дату начала или окончания, чтобы увидеть её в календаре.',+ },+ },graph: {title: 'Граф',description: 'Вид графа скоро будет доступен',diff --git a/web/src/pages/user/calendar.vue b/web/src/pages/user/calendar.vuenew file mode 100644index 0000000..b3f67ae--- /dev/null+++ b/web/src/pages/user/calendar.vue@@ -0,0 +1,43 @@+<template>+ <UDashboardPanel id="calendar">+ <template #header>+ <UDashboardNavbar+ :title="`${projectName} - ${t('calendar.title')}`"+ :ui="{title: 'shrink-0'}"+ >+ <template #leading>+ <TvCollapseSidebarDesktop />+ </template>+ </UDashboardNavbar>+ </template>++ <template #body>+ <ProjectCalendar+ v-if="projectId && canViewTasks"+ :goal-id="projectId"+ class="h-full"+ />+ </template>+ </UDashboardPanel>+ <TvTaskDetailOverlay />+</template>++<script setup lang="ts">+import { computed } from 'vue'+import { useI18n } from 'vue-i18n'+import ProjectCalendar from '@/components/features/calendar/ProjectCalendar.vue'+import TvCollapseSidebarDesktop from '@/components/features/base/TvCollapseSidebarDesktop.vue'+import TvTaskDetailOverlay from '@/components/features/tasks/TvTaskDetailOverlay.vue'+import { useAppRouteInfo } from '@/composables/useAppRouteInfo'+import { useGoalsStore } from '@/stores/goals.store'+import { useProjectDataLoader } from '@/composables/useProjectDataLoader'+import { useGoalPermissions } from '@/composables/useGoalPermissions'++const { t } = useI18n()+const { projectId } = useAppRouteInfo()+const goalsStore = useGoalsStore()+const projectName = computed(() => goalsStore.goalMap.get(projectId.value)?.name ?? '')+const { canViewTasks } = useGoalPermissions()++useProjectDataLoader(projectId)+</script>diff --git a/web/src/stores/calendar.store.ts b/web/src/stores/calendar.store.tsnew file mode 100644index 0000000..b04d0d6--- /dev/null+++ b/web/src/stores/calendar.store.ts@@ -0,0 +1,59 @@+import { defineStore } from 'pinia'+import { ALL_TASKS_LIST_ID, type GoalItem } from 'taskview-api'+import { $tvApi } from '@/plugins/axios'+import { logError } from '@/helpers/Helper'+import type { TaskItem } from '@/types/tasks.types'++type CalendarStore = {+ goalId: GoalItem['id'] | null+ tasks: TaskItem[]+ loading: boolean+}++let latestRequest = 0++export const useCalendarStore = defineStore('use-calendar-store', {+ state: (): CalendarStore => ({+ goalId: null,+ tasks: [],+ loading: false,+ }),++ actions: {+ // Own request instead of tasksStore.fetchAllTasks, so the List view's search and filters don't leak in+ async fetchTasks(goalId: GoalItem['id']) {+ // Don't show the previous project's tasks while the new ones load+ if (this.goalId !== goalId) this.tasks = []+ this.goalId = goalId+ this.loading = true+ const request = ++latestRequest++ const tasks = await $tvApi.tasks+ .fetch({+ goalId,+ componentId: ALL_TASKS_LIST_ID,+ page: 0,+ // showCompleted picks one side (open or done); ignoreCompleted returns both+ showCompleted: 0,+ ignoreCompleted: true,+ firstNew: 0,+ unlimited: true,+ })+ .catch(logError)++ // Only the latest request may update state: a slower, older response must not overwrite it+ if (request !== latestRequest) return+ this.loading = false+ if (tasks) this.tasks = tasks+ },++ syncTask(task: TaskItem) {+ const local = this.tasks.find((t) => t.id === task.id)+ if (local) Object.assign(local, task)+ },++ removeTask(taskId: number) {+ this.tasks = this.tasks.filter((t) => t.id !== taskId)+ },+ },+})