From fae1c1128b9b27c747a7a8b50d7008bcd0e4640a Mon Sep 17 00:00:00 2001 From: "i.seliverstov" Date: Fri, 14 Aug 2026 22:27:53 +0500 Subject: [PATCH 1/2] feat(calendar): mark priority with flag and stripe, not fill Active events show a colored flag and left stripe instead of a tinted card. Completed and overdue keep their own fill. Clearing priority now PATCHes null so JSON no longer drops the field. Co-authored-by: Cursor --- .../features/calendar/lib/calendar-styles.ts | 23 ++++++----- .../features/calendar/ui/AllDaySection.vue | 32 ++++++++++++---- .../calendar/ui/CalendarEventBlock.vue | 38 +++++++++++++++---- .../src/features/calendar/ui/HourGrid.vue | 12 ++++-- .../src/features/tasks/lib/priority.ts | 10 +++++ .../src/features/tasks/model/types.ts | 3 +- .../src/features/tasks/ui/PriorityPicker.vue | 4 +- .../tasks/ui/PriorityPickerContent.vue | 6 +-- .../features/tasks/ui/TaskDetailDialog.vue | 12 +++--- .../src/features/tasks/ui/TaskForm.vue | 2 +- .../calendar/ui/AllDaySection.spec.ts | 18 +++++++++ .../calendar/ui/CalendarEventBlock.spec.ts | 37 ++++++++++++++++-- .../tasks/ui/PriorityPickerContent.spec.ts | 16 ++++++++ .../src/modules/task/dto/update-task.dto.ts | 5 +++ .../src/modules/task/task.service.spec.ts | 11 ++++++ alfy-bot/test/tasks.e2e-spec.ts | 16 ++++++++ 16 files changed, 200 insertions(+), 45 deletions(-) create mode 100644 alfy-bot-frontend/tests/features/tasks/ui/PriorityPickerContent.spec.ts diff --git a/alfy-bot-frontend/src/features/calendar/lib/calendar-styles.ts b/alfy-bot-frontend/src/features/calendar/lib/calendar-styles.ts index 8be08e2..6718b27 100644 --- a/alfy-bot-frontend/src/features/calendar/lib/calendar-styles.ts +++ b/alfy-bot-frontend/src/features/calendar/lib/calendar-styles.ts @@ -1,10 +1,13 @@ -export function getPriorityEventClasses(priority?: string): string { - switch (priority) { - case 'high': return 'bg-red-100 border-red-300 text-red-900 dark:bg-red-500/25 dark:border-red-500/40 dark:text-white dark:backdrop-blur-sm' - case 'medium': return 'bg-amber-100 border-amber-300 text-amber-900 dark:bg-amber-500/25 dark:border-amber-500/40 dark:text-white dark:backdrop-blur-sm' - case 'low': return 'bg-sky-100 border-sky-300 text-sky-900 dark:bg-sky-500/25 dark:border-sky-500/40 dark:text-white dark:backdrop-blur-sm' - default: return 'bg-primary/15 border-primary/40 text-foreground dark:bg-primary/25 dark:text-white dark:backdrop-blur-sm' - } -} - -export const OVERDUE_EVENT_CLASSES = 'bg-red-500/85 border-red-600 text-white dark:bg-red-500/65 dark:border-red-500 dark:backdrop-blur-sm shadow-[0_0_0_1px_rgba(239,68,68,0.35)]' +export const DEFAULT_EVENT_CLASSES = + 'bg-primary/15 text-foreground dark:bg-primary/25 dark:text-white dark:backdrop-blur-sm' + +export const EVENT_SIDE_STRIPE_CLASSES = 'absolute left-0 inset-y-0 w-[3px]' + +export const COMPLETED_EVENT_CLASSES = + 'border bg-emerald-100 border-emerald-300 text-emerald-900 dark:bg-emerald-500/25 dark:border-emerald-500/40 dark:text-white dark:backdrop-blur-sm' + +export const VIRTUAL_EVENT_CLASSES = + 'border border-dashed border-border bg-muted/40 text-muted-foreground dark:border-border/40 dark:bg-muted/60 dark:text-white dark:backdrop-blur-sm' + +export const OVERDUE_EVENT_CLASSES = + 'border bg-red-500/85 border-red-600 text-white dark:bg-red-500/65 dark:border-red-500 dark:backdrop-blur-sm shadow-[0_0_0_1px_rgba(239,68,68,0.35)]' diff --git a/alfy-bot-frontend/src/features/calendar/ui/AllDaySection.vue b/alfy-bot-frontend/src/features/calendar/ui/AllDaySection.vue index cc748a0..7578d8b 100644 --- a/alfy-bot-frontend/src/features/calendar/ui/AllDaySection.vue +++ b/alfy-bot-frontend/src/features/calendar/ui/AllDaySection.vue @@ -21,7 +21,7 @@ v-for="event in getEventsForDay(day)" :key="event.taskId" :class="[ - 'text-[10px] px-1.5 py-0.5 rounded max-w-full border flex items-center gap-0.5', + 'relative overflow-hidden text-[10px] px-1.5 py-0.5 rounded max-w-full flex items-center gap-0.5', event.task.isOverdue ? 'cursor-not-allowed' : event.isVirtual @@ -30,16 +30,30 @@ event.task.isOverdue ? OVERDUE_EVENT_CLASSES : event.completed - ? 'bg-muted border-border line-through' + ? 'border bg-muted border-border line-through' : event.isVirtual - ? 'border-dashed border-border/60 bg-muted' - : chipClasses(event), + ? 'border border-dashed border-border/60 bg-muted' + : DEFAULT_EVENT_CLASSES, highlightedTaskId === event.taskId && 'ring-2 ring-primary', ]" :draggable="!event.isVirtual && !event.task.isOverdue" @dragstart="onDragStart($event, event)" @click.stop="$emit('open', event)" > +