| 125 | }; |
| 126 | |
| 127 | export class TaskListView extends BasesViewBase { |
| 128 | type = "tasknotesTaskList"; |
| 129 | |
| 130 | private configLoaded = false; // Track if we've successfully loaded config |
| 131 | private itemsContainer: HTMLElement | null = null; |
| 132 | private currentTaskElements = new Map<string, HTMLElement>(); |
| 133 | private lastRenderWasGrouped = false; |
| 134 | private lastFlatPaths: string[] = []; |
| 135 | private lastVirtualItems: TaskListVirtualItem[] = []; |
| 136 | private lastTaskSignatures = new Map<string, string>(); |
| 137 | private lastCardRenderSignature = ""; |
| 138 | private taskInfoCache = new Map<string, TaskInfo>(); |
| 139 | private clickTimeouts = new Map<string, number>(); |
| 140 | private currentTargetDate = createUTCDateFromLocalCalendarDate(new Date()); |
| 141 | private containerListenersRegistered = false; |
| 142 | private virtualScroller: VirtualScroller<TaskListVirtualItem> | null = null; // Can render TaskInfo or group headers |
| 143 | private useVirtualScrolling = false; |
| 144 | private collapsedGroups = new Set<string>(); // Track collapsed group keys |
| 145 | private collapsedSubGroups = new Set<string>(); // Track collapsed sub-group keys |
| 146 | private subGroupPropertyId: string | null = null; // Property ID for sub-grouping |
| 147 | private defaultCollapsedState: DefaultCollapsedState = "Expanded"; |
| 148 | private expandedRelationshipFilterMode: TaskCardOptions["expandedRelationshipFilterMode"] = |
| 149 | "inherit"; |
| 150 | private currentVisibleTaskPaths = new Set<string>(); |
| 151 | private currentVisibleTaskOrder = new Map<string, number>(); |
| 152 | private expandedRelationshipTaskPaths = new Set<string>(); |
| 153 | private expandedRelationshipTaskOrder = new Map<string, number>(); |
| 154 | private hideTopLevelSubtasks = false; |
| 155 | private currentPrimaryGroupKeys: string[] = []; |
| 156 | private currentSubGroupKeysByParent = new Map<string, string[]>(); |
| 157 | private initializedPrimaryGroupKeys = new Set<string>(); |
| 158 | private initializedSubGroupKeys = new Set<string>(); |
| 159 | private deferCollapseDefaultForNextSnapshot = false; |
| 160 | |
| 161 | // Drag-to-reorder state |
| 162 | private basesController: TaskListController; |
| 163 | private draggedTaskPath: string | null = null; |
| 164 | private dragGroupKey: string | null = null; |
| 165 | private currentInsertionGroupKey: string | null = null; |
| 166 | private currentInsertionSegmentIndex = -1; |
| 167 | private currentInsertionIndex = -1; |
| 168 | private pendingDragClientY: number | null = null; |
| 169 | private pendingRender = false; |
| 170 | private taskGroupKeys = new Map<string, string>(); // task path → group key (set during grouped render) |
| 171 | private sortScopeTaskPaths = new Map<string, string[]>(); |
| 172 | private sortScopeCandidateTaskPaths = new Map<string, string[]>(); |
| 173 | private dragOverRafId = 0; // rAF handle for throttled dragover |
| 174 | private dragContainer: HTMLElement | null = null; // Container holding siblings during drag |
| 175 | private currentDropSlotElement: HTMLElement | null = null; |
| 176 | private currentDropSlotPosition: "before" | "after" | null = null; |
| 177 | private dragBaselineCards: TaskListDropBaselineCard[] = []; |
| 178 | private dropQueue = new DropOperationQueue(); |
| 179 | |
| 180 | /** |
| 181 | * Threshold for enabling virtual scrolling in task list view. |
| 182 | * Virtual scrolling activates when total items (tasks + group headers) >= 100. |
| 183 | * Benefits: ~90% memory reduction, eliminates UI lag for large lists. |
| 184 | * Lower than KanbanView (30) because task cards are simpler/smaller. |
nothing calls this directly
no test coverage detected