LinkDesk/frontend/docs/task-browser-duplicate-sele...

33 lines
1.3 KiB
Markdown

# Task Browser Duplicate Selection Bug Fix
## Problem
When checking a checkbox in the task browser, it would select the intended row PLUS an additional row 97 positions higher:
- Checking row 0 → selected rows 0 and 97
- Checking row 1 → selected rows 1 and 98
- Checking row 2 → selected rows 2 and 99
## Root Cause
There were **two watchers** on `filteredTasks` in `TaskBrowser.vue`:
1. One added at line ~306 (the correct one)
2. One added at line ~423 (duplicate)
Both watchers were trying to clean up invalid selections, but they were interfering with each other and causing race conditions that resulted in incorrect row selections.
## Solution
Removed the duplicate watcher at line ~423, keeping only the first watcher that properly cleans up stale selections when filtered tasks change.
Also cleaned up excessive debug logging that was added during troubleshooting.
## Files Changed
- `frontend/src/components/task/TaskBrowser.vue`
- Removed duplicate `watch(filteredTasks)` watcher
- Removed debug console.log statements
## Testing
After the fix:
1. Reload the page
2. Check any checkbox - only that row should be selected
3. Check multiple checkboxes - only those rows should be selected
4. Right-click to open context menu - selection should be preserved correctly
5. Apply filters - stale selections should be cleaned up automatically