TypeScript Kanban Board II
Extend the board from TypeScript Kanban Board I. The starter is a working board: the arrows move tasks between statuses and are hidden at the edges. But a moved task shows up wherever it sat in the original list, sometimes above tasks that were already in its new column.
Requirements
- Whenever a task's status changes, place it at the bottom of its destination column. Every other task keeps its order.
- Moving the same task again, or back, appends it again. It never appears twice.
- Keep the single
MOVE_TASKreducer action and immutable updates. - Keep the starter's markup: each column is a
<section>labelled by its heading, each task a list item showing its title, and the controls are buttons labelledMove <title> leftandMove <title> right.
Then be ready to discuss how the design changes when the board holds 100,000 tasks, both what it costs to render and what one move costs to compute.
Hints
Hint 1
Filtering one flat array by status cannot express "last in this column" without reordering the whole array. Keep an ordered list of task IDs per status instead.
Hint 2
Normalize the state as tasksById plus idsByStatus. A move removes the ID from the source list, updates the task's status once, and appends the ID to the destination list.
Hint 3
Trace two moves of the same task by hand. The ID must leave its old list every time, or it will show up twice.
Asked at
Sign in to use the assistant — ask what the problem means, get a hint when you're stuck, or have your current work reviewed. Conversations save to your account.