From 34b086b4c737932c2a0c6420d3a35e186f2c82ba Mon Sep 17 00:00:00 2001 From: Johannes Millan Date: Mon, 30 Mar 2026 17:43:11 +0200 Subject: [PATCH] fix(boards): add missing drag delay for touch and extract shared signal Add cdkDragStartDelay to board-panel drag items, which was missing entirely. Extract the repeated `isTouchActive() ? DRAG_DELAY_FOR_TOUCH : 0` expression into a shared `dragDelayForTouch` computed signal and refactor all 8 components to use it. --- .../features/boards/board-panel/board-panel.component.html | 1 + .../features/boards/board-panel/board-panel.component.ts | 2 ++ src/app/features/note/notes/notes.component.html | 2 +- src/app/features/note/notes/notes.component.ts | 7 +++---- .../planner-day-overdue/planner-day-overdue.component.html | 2 +- .../planner-day-overdue/planner-day-overdue.component.ts | 6 ++---- .../planner/planner-day/planner-day.component.html | 4 ++-- .../features/planner/planner-day/planner-day.component.ts | 6 ++---- .../schedule/schedule-week/schedule-week.component.html | 2 +- .../schedule/schedule-week/schedule-week.component.ts | 5 ++--- .../habit-tracker/habit-tracker.component.html | 2 +- .../habit-tracker/habit-tracker.component.ts | 6 ++---- src/app/features/tasks/task-list/task-list.component.html | 2 +- src/app/features/tasks/task-list/task-list.component.ts | 6 ++---- src/app/ui/tree-dnd/tree.component.html | 2 +- src/app/ui/tree-dnd/tree.component.ts | 6 ++---- src/app/util/input-intent.ts | 5 +++++ 17 files changed, 31 insertions(+), 35 deletions(-) diff --git a/src/app/features/boards/board-panel/board-panel.component.html b/src/app/features/boards/board-panel/board-panel.component.html index 74e220bdc0..ec0caf9c05 100644 --- a/src/app/features/boards/board-panel/board-panel.component.html +++ b/src/app/features/boards/board-panel/board-panel.component.html @@ -41,6 +41,7 @@ diff --git a/src/app/features/boards/board-panel/board-panel.component.ts b/src/app/features/boards/board-panel/board-panel.component.ts index 7c3417365b..9a394d1a5b 100644 --- a/src/app/features/boards/board-panel/board-panel.component.ts +++ b/src/app/features/boards/board-panel/board-panel.component.ts @@ -37,6 +37,7 @@ import { DialogScheduleTaskComponent } from '../../planner/dialog-schedule-task/ import { MatDialog } from '@angular/material/dialog'; import { fastArrayCompare } from '../../../util/fast-array-compare'; import { first, take } from 'rxjs/operators'; +import { dragDelayForTouch } from '../../../util/input-intent'; import { ShortPlannedAtPipe } from '../../../ui/pipes/short-planned-at.pipe'; import { MsToStringPipe } from '../../../ui/duration/ms-to-string.pipe'; import { selectUnarchivedProjects } from '../../project/store/project.selectors'; @@ -66,6 +67,7 @@ import { }) export class BoardPanelComponent { T = T; + dragDelayForTouch = dragDelayForTouch; panelCfg = input.required(); editBoard = output(); diff --git a/src/app/features/note/notes/notes.component.html b/src/app/features/note/notes/notes.component.html index 51ef1d682c..b24565fccc 100644 --- a/src/app/features/note/notes/notes.component.html +++ b/src/app/features/note/notes/notes.component.html @@ -33,7 +33,7 @@ @for (note of notes; track note.id) {
} diff --git a/src/app/features/planner/planner-day/planner-day.component.ts b/src/app/features/planner/planner-day/planner-day.component.ts index cbcc8f3692..a3fc933cab 100644 --- a/src/app/features/planner/planner-day/planner-day.component.ts +++ b/src/app/features/planner/planner-day/planner-day.component.ts @@ -32,8 +32,7 @@ import { ShortTimeHtmlPipe } from '../../../ui/pipes/short-time-html.pipe'; import { TranslatePipe } from '@ngx-translate/core'; import { ShortDate2Pipe } from '../../../ui/pipes/short-date2.pipe'; import { ProgressBarComponent } from '../../../ui/progress-bar/progress-bar.component'; -import { isTouchActive } from '../../../util/input-intent'; -import { DRAG_DELAY_FOR_TOUCH } from '../../../app.constants'; +import { dragDelayForTouch } from '../../../util/input-intent'; import { LayoutService } from '../../../core-ui/layout/layout.service'; @Component({ @@ -78,8 +77,7 @@ export class PlannerDayComponent { protected readonly T = T; protected readonly SCHEDULE_ITEM_TYPE = ScheduleItemType; - protected readonly isTouchActive = isTouchActive; - protected readonly DRAG_DELAY_FOR_TOUCH = DRAG_DELAY_FOR_TOUCH; + protected readonly dragDelayForTouch = dragDelayForTouch; // Lock Y-axis on small screens only — on wider screens the planner uses a // multi-column grid where cross-column dragging requires horizontal movement. protected readonly isXs = this._layoutService.isXs; diff --git a/src/app/features/schedule/schedule-week/schedule-week.component.html b/src/app/features/schedule/schedule-week/schedule-week.component.html index 9f1db3f226..591f8b3ee4 100644 --- a/src/app/features/schedule/schedule-week/schedule-week.component.html +++ b/src/app/features/schedule/schedule-week/schedule-week.component.html @@ -136,7 +136,7 @@ (cdkDragMoved)="dragMoved($event)" (cdkDragStarted)="dragStarted($event)" (cdkDragReleased)="dragReleased($event)" - [cdkDragStartDelay]="isTouchActive() ? DRAG_DELAY_FOR_TOUCH : 0" + [cdkDragStartDelay]="dragDelayForTouch()" > } @else {