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
@@ -266,3 +266,23 @@ it('shows a subcontractor only their cards, without moving or changing colours',
expect($theirs->fresh()->status->value)->toBe('order');
});
it('remembers for each user which cards have their tasks open', function () {
$job = CustomerJobModel::factory()->create(['status' => 'order', 'responsible_user_id' => $this->employee->id]);
TaskModel::factory()->create(['customer_job_id' => $job->id, 'title' => 'Vedos']);
Livewire::test('jobs::board')
->assertSeeHtml('aria-controls="tasks-job-'.$job->id.'"')
->assertDontSeeHtml('aria-expanded="true"')
->call('setCardExpanded', 'job-'.$job->id, true)
->call('setCardExpanded', 'job-999', true);
expect(json_decode((string) DB::table('job_board_preferences')->where('user_id', $this->employee->id)->value('expanded_cards')))->toBe(['job-'.$job->id]);
Livewire::test('jobs::board')->assertSeeHtml('aria-expanded="true"');
$colleague = User::factory()->create();
$job->update(['responsible_user_id' => $colleague->id]);
$this->actingAs($colleague);
Livewire::test('jobs::board')->assertDontSeeHtml('aria-expanded="true"');
});