test-repo/gang-board-sorting-notes.md

53 lines
1.5 KiB
Markdown

# Gang Board Sorting - Implementation Notes
## Goal
Sort tasks by last updated date (descending) so the most recently updated tasks appear at the top of each section.
## Files Modified
### 1. `src/components/BacklogView.tsx`
Added sorting to three areas:
- Current sprint tasks
- Backlog tasks
- Other sprint sections
```typescript
// Sort tasks by updatedAt (descending) - latest first
const sortByUpdated = (a: Task, b: Task) =>
new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime()
```
### 2. `src/components/SprintBoard.tsx`
Added sorting to sprint board columns:
```typescript
const sprintTasks = tasks
.filter((t) => t.sprintId === selectedSprintId)
.sort((a, b) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime())
```
## Where It Applies
1. **Backlog View** - All task lists sorted by last updated
2. **Sprint Board** - Tasks in each column sorted by last updated
3. **Current Sprint Section** - Tasks sorted by last updated
4. **Other Sprints Sections** - Tasks sorted by last updated
## Testing Checklist
- [ ] Open backlog view - most recently updated task appears at top
- [ ] Open sprint board - tasks sorted by last updated in each column
- [ ] Edit a task - it moves to top after save
- [ ] Create new task - appears at top of its section
## Deployment Status
**Deployed to Production**
- URL: https://gantt-board.vercel.app
- Commit: 418bf7a
## Notes
- Sorting is client-side (happens in component render)
- No database schema changes required
- Works with existing drag-and-drop functionality