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:
@@ -4,7 +4,7 @@
|
||||
due date, hours and the job's tasks, which open inside the card and can
|
||||
be marked done. Compact cards have three rows.
|
||||
--}}
|
||||
@props(['card', 'compact' => false, 'canMove' => false, 'canColor' => false, 'canCheck' => false])
|
||||
@props(['card', 'expanded' => false, 'compact' => false, 'canMove' => false, 'canColor' => false, 'canCheck' => false])
|
||||
|
||||
@use('App\Modules\Jobs\Presentation\Support\BoardFormat')
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
<article
|
||||
aria-labelledby="card-{{ $card->key() }}-title"
|
||||
x-data="{ expanded: false }"
|
||||
x-data="{ expanded: {{ $expanded ? 'true' : 'false' }} }"
|
||||
class="overflow-hidden rounded-xl border border-neutral-300 bg-white shadow-sm transition dark:border-[#36393f] dark:bg-[#282a2e]"
|
||||
>
|
||||
<x-jobs.board.card-header :card="$card" :can-move="$canMove" :can-color="$canColor" />
|
||||
@@ -40,7 +40,8 @@
|
||||
@if ($total > 0)
|
||||
<button
|
||||
type="button"
|
||||
x-on:click="expanded = ! expanded"
|
||||
x-on:click="expanded = ! expanded; $wire.setCardExpanded('{{ $card->key() }}', expanded)"
|
||||
aria-expanded="{{ $expanded ? 'true' : 'false' }}"
|
||||
x-bind:aria-expanded="expanded.toString()"
|
||||
aria-controls="tasks-{{ $card->key() }}"
|
||||
aria-label="{{ __('jobs.board.tasks_compact', ['done' => $done, 'total' => $total]) }}"
|
||||
@@ -78,7 +79,8 @@
|
||||
<div class="border-t border-neutral-200 pt-1 dark:border-[#36393f]">
|
||||
<button
|
||||
type="button"
|
||||
x-on:click="expanded = ! expanded"
|
||||
x-on:click="expanded = ! expanded; $wire.setCardExpanded('{{ $card->key() }}', expanded)"
|
||||
aria-expanded="{{ $expanded ? 'true' : 'false' }}"
|
||||
x-bind:aria-expanded="expanded.toString()"
|
||||
aria-controls="tasks-{{ $card->key() }}"
|
||||
class="flex min-h-6 w-full items-center justify-between rounded px-1.5 text-[11px] font-semibold text-neutral-800 transition hover:bg-neutral-100 focus-visible:outline-2 focus-visible:outline-primary-600 dark:text-neutral-100 dark:hover:bg-[#32353b] dark:focus-visible:outline-primary-300"
|
||||
@@ -91,7 +93,7 @@
|
||||
@endif
|
||||
|
||||
@if ($total > 0)
|
||||
<div id="tasks-{{ $card->key() }}" x-show="expanded" x-cloak @class(['border-t border-neutral-200 pt-1 dark:border-[#36393f]' => $compact, 'mt-1.5' => ! $compact])>
|
||||
<div id="tasks-{{ $card->key() }}" x-show="expanded" @unless ($expanded) x-cloak @endunless @class(['border-t border-neutral-200 pt-1 dark:border-[#36393f]' => $compact, 'mt-1.5' => ! $compact])>
|
||||
<x-jobs.board.task-list :card="$card" :can-check="$canCheck" :compact="$compact" />
|
||||
</div>
|
||||
@endif
|
||||
|
||||
Reference in New Issue
Block a user