Remember for each user which Kanban cards have their task list open

The open cards are kept in the user's board preferences (expanded_cards,
at most 500), saved without redrawing the board and restored on return.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-11-30 11:25:58 +02:00
co-authored by Claude Opus 5.5
parent e274a8d2b1
commit 9eac4c4d4e
10 changed files with 172 additions and 21 deletions
@@ -15,9 +15,10 @@ use Illuminate\Database\Eloquent\Model;
* @property string $urgent_threshold
* @property array<string, string>|null $column_colors
* @property array<string, string>|null $column_sorts
* @property list<string>|null $expanded_cards
*/
#[Table('job_board_preferences')]
#[Fillable(['user_id', 'density', 'urgent_threshold', 'column_colors', 'column_sorts'])]
#[Fillable(['user_id', 'density', 'urgent_threshold', 'column_colors', 'column_sorts', 'expanded_cards'])]
class JobBoardPreferenceModel extends Model
{
/**
@@ -29,6 +30,7 @@ class JobBoardPreferenceModel extends Model
'user_id' => 'integer',
'column_colors' => 'array',
'column_sorts' => 'array',
'expanded_cards' => 'array',
];
}
}
@@ -38,7 +38,7 @@ class EloquentBoardRepository implements BoardRepository
return $model === null
? BoardPreferences::defaults()
: BoardPreferences::fromStored($model->density, $model->urgent_threshold, $model->column_colors ?? [], $model->column_sorts ?? []);
: BoardPreferences::fromStored($model->density, $model->urgent_threshold, $model->column_colors ?? [], $model->column_sorts ?? [], $model->expanded_cards ?? []);
}
public function savePreferences(int $userId, BoardPreferences $preferences): void
@@ -48,6 +48,7 @@ class EloquentBoardRepository implements BoardRepository
'urgent_threshold' => $preferences->urgentThreshold->value,
'column_colors' => $preferences->colorValues(),
'column_sorts' => $preferences->sortValues(),
'expanded_cards' => $preferences->expandedCards,
]);
}
}